Repository navigation
fix(web): batch subagent rows per user message instead of per turn - #11
Conversation
Direct subagent spawns were batched into one "Kicked off N subagents" row per turn, so steering a turn mid-run left the row stranded in the segment of the first spawn, counting agents that were launched after the steer. Each direct spawn now gets its own work-log row, and the timeline merges the spawns a segment holds into that segment's first row, so each side of a steer shows its own row with its own agents. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
| }); | ||
| }); | ||
|
|
||
| it("batches a turn's direct spawns per segment, so a steer splits the CTA row", () => { |
There was a problem hiding this comment.
新增测试:同一 turn 里 steer 前后各生成两个子代理,期望得到两行,分别是 [task-a, task-b] 和 [task-c, task-d],第一行保留 spawn-1 的 id、时间和 turn。
| it("folds timelineBypass agent rows into one CTA (Codex children, workflow members)", () => { | ||
| // Codex children carry their parent's spawn turn (spawnTurnId stamping), | ||
| // which is what batches a fleet into one CTA. | ||
| it("keeps timelineBypass agent rows as CTA rows (Codex children, workflow members)", () => { |
There was a problem hiding this comment.
Codex 子代理和工作流成员的测试:work log 层现在每个直接生成的子代理各一行,所以期望值从一行改成每个子代理一行;工作流成员仍合并成一行。
| it("turn-less direct spawns do not collapse into one global batch", () => { | ||
| // Rows that lost their turn id (defensive path) group per task, so two | ||
| // unrelated turn-less spawns never merge into one immortal CTA. | ||
| it("direct spawns do not collapse into one global batch", () => { |
There was a problem hiding this comment.
原来的“无 turn id 兜底”测试改写成新规则:每个直接生成的子代理在 work log 层各自一行。
| }; | ||
|
|
||
| it("merges direct-spawn CTA rows across a synthetic continuation into the segment's first one", () => { | ||
| it("keeps every spawn CTA row visible when the fold collapses", () => { |
There was a problem hiding this comment.
原来这个测试断言折叠层会合并两条子代理行;现在折叠层不再合并,改为断言两条行都保持可见、不进折叠。
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
What changed
When the agent starts helper agents, the timeline shows one row for them: "Kicked off N subagents" while they run, "Ran N subagents" once they finish. That row used to gather every direct spawn of a turn, placed where the turn's first spawn landed.
#10 folds the timeline per segment, where a segment is everything between two of your messages, so a steer splits its turn. The subagent row did not follow: it stayed one row per turn, so after a steer the row above the steer counted agents that were launched after it, and the segment below the steer had no row at all.
The row now gathers the direct spawns of a segment. Each direct spawn keeps its own work-log row, and the timeline merges the spawn rows a segment holds into the segment's first one, which keeps its id, time and turn. A steer opens a new segment, so the agents kicked off before it and the agents it caused each get their own row.
In practice:
Mobile has no subagent row, so it is unchanged.
Screenshots
The before column is main at commit 292931c; the after column is main plus this branch. Both run in Docker from a production build, driven by the same script. The script's first message asks the agent to launch one subagent that runs a 5 s command, then run a 30 s command itself. While the 30 s command is still running, the script sends a second message: "launch one more subagent, then reply pong".
Codex is not covered: the Codex CLI in the test image does not expose subagent spawning, so the scenario cannot be driven there. The change is provider-neutral; it runs on the web timeline after the adapters have produced their work-log rows.
Checklist
Written by Claude Fable 5.1 running in Claude Code, driven from T3 Code.