← Back to Pull requests

feat(tui): add experimental ultra swarm mode #597

Closed
unknown closed this pull request without merging on Jun 09, 2026 14:45 UTC
View on GitHub
unknown unknown commented on Jun 09, 2026 12:32 UTC
Author

## Related Issue

No linked issue. This PR adds an experimental Ultra swarm entrypoint and live orchestration view for larger swarm tasks.

Problem

Kimi Code already has /swarm, but larger multi-agent tasks need guarded advisor-style sizing before work starts, bounded coordination windows, explicit context governance, and a clear live view of which swarm workers are active, queued, limited, done, or failed.

What changed

  • Added the experimental ultra_swarm flag, surfaced through /experiments and KIMI_CODE_EXPERIMENTAL_ULTRA_SWARM.

  • Added /ultramode (/ultra) and /swarm ultra entrypoints for persistent and one-shot Ultra swarm runs.

  • Added an Ultra swarm system reminder for Advisor pass, bounded coordination windows, meeting checkpoints, snapshot discipline, context firewalling, and existing AgentSwarm delegation.

  • Added a live Ultra Swarm Map activity pane for Ultra runs, with grouped swarm windows, active/queued/limited/done/failed markers, and green pulsing active workers.

  • Preserved a user's existing persistent /swarm on mode after a one-shot Ultra task exits.

  • Added TUI command, command resolution, completion, marker, activity-pane, core turn, and experimental flag metadata coverage.

  • Added a changeset for the CLI package.
  • 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.
  • Test Plan

  • pnpm --filter @moonshot-ai/kimi-code exec vitest run test/tui/activity-pane.test.ts

  • pnpm --filter @moonshot-ai/kimi-code exec vitest run test/tui/commands/swarm.test.ts

  • pnpm --filter @moonshot-ai/kimi-code exec vitest run test/tui/commands/swarm.test.ts test/tui/kimi-tui-message-flow.test.ts -t "one-shot /ultramode task exits|restores persistent swarm|records persistent swarm restoration|switches an active regular swarm"

  • pnpm --filter @moonshot-ai/kimi-code exec vitest run test/tui/commands/swarm.test.ts test/tui/commands/registry.test.ts test/tui/commands/resolve.test.ts test/tui/kimi-tui-message-flow.test.ts -t "one-shot /swarm task exits|one-shot /ultramode task exits|handleSwarmCommand|built-in slash command registry|resolveSlashCommandInput"

  • pnpm --filter @moonshot-ai/agent-core exec vitest run test/agent/turn.test.ts -t "Ultra swarm"

  • pnpm --filter @moonshot-ai/kimi-code-sdk exec vitest run test/config.test.ts -t "experimental feature metadata"

  • pnpm --filter @moonshot-ai/agent-core run typecheck

  • pnpm --filter @moonshot-ai/kimi-code-sdk run typecheck

  • pnpm --filter @moonshot-ai/kimi-code run typecheck

  • pnpm --filter @moonshot-ai/agent-core run build

  • pnpm --filter @moonshot-ai/kimi-code-sdk run build

  • pnpm --filter @moonshot-ai/kimi-code run build

  • pnpm exec oxlint --type-aware apps/kimi-code/src/tui/components/panes/ultra-swarm-map.ts apps/kimi-code/src/tui/components/messages/agent-swarm-progress.ts apps/kimi-code/src/tui/controllers/subagent-event-handler.ts apps/kimi-code/src/tui/controllers/session-event-handler.ts apps/kimi-code/src/tui/kimi-tui.ts apps/kimi-code/test/tui/activity-pane.test.ts

  • pnpm exec oxlint --type-aware apps/kimi-code/src/tui/commands/swarm.ts apps/kimi-code/src/tui/controllers/session-event-handler.ts apps/kimi-code/src/tui/tui-state.ts apps/kimi-code/src/tui/kimi-tui.ts apps/kimi-code/test/tui/commands/swarm.test.ts apps/kimi-code/test/tui/kimi-tui-message-flow.test.ts
  • Diff: 457 lines (+342 / -115) across 5 files Reviewer: r3wretrhy Review duration: 132m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.46) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.46 · 457 lines diff across 5 files
    0.46
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.367
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #597"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 45.5% (MEDIUM) · Higher = larger blast radius
    45.5%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 18.0% · Safe to merge
    18.0%