kimi-code/.changeset
qer c5e3e80041
feat(web): render AgentSwarm as an inline tool card (#1425)
* feat(web): render AgentSwarm as an inline tool card

Replace the bottom SwarmCard footer and the messagesToTurns live-skip
with one dedicated inline tool card for AgentSwarm. The card shows a
phase overview plus a per-subagent accordion: live progress while it
runs, parsed aggregated result once it completes (and after a refresh
that has already dropped the live tasks).

Refresh and resync keep member identity metadata (swarmIndex,
parentToolCallId, subagentType, runInBackground) stable across skeleton
task replacement in the reducer, and the .content-wrap flex layout is
hardened against the overflow compression that previously displaced the
footer.

* fix(web): handle swarm review feedback

- SwarmTool: when AgentSwarm fails before producing a structured
  agent_swarm_result (e.g. argument validation), render the raw tool
  output instead of the "waiting for subagents" placeholder so the
  failure cause is visible.
- resolveSwarmMembers: source live members from the AppTask store keyed
  by parentToolCallId rather than buildSwarmGroups, which filters out
  single-member groups. A resume-only AgentSwarm now streams its live
  progress before the final result arrives. The badge counter still
  relies on buildSwarmGroups's filter.

* fix(web): carry streamed subagent text into swarm rows

Swarm subagents that stream normal assistant output accumulate it on
AppTask.text (text-kind taskProgress), not outputLines. The new live
member map was dropping `text`, so a still-composing subagent rendered
an empty / stale row until the structured result arrived.

- Add `text` to SwarmMember and thread it through buildSwarmGroups and
  swarmMembersByToolCall.
- SwarmTool: prefer member.text for both the row activity preview and
  the expanded body; fall back to outputLines / summary.
- Tests cover text propagation through both helpers.

* fix(web): merge swarm result rows and fall back to raw output

Address the two latest swarm review comments:

- Rows: when a parsed agent_swarm_result coexists with live AppTasks
  (which the detail panel also depends on), the inline card previously
  only rendered the live members. Interrupted swarms can carry
  state="not_started" / outcome="aborted" result entries for items that
  never spawned a task; those rows were dropped until a refresh cleared
  the live tasks. Extract the row model into buildSwarmCardRows and
  merge result-only aborted/not-started rows with the live member rows.
- Fallback: when the tool is no longer running but produced no
  structured result (argument validation, parser miss, or legacy
  legacy transcript), render the raw tool output instead of
  "Waiting for subagents…" so the final text / failure cause is
  visible to the user.

* fix(web): parse swarm result subagent bodies defensively

Producer writes subagent body unescaped, so a subagent that analyzes or
emits an AgentSwarm snippet can include a literal "</subagent>" inside
its body. The non-greedy regex treated that as the row close and truncated
the body in the result-only path (post-refresh where the AppTask store is
gone).

Rewrite the parser to scan opening tags, then resolve each row's body as
everything up to the last "</subagent>" before the next row's opening tag
(or document end), preserving embedded close-tag strings. Add tests for a
literal "</subagent>" within a single body and across sibling rows.

* fix(web): only count top-level subagent result tags

A subagent body that contains a literal `<subagent ...>` tag — for
example emitting an AgentSwarm/XML snippet — was being pre-collected as
another result row, splitting the real body and producing duplicate /
bogus subagents after refresh where the AppTask store is gone.

Rewrite parseSubagents with a depth-tracking tokenizer: scan every
`<subagent ...>` / `</subagent>` token in order, push a real row frame
only at the outermost level, and treat openings / closings while nested
inside another body as body text. Drop the now-inaccurate "literal
</subagent> without matching open" regression tests; replace with tests
that verify a balanced nested snippet stays inside the parent body and
does not register as a separate row.
2026-07-06 22:05:05 +08:00
..
ask-user-question-label-answers.md feat(agent-core): feed AskUserQuestion answers back as question text and option labels (#1414) 2026-07-06 16:37:54 +08:00
cli-multi-root-mention.md fix(tui): complete @ file mentions across additional workspace roots with fd (#1408) 2026-07-06 15:02:02 +08:00
compaction-summary-toggle.md feat(tui): show compaction summary with Ctrl-O (#1346) 2026-07-06 13:32:37 +08:00
config.json chore(changelog): enable thanks credit in changelog (#1418) 2026-07-06 15:26:03 +08:00
default-preserved-thinking.md feat(thinking): enable Preserved Thinking by default for kimi models (#1417) 2026-07-06 15:27:08 +08:00
fix-bash-tool-card-collapse.md fix(tui): stabilize Bash card height and distinguish command from output (#1419) 2026-07-06 16:50:07 +08:00
fix-edit-preview-context.md fix(tui): include surrounding context in edit approval preview (#1410) 2026-07-06 13:50:23 +08:00
fix-edit-preview-height.md fix(tui): keep Edit preview height stable as results land (#1421) 2026-07-06 16:57:52 +08:00
fix-gemini-tool-calling.md fix(gemini): fix Gemini tool calling and thought-signature round-trip (#1389) 2026-07-05 14:00:09 +08:00
fix-session-search-shortcut.md fix: show Windows session search shortcut (#1393) 2026-07-06 12:08:08 +08:00
fix-sidebar-collapse-single-root.md fix(web): keep Sidebar single-root so collapse hides it (#1406) 2026-07-06 12:39:58 +08:00
fix-slash-menu-input-shift.md fix(tui): keep input anchored after slash command menu closes (#1413) 2026-07-06 15:18:27 +08:00
fix-web-font-size-setting.md fix: honor web font size setting (#1394) 2026-07-06 17:29:23 +08:00
fix-web-remove-bubble-anim.md fix(web): stop replaying the bubble entrance animation on session open (#1411) 2026-07-06 13:58:44 +08:00
fix-web-reopen-reconcile.md fix(web): reconcile session from snapshot on reopen (#1409) 2026-07-06 21:30:25 +08:00
pi-tui-multi-root-fd.md fix(tui): complete @ file mentions across additional workspace roots with fd (#1408) 2026-07-06 15:02:02 +08:00
README.md chore: remove unused kimi-migration-legacy package (#1415) 2026-07-06 15:09:27 +08:00
rebuild-session-index-on-boot.md fix(session): rebuild index on boot to find missing sessions (#1390) 2026-07-05 14:06:33 +08:00
refill-composer-attachments.md fix(web): refill attachments when editing a queued or undone message (#1357) 2026-07-04 23:32:32 +08:00
restore-archived-sessions.md feat(server): support restoring and listing archived sessions (#1073) 2026-07-06 20:09:45 +08:00
select-tools-progressive-disclosure.md feat(agent-core): progressive tool disclosure via select_tools (#1369) 2026-07-06 15:51:08 +08:00
web-archived-sessions-settings.md feat(server): support restoring and listing archived sessions (#1073) 2026-07-06 20:09:45 +08:00
web-ask-user-question-result.md feat(web): render AskUserQuestion result as an option list (#1391) 2026-07-06 02:36:31 +08:00
web-caret-todo-fixes.md fix(kimi-web): fix input caret and todo strikethrough (#1423) 2026-07-06 18:34:06 +08:00
web-composer-toolbar-responsive.md fix(kimi-web): keep composer toolbar usable on narrow windows (#1436) 2026-07-06 21:54:38 +08:00
web-markdown-diff-block.md feat(web): render AskUserQuestion result as an option list (#1391) 2026-07-06 02:36:31 +08:00
web-notification-title-icon.md fix(kimi-web): clarify desktop notification title and icon (#1434) 2026-07-06 21:18:45 +08:00
web-pre-session-skills.md feat(skills): list workspace skills without a session (#1392) 2026-07-05 18:05:15 +08:00
web-swarm-inline-tool-card.md feat(web): render AgentSwarm as an inline tool card (#1425) 2026-07-06 22:05:05 +08:00
web-tool-row-body-padding.md feat(web): render AskUserQuestion result as an option list (#1391) 2026-07-06 02:36:31 +08:00

Changesets

This repository uses changesets to manage npm package versions and releases.

Package Publishing Strategy

This repository uses an independent, manually-selected publishing strategy. When generating a changeset, only select the publishable packages that this change actually affects. The repository's .changeset/config.json already filters out internal workspace packages via ignore, so only the publishable packages listed below should appear in the pnpm changeset prompt.

Current publishable packages:

Package Directory Description
@moonshot-ai/kimi-code apps/kimi-code CLI / TUI application — provides the kimi command after install
@moonshot-ai/kimi-code-sdk packages/node-sdk Public TypeScript SDK

All other workspace packages are private internal packages, are not published to npm, and are excluded via ignore in .changeset/config.json:

  • @moonshot-ai/acp-adapter
  • @moonshot-ai/agent-core
  • @moonshot-ai/kaos
  • @moonshot-ai/kimi-code-oauth
  • @moonshot-ai/kimi-telemetry
  • @moonshot-ai/kimi-web
  • @moonshot-ai/kosong
  • @moonshot-ai/migration-legacy
  • @moonshot-ai/protocol
  • @moonshot-ai/server
  • @moonshot-ai/server-e2e
  • @moonshot-ai/vis
  • @moonshot-ai/vis-server
  • @moonshot-ai/vis-web

Version impact from internal dependencies must be judged manually. The published artifacts for CLI and SDK bundle internal workspace packages into the artifact itself; runtime dependencies of published packages must not include any @moonshot-ai/* internal workspace packages.

The repository's .changeset/config.json sets updateInternalDependencies: "patch". Because internal packages are not published, you still need to manually select all affected publishable packages in the changeset — do not rely solely on automatic dependency bumps to express user-visible changes.

Example scenarios:

Change Changeset selection
Only modifies TUI behavior in @moonshot-ai/kimi-code Add patch / minor / major to @moonshot-ai/kimi-code
Only modifies internal packages, no user-visible change in SDK / CLI Usually no changeset needed
Internal package fix changes the CLI user experience Add a changeset to @moonshot-ai/kimi-code describing the user-visible fix
Internal package adds a new capability exposed by the SDK Add a changeset to @moonshot-ai/kimi-code-sdk
SDK behavior change affects CLI user experience Add changesets to both @moonshot-ai/kimi-code-sdk and @moonshot-ai/kimi-code
Provider abstraction change affects SDK / CLI Add changesets to the affected @moonshot-ai/kimi-code-sdk and/or @moonshot-ai/kimi-code
Test-only, internal refactor, docs, or private debug tooling changes Usually no changeset needed
Bundled official plugin change under plugins/ (e.g. kimi-datasource) No changeset — the plugin is versioned via its own kimi.plugin.json / plugins/marketplace.json and shipped through the marketplace CDN, not the npm package

Prerequisite: NPM Trusted Publishing (OIDC)

This repository uses npm's Trusted Publishing (OIDC-based) for publishing — no NPM_TOKEN is required.

Configuration steps

  1. Open each publishable package's page on the npm website, e.g. https://www.npmjs.com/package/@moonshot-ai/kimi-code.
  2. Go to Settings -> Publishing access.
  3. Find Automate publishing with GitHub Actions or Add trusted publisher.
  4. Click Add a new trusted publisher.

Fill in the following:

Field Value
GitHub Organization MoonshotAI
GitHub Repository kimi-code
GitHub Workflow release.yml
Environment leave empty

Each publishable package needs its Trusted Publisher configured once. The current GitHub Actions workflow lives at .github/workflows/release.yml and already has id-token: write configured.

Development Workflow

1. Implement the feature or fix

Complete code, tests, and documentation changes as usual. A changeset is required when the change affects user-visible behavior, public API, dependency ranges, or release artifacts of a publishable package.

2. Generate a changeset

From the repository root:

pnpm changeset

Follow the prompts to choose:

  • Which publishable packages this change affects;
  • The version bump level:
    • patch: bug fixes, small changes, follow-up dependency updates;
    • minor: backward-compatible new features;
    • major: breaking changes;
  • A user-facing description of the change.

The command creates a .changeset/*.md file that must be committed alongside the code.

3. Commit the changeset

git add .changeset/
git commit -m "chore: add changeset for package release"
git push

Commit messages must follow Conventional Commit style. Do not include any author/agent identity in the commit message.

4. CI generates the release PR

Once the changeset file is merged into main, .github/workflows/release.yml uses changesets/action@v1 to create or update a release PR.

The release PR runs:

  • pnpm changeset version: bumps publishable package versions and updates changelogs;
  • Deletes the consumed .changeset/*.md files;
  • Uses the title [CI]: Release packages.

5. Merge the release PR

Once the release PR is merged into main, the same workflow runs:

  • pnpm install --frozen-lockfile
  • pnpm build
  • pnpm changeset publish

The packages are then published via npm Trusted Publishing, and a GitHub Release is created.

Only publish manually when CI is unavailable. Before publishing manually, make sure you are logged into npm locally and using the Node.js and pnpm versions required by the repository.

pnpm run version
pnpm run publish

The underlying changesets commands are:

pnpm changeset version
pnpm changeset publish

The root-level pnpm run publish first runs typecheck, lint, sherif, test, build, and package lint, then runs changeset publish.

Notes

  • Every PR that affects publishable-package behavior or public API should include a corresponding changeset.
  • Changes under plugins/ (the bundled official plugins such as kimi-datasource) do not need a changeset: each plugin carries its own version in kimi.plugin.json and plugins/marketplace.json and is distributed via the marketplace CDN, separately from the @moonshot-ai/kimi-code npm package.
  • Changeset files must be committed to the repository — release PRs are only triggered after they're merged.
  • Release PRs require human review and merge; they will not publish automatically.
  • Do not add release changesets for private internal packages; only select @moonshot-ai/kimi-code and @moonshot-ai/kimi-code-sdk.
  • If a change in an underlying internal package alters user-visible behavior or public API of a publishable package, add a changeset to the affected publishable package. For example, when a bug fixed in @moonshot-ai/agent-core resolves an issue CLI users encounter, add a changeset to @moonshot-ai/kimi-code describing the user-visible fix.
  • @moonshot-ai/kimi-code is the official CLI package name; after a global install it provides the kimi command.
  • Make sure each publishable package on npm has a Trusted Publisher configured.

References