Skip to content

feat(web): show full accumulated subagent progress - #1109

Merged
wbxl2000 merged 6 commits into
mainfrom
feat/web-subagent-full-output
Jun 25, 2026
Merged

feat(web): show full accumulated subagent progress#1109
wbxl2000 merged 6 commits into
mainfrom
feat/web-subagent-full-output

Conversation

@wbxl2000

Copy link
Copy Markdown
Collaborator

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

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

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-bot

changeset-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4238c07

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

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

@pkg-pr-new

pkg-pr-new Bot commented Jun 25, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@4238c07
npx https://pkg.pr.new/@moonshot-ai/kimi-code@4238c07

commit: 4238c07

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

wbxl2000 added 3 commits June 25, 2026 23:40
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.
@wbxl2000

Copy link
Copy Markdown
Collaborator Author

@codex

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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.
@wbxl2000

Copy link
Copy Markdown
Collaborator Author

@codex

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 497efd14a0

ℹ️ 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".

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.
@wbxl2000
wbxl2000 merged commit d554f9a into main Jun 25, 2026
8 checks passed
@wbxl2000
wbxl2000 deleted the feat/web-subagent-full-output branch June 25, 2026 16:22
@github-actions github-actions Bot mentioned this pull request Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant