GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||
GeezerVison is showing github.com — fix(client-runtime): a thread stays in Working when a late background subagent finishes by juliusmarminge · Pull Request #44453 · pingdotgg/t3code Conversation
|
| Before | After |
|---|---|
| d838e95660 | 953492615d |
| Before video: jump around 4.5–5.5s | After video |
Exact delegation driver, DOM observer, environment, steps and caveats.
Scope: this proves the T3 delegated-background-subagent path. Native Claude Agent-only runs did not reproduce the flicker on base.
Not shown:
vp test run src/state/threadInbox.test.ts (packages/client-runtime) without the fix: 1 failed, 23 passed (the repro test)vp test run src/state/threadInbox.test.ts with the fix: 24 passedvp test run packages/client-runtime/src/state/entities.test.ts packages/client-runtime/src/state/threadShell.test.ts apps/mobile/src/features/threads/threadListV2.test.ts: 105 passedvp run check:changed: format, lint, knip, typecheck and test all passRun by the t3code factory in T3 Code.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…mes after a late subagent Fails on main: the stale-exit rule drops the working grace once the parent's last run is older than a minute, so the thread briefly leaves Working when a long background subagent finishes (#44436). Co-Authored-By: Claude Opus 5.5 <[email protected]>
… subagent finishes The stale-exit rule skipped the working grace whenever the latest run ended more than a minute ago. A parent waiting on background subagents has exactly that run, so when a long subagent finished the thread left Working and jumped to the top until the parent resumed. The tracker now remembers the run end it last saw and only treats an end it had not seen before as stale, which is the case the rule was for (work that finished while the client was away). Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was an error while loading. Please reload this page.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
| Check name | Status | Explanation |
|---|---|---|
| Title check | The title names the affected component and the user-visible bug: a thread stays in Working when a late background subagent finishes. The summary matches the changeset, which changes the inbox tracker'… | |
| Linked Issues check | Issue #44436 requires that a thread stay in Working while its parent resumes after a background subagent finishes, when the parent turn ended more than 60 s earlier. The cause is the endedLongAgo chec… |
|
| Out of Scope Changes check | The whole-PR diff against merge base d838e95 changes only packages/client-runtime/src/state/threadInbox.ts and threadInbox.test.ts. The threadInbox.ts change adds an endedAt field to the tracker stat… | |
| Description check | The description follows the repository template closely. It covers the problem (a thread waiting on a background subagent jumps out of the Working section when the subagent finishes after a parent run… |
Explanation
The title names the affected component and the user-visible bug: a thread stays in Working when a late background subagent finishes. The summary matches the changeset, which changes the inbox tracker's stale-exit rule so a run end the client already saw keeps the Working grace.
Explanation
Issue #44436 requires that a thread stay in Working while its parent resumes after a background subagent finishes, when the parent turn ended more than 60 s earlier. The cause is the endedLongAgo check in threadInbox.ts, which skips the 2 s WORKING_EXIT_GRACE_MS. At head, endedLongAgo also requires previous?.endedAt !== endedAt. The tracker now stores endedAt per thread. A run end the client already observed while the thread kept working therefore keeps the grace. The new unit test in threadInbox.test.ts ('holds a thread whose background subagent finished long after its turn ended') covers this path: the thread is observed working, time advances 80+ s, the subagent completes with the same completedAt, and isWorking stays true with no returnedAt. A run end the client first sees already stale still moves the thread at once, which matches the STALE_EXIT_MS intent. The real-app before/after evidence is still pending in the PR description. That evidence is not a coding requirement, so it does not change this result. The disconnected-client case is an explicit known limitation in the PR and the issue does not require it.
Explanation
The whole-PR diff against merge base d838e95 changes only packages/client-runtime/src/state/threadInbox.ts and threadInbox.test.ts. The threadInbox.ts change adds an endedAt field to the tracker state and a condition on endedLongAgo. Both directly implement the #44436 fix. The test adds one regression case for the same scenario. The PR does not change STALE_EXIT_MS or WORKING_EXIT_GRACE_MS, and it adds no unrelated refactoring. No out-of-scope change was found.
Explanation
The description follows the repository template closely. It covers the problem (a thread waiting on a background subagent jumps out of the Working section when the subagent finishes after a parent run ended over a minute earlier), the change (the stale-exit rule now applies only to a run end the client had not already seen), and the scope (it links issue #44436 and describes a bug fix). Verification is detailed: focused test results with and without the fix, a real-app reproduction with before/after evidence, and CI status. It also states what was not checked and includes the model and harness used. Minor gaps: the 'Scope' section does not say why the change needs no separate issue, but a linked issue is provided. The 'Evidence' section admits the native Claude path was not reproduced, which narrows the claim but is disclosed honestly. The 'Change' section is brief but adequate for a focused fix. The Problem heading is present, and the title line is absent from the body, which is acceptable.
21af71f0-edca-4b61-a17d-83e2ad908739packages/client-runtime/src/state/threadInbox.test.tspackages/client-runtime/src/state/threadInbox.tsIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
… subagent finishes (pingdotgg#44453) (cherry picked from commit 76e38ee)
This merges upstream `pingdotgg/t3code` at `85d855bd82` (base `3ed650f999`, 683 commits) with a merge commit. It is not stacked: no other merge PR was open. The decisions are recorded under the 2026-11-28 entry in `docs/fork/upstream-merge-log.md`. ## Numbers - Landed `1576` files, and the upstream range is `1576` files. They match exactly. - The fork delta is `789` files (`git diff HEAD^2 HEAD`). - 10 conflicts, all resolved by their path-policy verdict. 60 files auto-merged, and `duplicate-adds` and `resolution-check` are clean. ## Conflict resolutions - **`ChatMarkdown.tsx`**: takes upstream's `useFileDownload` and keeps the `FEATURES.openInEditor` gate. - **`ChatView.tsx`**: `ChatRightPanel` takes upstream's `ref` and keeps the fork's `threadRef`. - **`Sidebar.tsx`, `useThreadActionMenu.ts` and its test**: take upstream's `canMarkLatestRunUnread` and keep `isPublic` and `isFollowed`. - **`ThreadDetailsPanel.tsx`**: the Artifacts section stays after lineage, and upstream's new Agent tasks section comes after it. - **`FilePreviewPanel.tsx`**: takes upstream's positioned `useFileLineReveal` and keeps `browserFrameRevision`. - **`PreviewView.tsx`**: imports both helpers. - **`agentContextBudget.json`**: upstream plus 108 bytes (`62578`). `AgentContextBudget.test.ts` passes. - **`reviewCommentSelection.test.ts`** (`theirs`): the fork's cosmetic rename of a test title is dropped. - **Lockfile**: taken from upstream and re-installed, which restores the fork's edges. `verify --only lockfile` passes. ## Fixes after resolving These were caught by typecheck and tests, not by conflict markers: - **`sandboxControl.placement.test.tsx`** passes upstream's new required `onCloseSelectedSurfaces` prop. - **`rightPanelStore.ts` `retargetFile`** uses upstream's module-wide `++lastFileRevealRequestId` (pingdotgg#44374) rather than `revealRequestId + 1`, which could reuse another surface's id. Its tests now compare ids relative to each other. - **`ChatView.browser.test.tsx`**: upstream's pingdotgg#43920 case now expects "Sandbox required", because a draft has no sandbox. The file joined `upstream-tests-fork-assumptions` in the inventory. ## Verification - **Static checks:** duplicate-adds, tripwires, resolution-check, unsupported-methods, lockfile, fmt, lint, typecheck and build all pass. - **`@t3tools/web`:** 738 of 738 test files pass. This used `PLAYWRIGHT_BROWSERS_PATH` with a fetched headless shell 1248, because the image now ships 1255. - **Known sandbox failures:** - ssh `tunnel` and opencode `OpenCodeServerLedger` fail as on the last merge. - `t3` fails, and `verify` marks it as the `/tmp` sticky-bit gap. The files that fail alone are the same set as 2026-11-26, plus `processRunner.test.ts`. That one fails inside upstream's new spawn proxy, and the file is not in the fork delta. - **Commit:** made with `--no-verify` because of the known knip pre-commit failure. ## Feature classification ### Usable as-is - Open project imports from Projects settings (pingdotgg#44662). - Copy chat tables as text or PNG (pingdotgg#44055, pingdotgg#43435). - Rendered markdown preview from the file tree (pingdotgg#30027). - Multi-select side-panel tabs (pingdotgg#43946). - Copy paths from the file sidebar (pingdotgg#43360). - Sidebar folder Show more and Show less (pingdotgg#43598). - Agent tasks section in Thread details (pingdotgg#29705). - Previews keep their place across files and tabs (pingdotgg#44374, pingdotgg#44517). - EPUB, ODT, RTF, Word, CSV and archive preview fixes. - Command-label rendering fixes (pingdotgg#43626). - Shortcuts on non-Latin layouts (pingdotgg#44275). - About 40 i18n fixes. - Password-protected previews (pingdotgg#44008). These unlock on the client but still need the file bytes from the backend. ### Unsupported in Moatless / needs implementation - **Download file** from the Files panel and chat links (pingdotgg#43833, `useFileDownload.ts`). It calls `assets.createUrl` with `draft-workspace-file` and `disposition: "attachment"`. Moatless `crates/t3code/src/assets.rs` `create_url` refuses that tag, so every click shows a "Could not download file" toast. This is new in `gaps.md`: *Download file asks for an asset resource Moatless refuses*. - **Jira Cloud and Jira Service Management trackers** (pingdotgg#38003, pingdotgg#39942). They add `credential.fields`, the `commentAudiences` and `assigneeSearch` capabilities, and the `refresh` and `query` inputs. Connecting stays refused, so nothing new shows. Extends the existing Issue trackers item. - **Usage-limits-only refresh** (`limitsOnly`, `unreadProviders`, pingdotgg#41726), with no Moatless producer. - **Remote `localhost` links through a port forward** (pingdotgg#44452). - **Built-in browser HTTP Basic Auth** (`authChallengeId`, pingdotgg#35046). - **Subagent environment display** (pingdotgg#44393). - **Optional contract fields with no Moatless producer:** - `ProviderStatus.modelsIncomplete` - `PullRequest.host` and `changedFiles` - project link `readOnly` - `createdBranch` - orchestrator `favorite` - No RPC method was added, so `unsupported-methods` reports no ADD and no DROP. ### Backend behavior to consider reproducing in Moatless This is recorded as a new range bullet under *Runtime fixes upstream made to its own server* in `gaps.md`: - **Settlement and worktrees:** - Settle scripts are serialized, and shared worktrees skip them (pingdotgg#44363, pingdotgg#44491). - A successful settle closes its script terminal (pingdotgg#44351). - Settling a delivered delegated child archives it (pingdotgg#44615). - A partially deleted worktree stays removable (pingdotgg#44406). - **Child and background work:** - Delegated completions wake the thread's own session (pingdotgg#44637). - `task_cancel` also cancels queued follow-ups (pingdotgg#44560). - A thread stays Working until a late subagent finishes (pingdotgg#44453). - A Monitor-woken child is not cut off (pingdotgg#43899). - **Titles and launches:** - Titles stop at the first line break (pingdotgg#44597). - A title the provider refused is not retried (pingdotgg#44057). - A blank `t3_thread_launch` starts no turn (pingdotgg#44467). - A pre-launch message no longer strands the run (pingdotgg#44133). - **Provider sessions:** - Idle threads detach from shared sessions (pingdotgg#44020). - `/compact` and handoff token caps (pingdotgg#44295, pingdotgg#43868). - **Read paths:** - Shared thread reads for PR sweeps (pingdotgg#44369, pingdotgg#44341). - Filtered turn-item reads (pingdotgg#43981, pingdotgg#43549). - Limited rescans (pingdotgg#43969). - Checkpoints skip nested checkouts (pingdotgg#43744). - PR watches with no required checks (pingdotgg#42787). ## Owned-concern sweep There were 3 hits: mobile app-state wakeups, the server issue tracker host and Cursor Origin lookup. All three are upstream's own and were taken. No new upstream workflows arrived. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- Moatless task: https://moatless.soaplabstest.com/tasks/1fcda118-593a-4d92-9b13-dc7667eabe2c
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
[Bug]: Thread briefly jumps to the top of the sidebar (out of Working) each time a background subagent finishes
There was an error while loading. Please reload this page.