feat: agent swarm#424
Conversation
🦋 Changeset detectedLatest commit: 1dc2a84 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
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 |
…ess-ui # Conflicts: # apps/kimi-code/src/tui/controllers/session-event-handler.ts # apps/kimi-code/test/cli/options.test.ts # docs/en/reference/slash-commands.md # docs/zh/reference/slash-commands.md
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dc029d586d
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b9dc203cae
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0d50b541a4
ℹ️ 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".
| if (host.state.appState.permissionMode === 'manual') { | ||
| if (!(await activateSwarmForTask(host))) return; | ||
| showSwarmStartPermissionPrompt(host, prompt); |
There was a problem hiding this comment.
Defer swarm activation until the user confirms
In Manual mode, /swarm <prompt> enables task-triggered swarm mode before showing the permission prompt. If the user presses Esc (or the later Auto permission update fails), no prompt turn is sent, so the task-triggered mode never reaches the turn-end auto-exit path and the next normal user prompt unexpectedly runs in swarm mode. Consider moving activation until after a start choice is confirmed, or rolling it back on cancel/failure.
Useful? React with 👍 / 👎.
| const body = result.status === 'completed' ? (result.result ?? '') : (result.error ?? 'unknown error'); | ||
| lines.push( | ||
| `<subagent${mode}${agentId}${item}${state} outcome="${result.status}">${body}</subagent>`, |
There was a problem hiding this comment.
Escape subagent result bodies before wrapping them
Subagent summaries/errors are arbitrary model text, but this wraps them directly inside <subagent>...</subagent>. When a subagent reports code or XML containing </subagent>, the new TUI parser stops at that first closing tag and truncates/misattributes the rest of the swarm result, which can hide failures or resume IDs from the parent/TUI. Escape the body (or use a non-ambiguous encoding) just like attributes are escaped.
Useful? React with 👍 / 👎.
Related Issue
No linked issue. Problem explained below.
Problem
AgentSwarm work can launch many subagents at once, but the TUI did not have a dedicated command flow or live progress surface for tracking which agents are queued, running, suspended, completed, or failed.
What changed
/swarm <task>and akimi swarm-demopreview command for the TUI progress UI.Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.