Repository navigation
fix(web): Lineage keeps the latest batch of finished agents in view - #34872
juliusmarminge wants to merge 2 commits into
Conversation
Failing repro for #26411: finished subagents from the thread's latest agent batch fold into the collapsed Previous agents group. AI-assisted; verified with the tests and tools listed above.
The thread details panel folded every finished subagent into the collapsed Previous agents group, so the batch a thread just ran looked gone. Only agents from runs older than the latest run that launched agents fold away now. AI-assisted; verified with the tests and tools listed above. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Needs Human Approval Macroscope's review found this PR requires human approval — The latest finished agent batch now stays visible by default instead of collapsing into Previous agents. Human review is needed to confirm this change to the default Lineage presentation. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
The automated pipeline stopped on this pull request and will not merge it: the capture step could not show the problem on the base commit, so there is nothing to prove fixed. On each commit: (1) Start a fresh parent thread and delegate one remote task titled Older remote; await completion. (2) Open thread details and record the Lineage panel. (3) Send a second turn launching native local tasks Files and Readme plus a remote task New remote; await all three. (4) Send 'Reply with just the word ok. Do not use any tools.' (5) Capture collapsed history, expand Previous agents, capture, then collapse it. Base showed Previous agents 4; expansion revealed all four agents. Head kept Readme, Files, and New remote visible with Previous agents 1 containing Older remote. The no-tool follow-up preserved these states. Older completed remote agents remaining visible outside history did not reproduce on base. It stays open for a person to finish or close. |
ThreadRelationshipsPanel grouped every finished subagent edge (and every finished remote-environment subagent) into the collapsed 'Previous agents' group whatever run launched it, so the batch a thread just ran folded away as soon as it settled. The panel now computes the latest batch: the run with the highest ordinal among non-rolled-back runs that launched any subagent. A finished agent goes to 'Previous agents' only when its runId is not that run. A later turn that launches no agents leaves the last batch in the main list; the next turn that launches agents folds the old batch away. Rolled-back runs are skipped, as in the mobile rule from #25759. Both the local-edge grouping and the remote-agent grouping use the same predicate. No new regex or parser.
Fixes #26411
Reproduction on main
Commit 6ba3de7 (origin/main). Ran the web client with T3CODE_DEV_SEED=0 vp run dev (fresh database) and added a one-file git project with
t3 project add. Enabled the OpenCode provider and started a thread witht3 thread start --provider opencode --model opencode/big-pickle. The prompt made the agent call its task tool twice. The timeline showed '2 subagents, 2 done'. Opened the thread in the browser and toggled the thread details panel: Lineage showed only a collapsed 'Previous agents 2' row, with neither agent in the main list. Then sent a follow-up witht3 thread send('Reply with just the word ok. Do not use any tools.'), which launched no agents. The panel still showed only the collapsed 'Previous agents 2'. Expanding it revealed the two agents from the previous turn ('List directory files', 'Read README contents'). Also added a browser test to ThreadRelationshipsControl.browser.test.tsx with three completed runs, an older finished agent in run 1 and a latest finished agent in run 2. It fails on main because the latest agent is not in the document until 'Previous agents' is expanded. With the group expanded the row renders, so the fixture is valid.Evidence
Being captured: before and after in the real app. This section is filled in before the pull request can merge.
Tests
vp test run src/components/chat/ThreadRelationshipsControl.browser.test.tsx: without the fix 1 failed / 10 passed (the repro test 'keeps the latest batch of finished agents in view after a later turn launches none'); with the fix 11 passed. vp run check:changed: format, lint, knip, typecheck (2 packages), tests (1 file), react compiler all pass.
Not in this change
AI-assisted; verified with the tests and tools listed above.