feat(web): show full accumulated subagent progress - #1109
Conversation
The subagent detail panel only showed the most recent 40 progress lines because the reducer truncated the accumulated output. Keep the full history so the panel reflects the entire process as it grows.
🦋 Changeset detectedLatest commit: 4238c07 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0203babfdd
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| outputLines: [...outputLines, event.outputChunk].slice(-40), | ||
| // Accumulate the full progress so the subagent panel can show the | ||
| // entire process, not just the most recent handful of lines. | ||
| outputLines: [...outputLines, event.outputChunk], |
There was a problem hiding this comment.
Preserve progress across projected task updates
In the real subagent WS path, projectSubagentProgress() emits a taskCreated immediately before each taskProgress (apps/kimi-web/src/api/daemon/agentEventProjector.ts:265-272), and the reducer's taskCreated branch replaces the existing task object (eventReducer.ts:520-522). Because that projected task does not carry the reducer-owned outputLines, outputLines here is usually reset to [] for every incoming subagent progress event, so the detail panel still only shows the latest chunk despite this change and the new reducer-only test. Preserve the existing task's outputLines when replacing tasks, or keep the projector's task in sync, so actual subagent progress can accumulate.
Useful? React with 👍 / 👎.
The projector emits a taskCreated (without reducer-owned outputLines) right before every taskProgress, and the taskCreated branch replaced the task object outright, resetting outputLines to empty on each progress event. So the panel still only showed the latest chunk. Preserve the accumulated outputLines when replacing a task, and update the test to mirror the real taskCreated-before-taskProgress path.
Drop the noisy 'Started a step' line and summarize tool calls with a concise target (path / command / pattern) instead of the full JSON args, so the subagent progress panel shows what the subagent is actually doing.
Some subagents name tool calls with a trailing index (e.g. Read_0, Bash_4), which surfaced in tool.result progress lines since the label did not resolve. Strip the index before resolving the label.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 584798044a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| outputLines: [...outputLines, event.outputChunk].slice(-40), | ||
| // Accumulate the full progress so the subagent panel can show the | ||
| // entire process, not just the most recent handful of lines. | ||
| outputLines: [...outputLines, event.outputChunk], |
There was a problem hiding this comment.
Preserve the cap for non-subagent task output
When the daemon sends event.task.progress for a bash/tool background task (the protocol mapper routes those frames into this same reducer event), this now keeps every output chunk in outputLines instead of the previous 40-line tail. A noisy long-running command can therefore grow browser memory and the task detail rendering without bound; keep the full history only for kind: 'subagent' and retain a cap for terminal/background task output.
Useful? React with 👍 / 👎.
Restore a tail cap for background bash/tool task output (which can grow without bound) while keeping subagent progress in full, and cap individual subagent tool.progress chunks so a single huge output cannot dominate the panel.
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Drop the noisy 'Finished' lines, group tool output under its call, and fold long output (first 5 + last 2 lines, expandable) so the subagent progress panel shows the call rhythm at a glance.
Related Issue
N/A — no linked issue.
Problem
The subagent detail panel only showed the most recent 40 progress lines, so for a longer-running subagent the earlier process was lost and the panel felt sparse.
What changed
Stop truncating the accumulated subagent progress in the event reducer, so the detail panel shows the full progress history as it grows.
Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.