Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
61389c6
perf(agent-core): replace dynamic timestamp with static time-lookup r…
Aug 2, 2026
9218660
test(agent-core): add regression coverage for timestamp-free system p…
Aug 2, 2026
01fca14
refactor(agent-core-v2): code all domain failure modes as Error2 (#2552)
sailist Aug 3, 2026
72ba2a6
feat(agent-core-v2): add lifecycle ledger, dynamic registry, and casc…
sailist Aug 3, 2026
4b25b50
docs: clarify secondary model default binding and override precedence…
7Sageer Aug 3, 2026
aff5f84
fix(tui): make the /login already-logged-in notice visible (#2559)
wbxl2000 Aug 3, 2026
715003a
feat(agent-core-v2): add lifecycle hook events and enrich hook payloa…
sailist Aug 3, 2026
17af420
refactor(kap-server): own v1 message history and snapshot assembly (#…
sailist Aug 3, 2026
da4c6ff
feat(config): add deprecation mechanism and rename loop retry limit (…
sailist Aug 3, 2026
247aa05
fix(agent-core): replay v2 profile.bind records so resumed sessions k…
7Sageer Aug 3, 2026
58b4043
feat(agent-core-v2): add AGENTS.md discovery reminder (#2545)
7Sageer Aug 3, 2026
63503e1
feat(agent-core-v2): add tokenCounting service with strategy config a…
sailist Aug 4, 2026
17ac93e
feat(acp): add experimental agent-core-v2 ACP server (kimi acp-v2) (#…
sailist Aug 4, 2026
cf9082d
feat(acp-server): bridge questions via elicitation and support host s…
sailist Aug 4, 2026
d0e6ea8
fix(kap-server): accept question ids containing colons on resolve (#2…
sailist Aug 4, 2026
cf85775
chore(changeset): downgrade token-counting strategy entry to patch (#…
wbxl2000 Aug 4, 2026
8995bdb
ci: release packages (#2469)
github-actions[bot] Aug 4, 2026
f8cdb8f
feat: /fork no longer switches to the forked session (#2565)
7Sageer Aug 4, 2026
27bbb5c
feat(agent-core-v2): advertise model capabilities in the subagent mod…
7Sageer Aug 4, 2026
db17d96
feat(tui): lazy-create the session on first use with the v2 engine (#…
liruifengv Aug 4, 2026
089efb4
docs: polish the 0.32.0 changelog and fill 0.32.0 doc gaps (#2594)
wbxl2000 Aug 4, 2026
54df3bd
docs(changelog): shorten the 0.32.0 loop_control and token_counting e…
wbxl2000 Aug 4, 2026
3d53927
fix(agent-core-v2): make MCP initial connect non-blocking during star…
7Sageer Aug 4, 2026
f83df2a
docs(changelog): fix 0.32.0 entry formatting and doc links (#2598)
wbxl2000 Aug 4, 2026
26a5441
feat(cli): add built-in Computer Use and WebBridge capabilities (#2407)
wbxl2000 Aug 4, 2026
fabfd9a
fix(mcp): pass structuredContent and _meta through to model-visible t…
xpzouying Aug 4, 2026
c1d946f
feat(agent-core-v2): announce date changes via a system reminder (#2564)
7Sageer Aug 4, 2026
2fe2660
feat(mcp): carry an absolute expiresAt on the OAuth authorization-url…
xpzouying Aug 4, 2026
11a2cb9
fix(agent-core-v2): port the MCP auth:'oauth' opt-in from v1 (#2608)
xpzouying Aug 4, 2026
306c93c
fix(mcp): drop protocol-reserved _meta keys from model-visible output…
xpzouying Aug 4, 2026
0a5c89a
feat(minidb): persistent index generations and lifecycle hardening (#…
sailist Aug 4, 2026
9816807
feat(agent-core-v2): add custom agent identity (#2573)
RealKai42 Aug 4, 2026
824ffdb
feat(tui): add /bug as an alias for /feedback (#2614)
RealKai42 Aug 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
28 changes: 24 additions & 4 deletions .agents/skills/agent-core-dev/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,18 @@ registerSection('providers', ProvidersSectionSchema, {
```

Each field is an `EnvBinding` — a string (env var name) or
`{ env, parse?, default? }`. IConfig resolves every field by
`{ env, deprecatedEnv?, parse?, default? }`. IConfig resolves every field by
`env > config.toml > default`, sets it on the effective value, and validates the
section. Empty nested entries (no field resolved) are omitted, so a synthetic
entry like `__kimi_env__` only appears when at least one of its env vars is set.
When `deprecatedEnv` is set and `env` itself is absent or fails `parse`, the
deprecated var still supplies the value and a warning diagnostic is reported —
use it to rename an env var without breaking existing setups.

`stripEnv(value, raw?, getEnv?)` removes env-derived fields before `set`/`replace`
persists, so env overrides never leak into `config.toml`. `raw` is the section's
env-free camelCase base (already `fromToml`-normalized, so legacy key renames
are honored), and `getEnv` reads the live env bag. For fields that are **both
env-free camelCase base (already `fromToml`-normalized), and `getEnv` reads the
live env bag. For fields that are **both
user-persistable and env-overridable**, register
`stripEnv: stripEnvBoundFields(sectionEnvBindings)` (from `#/app/config/config`)
— it derives the guard from the same bindings the read path uses: while a
Expand Down Expand Up @@ -231,7 +234,7 @@ This means registration order is never a correctness concern — you do not need

`config.toml` stores keys in **snake_case**; in-memory values are **camelCase**. `ConfigService` converts both ways by dispatching to each section's registered transform:

- **Read**: `transformTomlData(fileData, registry)` maps each top-level key to a domain and applies that domain's `fromToml` hook (or a plain key-casing pass when none is registered). Owner domains register their own normalization — e.g. provider `oauth`/`env`/`customHeaders`, permission `deny/allow/ask` → `rules`, `loop_control.max_steps_per_run` → `maxStepsPerTurn`, `experimental` keys preserved verbatim. When a section registers after the initial load, `ConfigService` re-applies its `fromToml` against the preserved snake_case raw value (see "Late registration"), so registration order is never a correctness concern.
- **Read**: `transformTomlData(fileData, registry)` maps each top-level key to a domain and applies that domain's `fromToml` hook (or a plain key-casing pass when none is registered). Owner domains register their own normalization — e.g. provider `oauth`/`env`/`customHeaders`, permission `deny/allow/ask` → `rules`, `experimental` keys preserved verbatim. When a section registers after the initial load, `ConfigService` re-applies its `fromToml` against the preserved snake_case raw value (see "Late registration"), so registration order is never a correctness concern.
- **Write**: `applySectionToToml(rawSnake, domain, value, registry)` applies the domain's `toToml` hook (or a plain camelCase→snake_case mapping) into a raw clone of the file, preserving unknown top-level keys and unknown sub-fields (lossless round-trip).

`ConfigService` keeps four views:
Expand All @@ -241,6 +244,23 @@ This means registration order is never a correctness concern — you do not need
- `validated` — validated `raw`, env-free; the base every live env re-application starts from, so a degraded or removed env value falls back to the file instead of a stale overlay.
- `effective` — `validated` plus the env overlay, recomputed on load/set; `get()`/`getAll()` re-apply the overlay on a fresh `validated` copy per read rather than caching it.

### Renaming config keys and env vars (deprecations)

Renames are declared once on the section, never hand-rolled in `fromToml`:

```ts
registerSection(MY_SECTION, MySectionSchema, {
deprecations: [{ key: 'old_key', replacement: 'new_key' }], // snake_case, on-disk
env: envBindings(MySectionSchema, {
newKey: { env: 'KIMI_NEW_KEY', deprecatedEnv: 'KIMI_OLD_KEY', parse },
}),
});
```

- A deprecated TOML key is **ignored** (its value no longer applies — the schema only knows the new key) and reports a warning `ConfigDiagnostic` while present; the file is never rewritten, so the warning is the migration guide. Diagnostics are recomputed on every load/reload and surface to clients via `IConfigService.diagnostics()` and `onDidChangeDiagnostics` (kap-server republishes them as the global `event.config.warning` WS event).
- A deprecated env var still **resolves** as a fallback (new var first), with the same warning treatment, and `stripEnvBoundFields` treats it as env-owned for writes.
- See `src/agent/loop/configSection.ts` for a worked example (`max_retries_per_step` → `max_attempts_per_step`).

### `KIMI_MODEL_*` env overlay

When `KIMI_MODEL_NAME` is set, the `kosongConfig` wrapper's `kimiModelEnvOverlay` (`src/app/kosongConfig/envOverlay.ts`) injects a reserved model alias (`__kimi_env_model__`) into `effective`, points `defaultModel` at it, and merges the request `modelOverrides`; the reserved provider (`__kimi_env__`) comes from the `providers` section env bindings. The overlay is registered via `IConfigRegistry.registerEffectiveOverlay` and applied **only to `effective`**, never to `rawSnake`, so it is never persisted. Its `strip` (plus the providers section `stripEnv`) is the final guard so a caller that read `effective` (with the overlay) cannot write the reserved entries or the shell API key back to disk. `config` itself only runs registered overlays — it does not know the `KIMI_MODEL_*` semantics.
Expand Down
6 changes: 3 additions & 3 deletions .agents/skills/agent-core-dev/edge-exposure.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ Read = `GET`, write = `POST`. `sid` = `session_id`, `aid` = `agent_id`.

| resource | action | Service.method | verb |
|---|---|---|---|
| `sessions` | `list` | ISessionIndex.list | GET |
| `sessions` | `listRecent` | ISessionIndex.listRecent | GET |
| `sessions` | `get` | ISessionIndex.get | GET |
| `sessions` | `countActive` | ISessionIndex.countActive | GET |
| `sessions` | `count` | ISessionIndex.count | GET |
| `workspaces` | `list` | IWorkspaceService.list | GET |
| `workspaces` | `get` | IWorkspaceService.get | GET |
| `workspaces` | `createOrTouch` | IWorkspaceService.createOrTouch | POST |
Expand Down Expand Up @@ -105,7 +105,7 @@ Read = `GET`, write = `POST`. `sid` = `session_id`, `aid` = `agent_id`.
| `tasks` | `list` / `get` / `readOutput` | IBackgroundService.* | GET |
| `tasks` | `stop` / `detach` | IBackgroundService.* | POST |
| `usage` | `status` | IUsageService.status | GET |
| `context` | `status` | IAgentContextSizeService.get | GET |
| `context` | `status` | IAgentTokenCountingService.get | GET |
| `swarm` | `isActive` | ISwarmService.isActive | GET |
| `swarm` | `enter` / `exit` | ISwarmService.* | POST |
| `permission` | `getMode` | IPermissionModeService.mode | GET |
Expand Down
4 changes: 3 additions & 1 deletion .agents/skills/pre-changelog/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ If the CLI changelog is not in the diff (for example an SDK-only release), stop

Process the version block exactly as `sync-changelog` does for the docs site, but only in memory:

- **Strip** (`sync-changelog` step 3): drop the H1, the `### Patch Changes` / `### Minor Changes` / `### Major Changes` subheadings, PR links, and commit-hash links; keep only each entry's body text. The `Thanks [@user](...)!` credit (including the multi-author form) must be removed every time. Within each entry, drop SDK-only and provider-internal sentences (SDK capability mapping / API exposure, provider wire-format mechanics, internal XML markers) and keep only the user-facing effect and required constraints.
- **Strip** (`sync-changelog` step 3): drop the H1, the `### Patch Changes` / `### Minor Changes` / `### Major Changes` subheadings, PR links, and commit-hash links; keep only each entry's body text. The `Thanks [@user](...)!` credit (including the multi-author form) must be removed every time. Within each entry, drop SDK-only and provider-internal sentences (SDK capability mapping / API exposure, provider wire-format mechanics, internal XML markers, hook/event payload mechanics such as what an event reports or carries) and keep only the user-facing effect and required constraints.
- **Merge and deduplicate** (`sync-changelog` step 4): merge micro-tweaks to the same surface into one higher-level entry; when three or more fixes target the same UI area or the same class of problem, merge them into one higher-level fix entry (do not merge broad or genuinely distinct fixes); and drop a server/API entry that only backs a web feature already listed.
- **Classify** (`sync-changelog` step 4): bucket into Features / Bug Fixes / Polish / Refactors / Other; order within each section by reader value (in Polish, user-visible improvements before protocol/internal adjustments).
- **Translate** (`sync-changelog` step 6): translate entry bodies to Chinese; keep one sentence per entry with a parallel rhythm within a section; section headings become 新功能 / 修复 / 优化 / 重构 / 其他.
Expand All @@ -48,6 +48,8 @@ If an upstream entry is not in English, flag it and stop (changeset entries must

Print the preview directly. Use `<version>(预览)` as the heading because the version is not released yet. Write `无` for empty sections. Do not write any file.

The preview is pasted into chat tools (for example Lark), where relative docs links do not resolve. Rewrite every docs link to its absolute published URL: map `../<path>.md[#anchor]` to `https://moonshotai.github.io/kimi-code/zh/<path>.html[#anchor]` — for example `../configuration/config-files.md#loop-control` → `https://moonshotai.github.io/kimi-code/zh/configuration/config-files.html#loop-control`. Never emit raw relative paths, and never wrap a link in backticks; code-style the link text inside the brackets instead ([`loop_control`](...)).

```
发版 PR: <url>

Expand Down
6 changes: 6 additions & 0 deletions .agents/skills/sync-changelog/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ Drop SDK-only and provider-internal detail. This changelog serves `@moonshot-ai/

- Drop sentences about how the SDK maps a capability, builds model aliases, or exposes a flag through an API such as `getExperimentalFeatures()` — that belongs in the SDK changelog, not here.
- Drop provider / wire-format implementation mechanics (XML markers like `<tools_added>`, protocol field explanations, "the wire protocol is unchanged", cache-hit mechanics) unless they are the behavior a user perceives.
- Drop hook/event payload mechanics — clauses about what extra fields an event payload carries or what an event reports in a specific case (for example "enrich hook payloads with the session title and client type", "`SessionEnd` reports `archive` when a session is archived"). Keep the new events or capability itself and how to configure it.
- Keep the user-facing effect and any constraints users must follow (for example "question texts must be unique").

Do not change facts or drop a real user-facing behavior — only trim the internal-only scaffolding. For over-long, internal-heavy entries, this trim applies on the English page too, not only in translation.
Expand Down Expand Up @@ -229,6 +230,8 @@ Example:
- Update the native release workflow to use current GitHub artifact actions.
```

Doc links: an entry that changes a documented config surface may end with a pointer to the docs page — `see [X](...) for details` (Chinese: `详见 [X](...)。`). Keep it a real Markdown link into the docs tree with a relative path (for example `../configuration/config-files.md#loop-control`). When the link text is a config key or another identifier, code-style the text inside the brackets: [`loop_control`](../configuration/config-files.md#loop-control). Never wrap the whole link in backticks — `` `[loop_control](...)` `` renders as raw inline code that exposes the relative path instead of a clickable link.

### 6. Translate The Increment Into Chinese

After updating the English page, translate only the newly added English content into `docs/zh/release-notes/changelog.md`.
Expand Down Expand Up @@ -322,6 +325,7 @@ Check:
- PR links and commit hashes were stripped.
- No `Thanks ...!` credit remains (remove it every time).
- Real internal identifiers were replaced with neutral placeholders.
- Doc links are real Markdown links (code-styled text inside the brackets when needed), never wrapped in backticks.
- There are no empty sections.
- Markdown indentation and blank lines are intact.

Expand Down Expand Up @@ -454,6 +458,8 @@ Return the PR URL to the user when done.
| Leaving empty sections | Delete sections with no entries |
| Putting everything under Other for convenience | Classify what can be classified first |
| Translating tool names, command names, or config keys | Keep them as written |
| Wrapping a whole doc link in backticks | Code-style the link text inside the brackets instead, so the link stays clickable: [`loop_control`](...) |
| Keeping hook/event payload-mechanics clauses | Drop what an event reports or carries; keep the new capability and how to configure it |
| Creating a changeset for docs sync | Do not create one |
| Committing or pushing directly on `main` | Create `docs/changelog-sync-<version>`, commit there, then open a PR |
| Committing or opening a PR before the user skips review or confirms review is done | Wait at the human review checkpoint |
Expand Down
5 changes: 5 additions & 0 deletions .changeset/built-in-capabilities.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": minor
---

Add Kimi Computer Use and Kimi WebBridge as built-in official marketplace entries in the v2 CLI. Installing from `/plugins` sets up the latest managed runtime and plugin together, reports incomplete manual steps, and supports retrying interrupted setup.
5 changes: 0 additions & 5 deletions .changeset/catalog-builtin-fallback.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/custom-agent-identity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": minor
---

Add a custom agent identity, plus a switch for the built-in skills that document Kimi Code itself. Set `[identity] name` in `config.toml` (or `KIMI_CODE_IDENTITY_NAME`) to change the name the agent uses for itself and the identifier it presents to third-party providers and MCP servers; set `builtin_product_skills = false` to drop the product-documentation skills.
5 changes: 5 additions & 0 deletions .changeset/feedback-bug-alias.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Add /bug as an alias for the /feedback slash command. Type /bug to submit feedback.
5 changes: 0 additions & 5 deletions .changeset/fix-dark-mono-composer.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/fork-stay-current-session.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": minor
---

`/fork` no longer switches to the forked session: the current session stays active and its background tasks keep running. Find the fork in `/sessions`.
5 changes: 0 additions & 5 deletions .changeset/kap-server-meta-experimental-flags.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/mcp-first-turn-ready.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Ensure the first request waits for MCP startup to finish while the interface still opens immediately.
5 changes: 5 additions & 0 deletions .changeset/mcp-structured-result-passthrough.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@moonshot-ai/kimi-code': patch
---

MCP tool results now surface the spec-defined `structuredContent` field and `_meta` server metadata to the model as a serialized `<mcp-structured-result>` block, instead of silently dropping them. Servers that return their machine-readable contract in these fields work the same as on other MCP hosts.
5 changes: 5 additions & 0 deletions .changeset/perf-system-prompt-cache.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Replace the per-session timestamp in the default system prompt with a static time-lookup reminder. The timestamp changed on every new session, breaking DeepSeek's byte-prefix cache from that point onward — including the ~16.8k-token tools definition — so every new session's first LLM call missed the cache. First-turn cache-miss input drops from ~19.5k tokens to ~88 tokens (99.6% cache hit measured on the built artifact). The static `## Date and Time` section keeps the instruction to fetch the real current time from the environment (e.g. via the `date` command) when it matters, without the cache-breaking value.
20 changes: 20 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,26 @@
"eslint/no-console": "off"
}
},
{
// The stage-6 worker closure: these modules (and everything
// packages/minidb/src/worker/ pulls in) are loaded by a bare
// node:worker_threads Worker under Node's native type stripping with
// `execArgv: ['--experimental-transform-types']`, which requires
// explicit `.ts` import specifiers (the strip loader does not remap
// `.js` -> `.ts`). Keep the exception scoped to exactly that closure.
"files": [
"packages/minidb/src/worker/**/*.ts",
"packages/minidb/src/codec.ts",
"packages/minidb/src/crc32.ts",
"packages/minidb/src/trigram.ts",
"packages/minidb/src/text-postings.ts",
"packages/minidb/src/text-index/tokenize.ts",
"packages/minidb/src/gen-codec.ts"
],
"rules": {
"import/extensions": "off"
}
},
{
"files": ["packages/kosong/src/providers/**/*.ts"],
"rules": {
Expand Down
Loading