kimi-code/.changeset
liruifengv 108299be3c
refactor!: overhaul thinking config and effort resolution (#1132)
* feat: support multi-level thinking effort switching

- kimi provider: emit thinking.effort in the new wire format; keep reasoning_effort mirrored during the transition
- model catalog: thread support_efforts / default_effort from oauth through to /models
- config schema: add supportEfforts / defaultEffort on model aliases
- TUI: multi-segment thinking control in /model, new /effort command, footer effort display
- switch status uses displayName and distinguishes model vs effort-only changes

* docs: add thinking effort design plans

- thinking-effort-switching.md: implemented multi-level effort switching
- thinking-model-overhaul.md: follow-up refactor plan for the thinking state model

* docs: collapse thinking overhaul plan into a single PR

* refactor!: overhaul thinking config and effort resolution

Replace default_thinking and thinking.mode with a single [thinking] enabled/effort table. ThinkingEffort is now an open string ('off' | 'on' | model-declared effort); effort levels come from each model's support_efforts instead of a fixed enum.

Centralize default and always_thinking clamp logic in resolveThinkingEffort/defaultThinkingEffortFor, and honor an explicitly configured effort when an always_thinking model is forced back on.

TUI keeps a single thinkingEffort field instead of the boolean + level pair; 'on' is normalized to the model default at the UI boundary.

BREAKING CHANGE: default_thinking and thinking.mode are removed from config; migrate to [thinking] enabled/effort.

* refactor: rename residual thinking level wording to effort

Rename comments, error messages, parameter names, the SetThinkingPayload wire field (level -> effort), and TUI local variables so the thinking effort naming is consistent throughout. No behavior change.

* refactor: rename remaining camelCase thinking level identifiers to effort

Rename liveLevel/prevLevel/levelChanged/commitLevel/effectiveLevel to liveEffort/prevEffort/effortChanged/commitEffort/effectiveEffort in the TUI model picker and config commands.

* refactor: eliminate remaining thinking level wording in comments and tests

Rename levelLabel -> effortLabel, EffortSelectorOptions.levels -> efforts, and 'effort level(s)' / 'default level' / 'requested level' wording in comments, error messages, slash-command description, and test titles to effort. Also restore the withThinking(effort) parameter rename in the Kimi provider that was accidentally reverted.

* fix: address codex review feedback on thinking effort handling

- OpenAI thinkingEffortToReasoningEffort and Anthropic clampEffort now normalize 'on' / unrecognized efforts instead of throwing, so boolean non-Kimi models no longer crash on session start.

- ACP resolveCurrentThinkingEnabled treats a non-empty thinking.effort as enabled, matching agent-core's resolveThinkingEffort.

- REST promptThinkingSchema accepts any non-empty effort string so model-declared efforts are not rejected at the API boundary.

* test: align kimi e2e expectations with supportEfforts-gated reasoning_effort

The kimi provider now sends reasoning_effort only when the model declares support_efforts; boolean models (no support_efforts) send only thinking.type. Update the kimi e2e tests to drop the stale reasoning_effort expectation for the boolean test model.

* test: cover [thinking] effort parsing in config.test

Add effort = "high" to the documented [thinking] table in the config parse test and assert config.thinking.effort is resolved, so the new [thinking] effort field has direct parse coverage.

* docs: add thinking test coverage gap analysis

Capture the explore agent's test coverage review for the thinking overhaul PR, including P1/P2 gaps and the two open design questions, for follow-up test additions.

* feat(oauth): parse nested think_efforts from /models response

The /models endpoint now returns effort levels under a nested think_efforts object ({ support, valid_efforts, default_effort }). Parse it preferentially in both managed-kimi-code and open-platform model parsing, falling back to the legacy flat support_efforts / default_effort fields for older servers.

* refactor(oauth): only read nested think_efforts; gate on support=true

Drop the legacy flat support_efforts / default_effort fallback. The think_efforts object is now the single source, and its support flag gates the whole object — when support is not true, valid_efforts and default_effort are ignored entirely.

* chore: remove unused parseStringArray import in open-platform

* docs: finalize thinking effort release notes

Downgrade the changeset to minor with an English summary, drop the version-specific 'added in 1.0.0' info block, and present the deprecated config fields as a table (field / deprecated in 0.21.0 / description).

* refactor: drop temporary refresh toggles and kimi reasoning_effort mirror

Remove the always-true REFRESH_MODELS_ON_PICKER_OPEN / REFRESH_PROVIDER_MODELS_ON_STARTUP toggles and their stale re-enable TODOs, and stop sending reasoning_effort from the kimi provider (thinking.effort is the only wire field now).

* fix(tui): avoid persisting "on" as thinking effort

* fix: preserve persisted thinking effort across login and provider setup

* fix(tui): show actual thinking effort in /status and footer

* test(tui): align message-flow expectations with effort persistence and /status display

* fix(vis): rename thinkingLevel to thinkingEffort in config.update analysis
2026-06-30 22:34:13 +08:00
..
add-gui-store-api.md feat(server): add GUI store API mirroring localStorage (#1231) 2026-06-30 21:04:59 +08:00
config.json feat(server): add fast disk-based snapshot reader (#975) 2026-06-22 19:47:31 +08:00
double-esc-undo.md feat(tui): open undo selector on double-Esc (#1220) 2026-06-30 15:42:27 +08:00
fix-at-mention-slash-arg.md fix(tui): open @ file mentions inside slash command arguments (#1223) 2026-06-30 15:35:19 +08:00
fix-headless-force-exit.md fix(cli): force-exit headless runs so a lingering handle can't wedge kimi -p (#1233) 2026-06-30 22:13:17 +08:00
fix-shell-mode-slash-completion.md fix(tui): enable file path completion for / in shell mode (#1225) 2026-06-30 17:54:24 +08:00
fix-web-duplicate-workspaces.md fix(web): deduplicate workspaces shown in the sidebar (#1221) 2026-06-30 17:25:24 +08:00
plugin-commands.md feat: support plugin slash commands (#1204) 2026-06-30 19:38:01 +08:00
README.md chore(daemon): remove unused daemon package and stale references (#852) 2026-06-17 21:11:36 +08:00
thinking-model-overhaul.md refactor!: overhaul thinking config and effort resolution (#1132) 2026-06-30 22:34:13 +08:00
ttft-client-server-split.md feat(timing): split TTFT into api-server and client portions (#1228) 2026-06-30 19:15:02 +08:00
web-telemetry-toggle.md feat(web): always show the usage-data opt-out toggle in settings (#1232) 2026-06-30 20:49:35 +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
  • kimi-migration-legacy

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