Commit graph

349 commits

Author SHA1 Message Date
Kai
efdf8a1b2d
feat(vis): faithful wire.jsonl rendering + built-in kimi vis command (#788)
Some checks are pending
CI / build (push) Waiting to run
CI / test (push) Waiting to run
CI / lint (push) Waiting to run
CI / typecheck (push) Waiting to run
Nix Build / Check flake.nix workspace sync (push) Waiting to run
Nix Build / nix build .#kimi-code (push) Blocked by required conditions
Release / Publish native release assets (push) Blocked by required conditions
Release / Deploy docs (push) Blocked by required conditions
Release / Native release artifact (push) Blocked by required conditions
Release / Release (push) Waiting to run
* feat: polish vis

* feat: add 'kimi vis' command for session visualization

* fix(vis): drop metadata app_version/resumed removed upstream

#786 stopped recording resume version metadata, so those fields no
longer exist on the metadata wire record. The vis-into-typecheck wiring
caught the stale field reads after merging main; drop them from the
metadata headline.

* fix(vis): drop unnecessary return-await in startVisServer

oxlint typescript-eslint(return-await) flags returning an awaited
promise outside try/catch; return the promise directly.

* fix(vis): green CI — tolerate unbuilt embedded asset + bump nix pnpmDeps hash

- handleVis: wrap the embedded-SPA dynamic import in try/catch. The value
  module is generated at build time (prebuild); in contexts without a build
  (tests run pnpm test, not build) only the .d.ts type stub exists, so the
  runtime import throws. Tolerate it and fall back to filesystem serving.
- flake.nix: update the fetchPnpmDeps hash after adding the vis-web /
  vis-server / vite-plugin-singlefile dependencies.

* refactor(vis): drop redundant alwaysBundle in tsdown config

#775's single-entry build (codeSplitting: false) already bundles
everything not declared in dependencies/peerDependencies. hono /
@hono/node-server (transitive via vis-server) and @moonshot-ai/vis-server
(a devDependency) are all undeclared there, so they bundle by default —
the explicit alwaysBundle was redundant. Verified the emitted main.mjs is
still fully self-contained and 'kimi vis' serves.

* fix(vis): address review — context-token resets, IPv6 url, marker-safe indexing

- contextTokens now mirrors agent-core on lifecycle records: 0 on
  context.clear, tokensAfter on context.apply_compaction (was only
  updated from step.end.usage, leaving a stale live fill after a
  clear/compaction).
- start.ts brackets IPv6 hosts in the returned url (http://[::1]:port/);
  hostForUrl moved to config.ts and shared with the startup banner.
- compaction slice + micro-compaction blanking now index over real
  history entries only, so synthetic undo/clear UI markers no longer
  offset agent-core's compactedCount / cutoff.

* chore: add changeset for kimi vis command

* fix(vis): cross-platform single-file build + history-count micro clamp

- build-vis-asset.mjs sets VIS_SINGLEFILE via the spawn env and runs
  'vite build' directly (cross-platform), instead of the POSIX-inline-env
  'build:single' script that broke on Windows cmd; removed the now-unused
  build:single script. Fixes the win32 build path (the asset generator
  runs in the kimi-code prebuild + native bundle).
- context.undo now clamps the micro-compaction cutoff by history-entry
  count (excluding synthetic undo/clear markers) instead of messages.length,
  mirroring agent-core undo() -> microCompaction.reset(_history.length); a
  surviving marker no longer leaves the cutoff one too high and wrongly
  blanks a later-appended tool result.

* fix(vis): run the single-file build through a shell for Windows pnpm

The win32 native binary is built on Windows runners
(.github/workflows/_native-build.yml), which run this generator. pnpm's
launcher there is pnpm.cmd, which a bare argv exec can't resolve without
a shell. Use execSync with a single command string so the platform shell
(cmd on Windows) resolves the shim; a command string (not an args array)
avoids the args+shell deprecation. Args are static.

* fix(vis): show model-facing tool result content in the context view

agent-core normalizes tool results via toolResultOutputForModel before
they enter history (error -> '<system>ERROR: ...' prefix, empty ->
'<system>Tool output is empty.' sentinel). The projector was using the
raw ev.result.output, so the Context tab's model view showed content the
model never saw for failed/empty tool calls. Replicate that normalization
(the upstream helper is module-private) so the projected tool message
matches what the model received.
2026-06-16 16:54:14 +08:00
_Kerman
7b5b818815
fix: continue compaction while context remains blocked (#813) 2026-06-16 16:48:27 +08:00
_Kerman
3e6196e6b2
fix: build replay ranges from replay records (#805) 2026-06-16 15:20:23 +08:00
liruifengv
6f442bd8cd
feat(kimi-code): support banner display frequency (#809)
* feat(kimi-code): support banner display frequency

* chore: change banner changeset to patch
2026-06-16 14:58:58 +08:00
7Sageer
36e06152e4
docs: simplify anthropic auth changeset (#810) 2026-06-16 14:34:24 +08:00
7Sageer
d0d5821900
fix(kosong): isolate anthropic auth environment (#790)
* fix(kosong): isolate anthropic auth environment

* fix(kosong): close remaining anthropic env fallbacks

Pass explicit nulls into the Anthropic SDK for unused auth/base URL overrides, keep adapter-owned auth headers authoritative, and add regression coverage for Anthropic shell env leakage.

* fix(kosong): block anthropic custom header env leakage

* docs(kosong): explain anthropic env-isolation intent + migration

Spell out that the SDK is used as a transport to arbitrary endpoints, so disabling its shell-env auto-discovery is the fix: the authToken/baseURL/header nulls are load-bearing, not redundant. Also document the behavior change (shell ANTHROPIC_* no longer read; use provider config) in the changeset. No logic change.
2026-06-16 14:30:49 +08:00
7Sageer
b45672cdaa
fix(kaos): destroy buffered readable sources (#807) 2026-06-16 13:07:33 +08:00
liruifengv
ff332be6d3
fix(tui): add top border to queue pane to separate it from todo panel (#801) 2026-06-16 12:19:52 +08:00
7Sageer
299b9fcad4
fix(agent-core): suppress close-time background notifications (#804) 2026-06-16 11:34:44 +08:00
liruifengv
aa1896ca74
fix(kimi-code): reduce /btw panel max height to one-third of terminal (#802) 2026-06-16 11:12:20 +08:00
liruifengv
c48e823f61
docs(changelog): sync 0.15.0 release notes into docs site (#793)
Some checks are pending
CI / build (push) Waiting to run
CI / test (push) Waiting to run
CI / lint (push) Waiting to run
CI / typecheck (push) Waiting to run
Nix Build / Check flake.nix workspace sync (push) Waiting to run
Nix Build / nix build .#kimi-code (push) Blocked by required conditions
Release / Native release artifact (push) Blocked by required conditions
Release / Publish native release assets (push) Blocked by required conditions
Release / Release (push) Waiting to run
Release / Deploy docs (push) Blocked by required conditions
* docs(changelog): sync 0.15.0 from apps/kimi-code/CHANGELOG.md

* docs(changelog): improve Chinese translation for 0.15.0 tool-call status entry

* docs(changelog): polish Chinese wording for 0.15.0 entries
2026-06-15 23:09:23 +08:00
github-actions[bot]
18aa21575b
ci: release packages (#746)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-15 22:50:45 +08:00
Luyu Cheng
4578f05f44
fix: surface skill directory in the loaded-skill context block (#785) 2026-06-15 22:29:00 +08:00
liruifengv
2746c71c47
feat: add all-sessions picker with name search (#779)
* feat: add all-sessions picker with name search

* fix: satisfy clipboard lint errors

* test: make clipboard fallback assertion portable

* fix: harden session picker interactions

* fix: harden session picker startup flow

Invalidate pending session picker scope changes after dismissal and exit startup picker after showing a cross-directory resume command.

* fix: show empty session scope hint

Render the all-sessions toggle hint in the sessions picker empty state so users can discover Ctrl+A when the current directory has no sessions.
2026-06-15 21:31:30 +08:00
Kai
1eb363f655
feat(agent-core): prompt same-language reasoning (#787) 2026-06-15 21:20:50 +08:00
liruifengv
e2a407ce31
fix: prevent tui width overflows (#783)
* fix: prevent tui width overflows

* fix: address tui review feedback
2026-06-15 21:11:01 +08:00
_Kerman
e10b25f9be
fix: stop recording resume version metadata (#786) 2026-06-15 21:04:53 +08:00
youngxhui
73be7ba17d
fix(kosong): repair mismatched schema types from Xcode 26.5 MCP (#343)
* fix(kosong): repair mismatched schema types from Xcode 26.5 MCP

Xcode 26.5 (17F42) mcpbridge generates contradictory JSON Schemas where
String-backed Swift enums carry type: 'object' alongside string enum values.
Moonshot rejects these as invalid. Detect and repair the mismatch in
normalizeKimiToolSchema, stripping irrelevant structure keys after the fix.

Closes #302

* fix(kosong): avoid dumping full tool schemas on schema-related 400 errors

* fix(kosong): redact enum and const values in schema repair diagnostics

* fix(kosong): keep schema repair quiet

---------

Co-authored-by: 7Sageer <7sageer@djwcb.cn>
2026-06-15 20:47:15 +08:00
_Kerman
a562ef54e5
refactor: decouple agent skill registry (#784) 2026-06-15 20:39:29 +08:00
liruifengv
3fa1b8ea7d
fix(kimi-code): bundle npm package into single entry (#775)
* fix(kimi-code): bundle npm package into single entry

Bundle runtime dependencies into the CLI npm entry file, prepare an npm publish directory without bundled dependencies, and keep clipboard support optional.

* fix(kimi-code): sync npm publish directory lockfile

Update pnpm-lock.yaml for apps/kimi-code publishConfig.directory so CI can install with --frozen-lockfile.

* fix(kimi-code): disable cli declaration output

Stop generating the TypeScript declaration sidecar so the npm package contains only the main.mjs CLI entry artifact.

* fix(kimi-code): move bundled deps to devDependencies

Remove the npm publish directory pre-processing path, keep runtime dependencies as dev-only build inputs for the single-file bundle, and add a manifest regression test.

* fix(kimi-code): make koffi optional

Keep koffi available as an optional native dependency without listing bundled runtime packages as published dependencies.

* fix(kimi-code): use explicit bundle allowlist

Avoid treating every devDependency as a runtime bundle input and list the bundled third-party dependencies explicitly.

* fix(kimi-code): remove manifest regression test

Keep the packaging change focused on the manifest and bundler configuration without an extra package-json regression test.

* fix(kimi-code): only externalize optional deps

Keep tsdown's never-bundle list limited to published optional native dependencies.

* Update tsdown.config.ts

* fix(kimi-code): simplify changeset

Keep the changeset summary focused on optimizing the npm packaging system.
2026-06-15 20:23:13 +08:00
Kai
8a92db6a0c
feat: polish system prompt context (#780)
* feat(agent-core): collapse hidden dirs in prompt

Keep hidden directory entries visible in the cwd snapshot while omitting their contents to reduce prompt noise, and document the tools models should use to inspect hidden paths.

* feat(agent-core): clarify prompt AGENTS context

Add a marker when AGENTS.md content is truncated by the prompt budget and move dynamic system prompt context after the static guidance.

* chore: add prompt refinement changesets

* fix: prompt brief tool-call status

Ask the model to emit one short same-language status sentence before non-trivial tool calls while keeping detailed reasoning out of the visible transcript. Updates snapshots for the longer default prompt.
2026-06-15 19:12:07 +08:00
_Kerman
c6a996756c
fix: close interrupted tool calls on resume (#768) 2026-06-15 19:02:17 +08:00
Kai
4516f62f6a
feat(agent-core): refine system prompt context (#777)
* feat(agent-core): collapse hidden dirs in prompt

Keep hidden directory entries visible in the cwd snapshot while omitting their contents to reduce prompt noise, and document the tools models should use to inspect hidden paths.

* feat(agent-core): clarify prompt AGENTS context

Add a marker when AGENTS.md content is truncated by the prompt budget and move dynamic system prompt context after the static guidance.

* chore: add prompt refinement changesets
2026-06-15 18:38:42 +08:00
Kai
d47e699015
fix: skip legacy max step limit during migration (#772)
* fix: skip legacy max step limit during migration

* fix: skip more obsolete legacy migration fields
2026-06-15 18:02:04 +08:00
7Sageer
ecd7a0afb6
refactor: resolve model capabilities via a static table lookup (#776)
Replace the per-provider getCapability instance method, and the throwaway
provider instantiation used only for capability probing, with a static
getModelCapability(wire, model) entry point in kosong. The same
capability-registry tables are consulted, so resolution stays behaviorally
identical; it no longer constructs a temporary provider or forges an API key.

Also drop the unused getContextSizeLimit interface method.
2026-06-15 17:58:08 +08:00
liruifengv
5306fd70c5
feat(update): roll out automatic updates in staged batches via CDN manifest (#691)
* feat(update): roll out automatic updates in staged batches via CDN manifest

* chore: remove changeset

* refactor(update): single-source the CDN latest file names

* refactor(update): reuse the CDN latest URL constants in update checks

* refactor(update): drop the test-only CDN base override

* fix: preserve first launch attribution

* fix: use refreshed rollout manifest for telemetry

* fix: abort hung cdn update checks

* fix: preserve update cache with bad manifest

* chore: remove review report from branch
2026-06-15 16:52:44 +08:00
liruifengv
a355f2af2f
fix: prioritize clearing editor before cancelling stream (#767)
Some checks are pending
CI / build (push) Waiting to run
CI / test (push) Waiting to run
CI / lint (push) Waiting to run
CI / typecheck (push) Waiting to run
Nix Build / Check flake.nix workspace sync (push) Waiting to run
Nix Build / nix build .#kimi-code (push) Blocked by required conditions
Release / Release (push) Waiting to run
Release / Deploy docs (push) Blocked by required conditions
Release / Native release artifact (push) Blocked by required conditions
Release / Publish native release assets (push) Blocked by required conditions
2026-06-15 14:36:17 +08:00
liruifengv
e0c6508ed1
docs(changelog): sync 0.14.3 from apps/kimi-code/CHANGELOG.md (#769) 2026-06-15 14:31:50 +08:00
_Kerman
0ab72d7d19
test: update compaction usage snapshots (#770) 2026-06-15 13:50:06 +08:00
_Kerman
046856b740
fix: prefer media headers when reading media files (#765) 2026-06-15 12:09:05 +08:00
_Kerman
9cef896563
fix: clarify compaction summary output target (#766) 2026-06-15 12:06:56 +08:00
oocz
18f299fd0b
mcp suport sse (#744)
Some checks are pending
CI / build (push) Waiting to run
CI / test (push) Waiting to run
CI / lint (push) Waiting to run
CI / typecheck (push) Waiting to run
Nix Build / Check flake.nix workspace sync (push) Waiting to run
Nix Build / nix build .#kimi-code (push) Blocked by required conditions
Release / Publish native release assets (push) Blocked by required conditions
Release / Native release artifact (push) Blocked by required conditions
Release / Release (push) Waiting to run
Release / Deploy docs (push) Blocked by required conditions
Co-authored-by: yuchengzhen <yuchengzhen@moonshot.cn>
2026-06-14 18:04:26 +08:00
github-actions[bot]
93928066dc
ci: release packages (#717)
Some checks are pending
CI / build (push) Waiting to run
CI / test (push) Waiting to run
CI / lint (push) Waiting to run
CI / typecheck (push) Waiting to run
Nix Build / Check flake.nix workspace sync (push) Waiting to run
Nix Build / nix build .#kimi-code (push) Blocked by required conditions
Release / Publish native release assets (push) Blocked by required conditions
Release / Native release artifact (push) Blocked by required conditions
Release / Release (push) Waiting to run
Release / Deploy docs (push) Blocked by required conditions
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-14 09:12:54 +08:00
Haozhe
f874251288
feat(kimi-code): refresh OAuth provider models before opening model picker (#713)
Some checks are pending
CI / build (push) Waiting to run
CI / test (push) Waiting to run
CI / lint (push) Waiting to run
CI / typecheck (push) Waiting to run
Nix Build / Check flake.nix workspace sync (push) Waiting to run
Nix Build / nix build .#kimi-code (push) Blocked by required conditions
Release / Release (push) Waiting to run
Release / Deploy docs (push) Blocked by required conditions
Release / Native release artifact (push) Blocked by required conditions
Release / Publish native release assets (push) Blocked by required conditions
- call refreshOAuthProviderModels before /model picker opens
- add scoped refreshAllProviderModels with 'oauth' and 'all' scopes
- update tests for async picker rendering and OAuth-only refresh
2026-06-13 20:55:35 +08:00
liruifengv
1c65cbf6c3
docs(changelog): sync 0.14.2 from apps/kimi-code/CHANGELOG.md (#698)
Some checks are pending
CI / build (push) Waiting to run
CI / test (push) Waiting to run
CI / lint (push) Waiting to run
CI / typecheck (push) Waiting to run
Nix Build / Check flake.nix workspace sync (push) Waiting to run
Nix Build / nix build .#kimi-code (push) Blocked by required conditions
Release / Release (push) Waiting to run
Release / Deploy docs (push) Blocked by required conditions
Release / Native release artifact (push) Blocked by required conditions
Release / Publish native release assets (push) Blocked by required conditions
2026-06-12 21:42:51 +08:00
github-actions[bot]
1cb49dba5b
ci: release packages (#678)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-12 17:43:06 +08:00
liruifengv
7ca9bdfed5
fix(tui): skip re-entering plan mode on resume and scope startup flags to startup (#692)
Resuming a session that was already in plan mode with --plan crashed with
"Already in plan mode": the resume path called setPlanMode(true)
unconditionally while session replay had already restored the active plan
state. Check the session status first and only enable plan mode when it is
not active yet, in both the resume startup path and the startup session
picker.

The /sessions picker shared the same onSelect callback, so startup flags
were also re-applied on every mid-session switch, overriding the picked
session's own persisted modes. Gate the flag application behind an
applyStartupModes option that only the startup picker enables, and surface
post-switch setup errors instead of leaving them as unhandled rejections.
2026-06-12 17:41:25 +08:00
Haozhe
d1ba14562b
feat(providers): sync custom registry providers on startup refresh (#675)
* feat(providers): sync custom registry providers on startup refresh

- group registry providers by URL and retry available API keys\n- automatically add new providers and remove disappeared ones\n- coalesce duplicate source URLs to avoid false config-change reports\n- clear defaultThinking when default model is removed\n- update docs and add tests for registry sync scenarios

* fix(tui): only show provider refresh status for added models

 Skip removed / metadata-only provider updates when reporting model list changes.\n\n add: test to enforce the behavior.
2026-06-12 17:08:40 +08:00
liruifengv
7f0dde2ece
fix(tui): gate terminal progress sequences behind OSC 9;4 support (#690)
iTerm2 interprets any OSC 9 payload as a desktop notification, so the
ConEmu-style 9;4 progress sequence (re-sent every second by the progress
keepalive) flooded users with notifications. Only emit progress on
terminals known to implement OSC 9;4: Windows Terminal, ConEmu, Ghostty,
and WezTerm.
2026-06-12 16:49:00 +08:00
liruifengv
8d251f8ab4
feat(config): tolerate invalid config.toml sections instead of failing startup (#689)
* feat(config): tolerate invalid config.toml sections instead of failing startup

Schema errors now drop only the offending sections (single entries for
providers/models) with a warning, so a typo no longer prevents startup or
drops the login state. TOML syntax errors still fail fast with the parse
location. Mid-run reloads keep the last good config when the file breaks.

Warnings surface via the new getConfigDiagnostics API: as a startup notice
in the TUI, on stderr in print mode, and in the status bar after /new.

Write paths stay strict so a broken file is never silently rewritten, and
now fail with a short actionable message instead of raw validation JSON;
the /provider TUI flow and the kimi provider CLI report these errors
instead of crashing on an unhandled rejection.

* fix(config): keep entry-keyed sections when one entry has multiple issues

A providers/models entry with several validation issues was deleted by the
first issue, and the remaining issues from the same safeParse pass then
escalated to deleting the entire section — one badly-typed custom provider
could drop every provider, including the managed OAuth login. Issues on
entry-keyed sections now only ever target the entry itself; once it is
gone, later issues are no-ops.
2026-06-12 15:56:13 +08:00
7Sageer
c1191f5794
test: redact internal endpoint fixtures (#688) 2026-06-12 15:05:26 +08:00
Haozhe
1b55185f84
fix(changeset): downgrade agent-core and kimi-code bumps from minor to patch (#687)
Update .changeset/qualify-sub-skill-names.md to use patch instead of minor for both packages.
2026-06-12 15:02:49 +08:00
liruifengv
ad239cb1c0
fix(cli,tui): allow --auto, --yolo, and --plan with resumed sessions (#683)
Some checks are pending
CI / build (push) Waiting to run
CI / test (push) Waiting to run
CI / lint (push) Waiting to run
CI / typecheck (push) Waiting to run
Nix Build / Check flake.nix workspace sync (push) Waiting to run
Nix Build / nix build .#kimi-code (push) Blocked by required conditions
Release / Release (push) Waiting to run
Release / Deploy docs (push) Blocked by required conditions
Release / Native release artifact (push) Blocked by required conditions
Release / Publish native release assets (push) Blocked by required conditions
* fix(cli,tui): allow --auto, --yolo, and --plan with resumed sessions

* docs(cli): update flag conflict docs for resumed sessions

* fix(tui): apply startup permission/plan overrides after picker selection
2026-06-12 14:17:12 +08:00
_Kerman
dff9fd4e32
chore: use raw query imports for prompt sources (#682) 2026-06-12 11:47:44 +08:00
_Kerman
2f7218cba4
test: fix resume test assertions for compaction replay records (#681) 2026-06-12 11:32:30 +08:00
liruifengv
e900854be8
docs(changelog): sync 0.14.1 from apps/kimi-code/CHANGELOG.md (#680) 2026-06-12 11:27:49 +08:00
Haozhe
c39c62590d
feat(skill): qualify sub-skill names with parent prefix (#651)
* feat(skill): qualify sub-skill names with parent prefix

- qualify sub-skill names with parent prefix and set isSubSkill metadata\n- hide sub-skills from the model skill listing
- expose sub-skills as dotted slash commands in TUI
- update slash command docs for English and Chinese
- align built-in sub-skill local names with their directories
2026-06-12 11:12:52 +08:00
_Kerman
911e7c3fcf
fix: replay compaction records on resume (#617) 2026-06-12 11:10:52 +08:00
_Kerman
dcf30754d0
feat: stream shell tool output (#676) 2026-06-12 11:10:20 +08:00
github-actions[bot]
0a3e87f05a
ci: release packages (#629)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-12 10:54:44 +08:00