MoonshotAI / MoonshotAI/kimi-code
feat(agent-core): stream live subagent events into background task output buffer
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
The /tasks view only shows a static output preview for background agents. While a subagent is running, the user cannot see what it is currently doing; the output only appears once the task completes or errors.
We fixed this in our fork by wiring the subagent's AgentEvent stream into the background task output buffer via formatAgentEvent(), so live turn starts, tool calls, results, and errors are appended as they happen.
Commit with the fix: https://github.com/thecannabisapp/kimi-code/commit/003420b9
If the maintainers want to merge this, the key change is in packages/agent-core/src/agent/background/agent-task.ts.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/agent-core/src/agent/background/agent-task.ts and inspect how the background task output buffer is populated. Review formatAgentEvent() and the linked fork commit, then verify that the /tasks view receives live turn starts, tool calls, results, and errors while a subagent is running, not only after completion or failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100