Commit graph

1473 commits

Author SHA1 Message Date
github-actions[bot]
6954d2c8bf
ci: release packages (#3574)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-09-09 14:22:47 +08:00
liruifengv
91dcc2d8cd
chore: translate and polish pending changeset entries (#3674) 2026-09-09 14:20:48 +08:00
liruifengv
e6bc8b8ad9
chore: sync web dist from code-app (#3671)
code-app: e83e5eba9260cc51231ef8f76c63c5a6432a6cac
2026-09-09 14:01:59 +08:00
qer
f8c606e7d7
fix(updater): support zstd manifest entries (#3669) 2026-09-09 12:59:52 +08:00
cyk-ms
0b67511291
feat(agent-core-v2): nudge silent agents to post NotifyUser updates (#3651)
Some checks are pending
CI / build (push) Waiting to run
CI / test (1) (push) Waiting to run
CI / test (2) (push) Waiting to run
CI / test (3) (push) Waiting to run
CI / test (4) (push) Waiting to run
CI / test (5) (push) Waiting to run
CI / test-pi-tui (push) Waiting to run
CI / test-vscode-legacy (push) Waiting to run
CI / test-windows (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
Publish VS Code extension / Publish VSIX to marketplaces (push) Waiting to run
2026-09-09 01:02:29 +08:00
Kai
ff7371b70a
fix(glob): allow retrieving matches beyond the default page (#3658)
* fix(glob): allow retrieving matches beyond the default page

* test: decouple compaction checks from Glob tool schema size

* test: refresh registered tool snapshots for Glob pagination

* fix(glob): preserve complete result pages and render pagination notices
2026-09-09 00:29:54 +08:00
Kai
6de0cec174
fix(mcp): preserve distinct structured tool results (#3654)
* fix(mcp): preserve distinct structured tool results

* test(agent-core-v2): use current streaming event in thinking test
2026-09-08 21:40:29 +08:00
Kai
7f5debfa71
fix(agent-core-v2): fall back to the configured default model for image format gating (#3652) 2026-09-08 20:42:25 +08:00
Haozhe
5a84a67eef
refactor(agent-core-v2): replace stale v3 naming in human code with neutral mock text (#3653) 2026-09-08 20:40:24 +08:00
Haozhe
a0191da44e
feat(agent-core-v2): round-trip reasoning_details in chat completions (#3492) 2026-09-08 19:54:01 +08:00
Kai
5000f981c3
fix(agent-core-v2): make large file reads resumable (#3645)
* fix(agent-core-v2): avoid repeated truncation of file reads

* fix(agent-core-v2): resume reads within long lines

Add column offsets and forward recovery for bounded long-line reads. Reject malformed UTF-16 in Read instead of replacing invalid input.

* fix(agent-core-v2): warn on lossy UTF-16 reads

Return readable text after strict UTF-16 decoding fails, with a warning retained in budgeted read continuations.

* fix(agent-core-v2): avoid redundant tail scans and detect file changes
2026-09-08 19:47:27 +08:00
Kai
80480c01d2
feat(agent-core-v2): accept HEIC, HEIF, and BMP images for Kimi models (#3649)
* feat(agent-core-v2): accept HEIC, HEIF, and BMP images for Kimi models

Key the accepted image MIME set by the provider the agent is bound to
instead of a single global allowlist: Kimi accepts PNG/JPEG/GIF/WebP plus
BMP/HEIC/HEIF, every other provider keeps the baseline set. The provider
image policy lives in the human layer (`llm/media/image-formats`) so both
the agent-side gates and the Anthropic protocol lowering share it.

- thread the provider type through every ingestion gate: ReadMediaFile,
  prompt entry, MCP tool results, session media references, kap-server
  prompt/skill routes; expose it via IAgentProfileService.getModelProviderType
- ReadMediaFile sends accepted formats it cannot re-encode locally inline
  up to the provider's per-image budget (5MB for Kimi, 3.75MB otherwise)
  and points at a conversion command above that; full_resolution uses the
  same provider budget
- acp-server no longer gates formats itself and leaves the decision to the
  engine prompt pipeline, which knows the bound provider
- the Anthropic lowering allowlist follows the bound provider so Kimi over
  the Anthropic-compatible protocol no longer rejects HEIC client-side

* fix(agent-core-v2): resolve the image format policy on the production paths

Follow-ups from review of the provider-aware image formats:

- the Anthropic lowering read the policy from `LlmModel.provider`, which
  the adapter registry sets to the route id (`anthropic`) rather than the
  model's provider type, so Kimi over the Anthropic-compatible protocol
  still rejected HEIC client-side; the accepted set now comes from a
  `ProtocolTrait.acceptedImageMimes` hook that the Kimi traits implement,
  and the test goes through the real trait with the routed provider id
- kap-server prompt ingestion gated media against the currently bound
  model even when the same request selected another model; the profile
  service now resolves the provider type for a requested alias
- the session media memo served a cached inline image to a provider that
  does not accept its format; memo hits are re-judged against the current
  provider before being returned
- the media tools registrar keyed ReadMediaFile only by alias and
  capabilities, so a reload that changed the alias's provider type or
  protocol kept the stale tool; both now take part in the key

* test(kap-server): keep the optional chain the lint autofix dropped
2026-09-08 19:28:23 +08:00
Haozhe
9188d03c99
refactor(protocol): remove package and relocate wire types into agent-core-v2 (#3646) 2026-09-08 17:41:41 +08:00
Haozhe
14cc78611d
refactor(agent-core-v2): replace interaction DI services with a global human singleton (#3644)
* refactor(interaction): replace per-agent InteractionService with human-native session facade

- add human/interaction: global interaction machine + tag-query facade (enqueue/respond/findAll/findOne/wait)
- add session-scope SessionInteractionService owning one interaction actor per session
- rewire approval/question/userTool/sessionActivity to the session facade and delete features/interaction

* refactor(interaction): rewire kap-server, klient and node-sdk to the session interaction facade

- kap-server routes, ws broadcaster and transcript binding read ISessionInteractionService (tags replace origin)
- klient memory dispatcher delegates to the session service; zod contract mirrors origin -> tags
- node-sdk session wiring subscribes the session service directly
- register interaction wire events in their new home and regenerate the wire manifest

* refactor(agent-core-v2): replace interaction DI services with a global human singleton

resolve rebase conflicts
2026-09-08 17:39:16 +08:00
Haozhe
324774d812
test: stabilize the full suite on macOS developer machines (#3643)
Some checks are pending
CI / lint (push) Waiting to run
CI / test-windows (push) Waiting to run
CI / build (push) Waiting to run
CI / test (1) (push) Waiting to run
CI / test (2) (push) Waiting to run
CI / test (3) (push) Waiting to run
CI / test (4) (push) Waiting to run
CI / test (5) (push) Waiting to run
CI / test-pi-tui (push) Waiting to run
CI / test-vscode-legacy (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 / Release (push) Waiting to run
Release / Deploy docs (push) Blocked by required conditions
Release / Publish native release assets (push) Blocked by required conditions
Publish VS Code extension / Publish VSIX to marketplaces (push) Waiting to run
- scrub all ambient KIMI_CODE_* env vars in the agent-core-v2 and
  kap-server test setups so developer shell env cannot leak in
- drop the load-sensitive stepRetry fake-timer cases and the three
  FSEvents-based skill catalog watch cases
- give node-sdk, klient and the vscode extension project an explicit
  15s testTimeout matching their integration-test nature
- retry temp-dir removal in taskManager teardown to absorb async
  terminal-effect writes
2026-09-08 16:21:16 +08:00
Kexin Liu
d4d20d21d7
feat(agent-core-v2): allow read-only tools in /btw side questions (#3613)
* feat(agent-core-v2): allow read-only tools in /btw side questions

The btw child agent previously vetoed every tool call. Allow the
read-only tools Read, Grep, and Glob so side questions about the
codebase can be answered from current file contents; write and
execute tools stay disabled.

* docs: address review — single-sentence changeset, inline-code tool names

* chore: drop the benefit clause from the btw changeset
2026-09-08 14:50:48 +08:00
7Sageer
1670d3a8aa
fix(agent-core-v2): clarify subagent model disclosure in Agent and AgentSwarm prompts (#3639)
* fix(agent-core-v2): clarify subagent model disclosure in Agent and AgentSwarm prompts

The Available models section annotated "primary" with its alias only
when the caller's model was already listed, and stayed anonymous exactly
when the annotation was needed. The same model was reachable three ways
with an undisclosed thinking-level difference, the [main model] marker
duplicated the primary handle under a second name, and AgentSwarm
repeated the whole list verbatim.

- primary now always names its binding: primary (= <alias>)
- drop the [main model] marker; keep [default]
- state the pool entries' thinking level in a closing note
- AgentSwarm renders a compact one-line summary instead of the full block
- keep the selection guidance only in the model parameter description

* Delete .changeset/clear-subagent-model-list.md

Signed-off-by: 7Sageer <sag77r@hotmail.com>

* fix(agent-core-v2): drop the hard-task guidance from the model parameter descriptions

* fix(agent-core-v2): render a disabled-thinking variant of the pool thinking note

* test(agent-core-v2): drop the added prompt-text variant tests, keep updated assertions

* fix(agent-core-v2): state the pool thinking note as one unconditional binding rule

---------

Signed-off-by: 7Sageer <sag77r@hotmail.com>
2026-09-08 14:47:03 +08:00
7Sageer
e56df4e134
fix(telemetry): stop silently dropping key event attributes (#3638)
* fix(telemetry): stop silently dropping key event attributes

- turn_ended now carries error_type (the engine error code) when a turn
  fails, matching the v2 event catalog definition that no emitter set
- TelemetryClient reports properties dropped by sanitizeProperties via a
  new onUnexpectedError hook, wired to the CLI, web, and v2-print logs
- session_started client attribution keys emit empty strings instead of
  null so they survive payload flattening

* fix(telemetry): sanitize at sink accept time and guard the drop handler

Addresses review on #3638:

- Properties are sanitized when the sink accepts the event (at track time
  on the direct path, at drain time for the pre-init queue), so drops on
  events queued before initialization are reported once
  onUnexpectedError is installed
- The onUnexpectedError hook is invoked behind a guard, mirroring the
  agent-core-v2 unexpectedError path, so a faulty host handler cannot
  abort track()

* fix(telemetry): snapshot queued properties at track time

Addresses review on #3638: the pre-init queue now stores the sanitized
snapshot taken at track time (only primitives survive, so the snapshot
is exact), and the dropped keys ride along as pending diagnostics that
are replayed once the handler is installed. Callers mutating a reused
properties object between track() and initialization can no longer
alter the emitted event or its drop reports
2026-09-08 14:37:19 +08:00
Kai
f6a9c39e22
feat(kimi-code): NotifyUser tool and mid-turn update panel (#3524)
* feat(kimi-code): two-line collapsed tool cards with width-aware headers

Collapsed cards now show the call on line one and a single dim outcome
row on line two: a Bash command's last output line (the live tail while
running) with a line-count chip, a Grep/Glob path sample, or a generic
tool's first output line. Read groups stay header-only and honor the
global expand state; failed calls keep their preview. Headers split into
head / flexible / tail segments so a long command fills the terminal
width before the chip.

* feat(kimi-code): NotifyUser tool and mid-turn update panel

Add an experimental NotifyUser tool (flag notify_user, off by default)
that agent-core-v2 offers only when the host declares the update_panel
UI capability at bootstrap; the TUI declares it through the SDK harness
options. The system prompt's guidance to send updates is injected only
when the tool is active for the agent. The TUI renders the turn's
updates in a panel above the editor (stacked, 8-row window, Ctrl+N pages
back) that the next turn clears, and keeps a one-line card in the
transcript.

* feat: add subagent updates and bidirectional paging

* fix: preserve session tools and prompts when toggling updates

* fix: correct notification delivery and CI regressions
2026-09-08 13:47:23 +08:00
Haozhe
c156ed5ea9
test(kap-server): drop the flaky two-pass swap catalog import case (#3636) 2026-09-08 12:55:30 +08:00
Haozhe
f88ed6d45b
chore: add the tdd skill for test-driven development (#3637) 2026-09-08 12:52:09 +08:00
Grapedge
586c4c2130
chore: initialize husky git hooks (#3632) 2026-09-08 12:37:31 +08:00
7Sageer
e831fd1ea9
feat(secondary-model): drop the experimental flag from the subagent model pool (#3634)
* feat(secondary-model): drop the experimental flag from the subagent model pool

* feat(secondary-model): sync the web bundle without the experimental gate
2026-09-08 11:37:03 +08:00
Haozhe
0527dae160
refactor(agent-core-v2): align xstate machine naming with command/fact/streaming conventions (#3635) 2026-09-08 11:18:00 +08:00
Haozhe
6e51631c3d
fix(agent-core-v2): stop tool actor teardown from aborting sibling tools (#3626)
* fix(agent-core-v2): stop tool actor teardown from aborting sibling tools

* refactor(agent-core-v2): hoist abort signal ownership to spawn sites

* refactor(agent-core-v2): derive cancellation from a Go-like abort scope tree

* fix(agent-core-v2): bind the abort scope's child abort
2026-09-08 10:26:13 +08:00
qer
fa87d040c3
feat(kap-server): expose session deletion with serialized cleanup (#3630)
Some checks are pending
CI / build (push) Waiting to run
CI / test (1) (push) Waiting to run
CI / test (2) (push) Waiting to run
CI / test (3) (push) Waiting to run
CI / test (4) (push) Waiting to run
CI / test (5) (push) Waiting to run
CI / test-pi-tui (push) Waiting to run
CI / test-vscode-legacy (push) Waiting to run
CI / test-windows (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
Publish VS Code extension / Publish VSIX to marketplaces (push) Waiting to run
2026-09-08 03:00:40 +08:00
7Sageer
f12d59e089
feat(agent-core-v2): anchor compaction resumption on the latest user message (#3537)
Some checks are pending
CI / test-windows (push) Waiting to run
CI / lint (push) Waiting to run
CI / build (push) Waiting to run
CI / test (1) (push) Waiting to run
CI / test (2) (push) Waiting to run
CI / test (3) (push) Waiting to run
CI / test (4) (push) Waiting to run
CI / test (5) (push) Waiting to run
CI / test-pi-tui (push) Waiting to run
CI / test-vscode-legacy (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
Publish VS Code extension / Publish VSIX to marketplaces (push) Waiting to run
* feat(agent-core-v2): anchor compaction resumption on the latest user message

* fix(agent-core-v2): count the continuation anchor in tokensAfter

* fix(agent-core-v2): simplify the continuation anchor to a single statement

* fix(agent-core-v2): avoid absolute claims in the compaction continuation texts

* fix(agent-core-v2): flag the continuation anchor in compaction records so old records replay unchanged

* fix(agent-core-v2): replay the continuation anchor unconditionally, drop hasContinuation

The anchor is an injection (policy, not history): like the system prompt
and other reminders, it is re-rendered by current code at replay time, so
pre-anchor compaction records gain it on resume. The divergence is
self-limiting (only records written before this change, absorbed on first
resume) and needs no per-record format flag. Fold-length accounting counts
the anchor unconditionally to stay at parity with the rebuilt context.

* fix(vis): align the context projector with the compaction continuation anchor

Locate the compaction summary by origin instead of assuming it is the last
shape message (the anchor now follows it), and pin the anchor in the
projection expectations.
2026-09-07 21:44:24 +08:00
Grapedge
260ac3faad
feat(cli): apply cloud-recommended default thinking effort (#3616) 2026-09-07 21:21:34 +08:00
7Sageer
1316b3f92b
refactor(agent-core-v2): drop anthropic_beta and google-vertex protocol names (#3602)
* refactor(agent-core-v2): drop anthropic_beta and google-vertex protocol names

* refactor(agent-core-v2): resolve human protocol variants at generate time
2026-09-07 21:03:40 +08:00
Haozhe
5e622e5b52
refactor(agent-core-v2): move llm retry and recovery from the llm machine to the turn state machine (#3624) 2026-09-07 21:01:25 +08:00
Haozhe
f3c75bd4d9
docs(agent-core-v2): add the llm module design guide (#3621)
* docs(agent-core-v2): add the llm module design guide

* docs(agent-core-v2): align the llm guide with the shared syntax errors, failure ends, and anthropic_beta naming
2026-09-07 20:57:13 +08:00
tpoisonooo
0d7833ee80
fix(agent-v2): tower mode fixes (#3596)
* feat(tui): show each background agent's model in the /tasks list

* fix(agent-core-v2): carry model and thinking effort in tower spawn task metadata

* fix(tower): honor subagent timeout config for tower spawn tasks

TowerSpawnTool registered its detached subagent task with the hardcoded
DEFAULT_SUBAGENT_TIMEOUT_MS, bypassing the [subagent] timeout_ms setting
and KIMI_SUBAGENT_TIMEOUT_MS. Resolve the timeout through
resolveSubagentTimeoutMs(config) like AgentTool does, keeping the 2h
default when nothing is configured.

* test(agent-core-v2): deflake the sessionIndex perf baseline under load

* feat(agent-core-v2): carry user-verbatim mission context through tower briefings

TowerPlan missions accept an optional context field holding the user's
own key sentences verbatim, rendered into the mission file and every
briefing that embeds it. Reviewer briefings now include the full mission
text and the author's review-request, with an intent-first checklist;
worker briefings escalate substantive ambiguity to the tower before
acting and reconcile completion reports task by task.

* chore: merge tower changesets into one

* refactor(tui): narrow tasks-browser host appState with Pick

* docs(agent-core-v2): correct the subagent timeout description in the Agent tool

* docs(agent-core-v2): drop the timeout bullet from the Agent tool description

---------

Co-authored-by: konghuanjun <konghuanjun@moonshot.ai>
2026-09-07 20:50:18 +08:00
Kai
34ad5137ce
feat(kimi-code): two-line collapsed tool cards with width-aware headers (#3539)
* feat(kimi-code): two-line collapsed tool cards with width-aware headers

Collapsed cards now show the call on line one and a single dim outcome
row on line two: a Bash command's last output line (the live tail while
running) with a line-count chip, a Grep/Glob path sample, or a generic
tool's first output line. Read groups stay header-only and honor the
global expand state; failed calls keep their preview. Headers split into
head / flexible / tail segments so a long command fills the terminal
width before the chip.

* feat(kimi-code): show short tool output whole and point at hidden output

Collapsed cards now show up to three output lines before falling back to
a single outcome row, the Grep chip counts files or matches according to
output_mode, and the tools' pagination and empty-result notices no longer
count as results. While the recent turns hold tool output that ctrl+o
would reveal or hide, the footer shows ctrl+o expand or ctrl+o collapse.

* feat(kimi-code): mark hidden tool output with counts and direction

A collapsed Bash card's chip now counts the hidden lines (`N more
lines`), its last-line outcome row carries a leading ellipsis, a generic
tool's first-line row a trailing one, and the Grep glance keeps its
"+N more" count in the fixed tail so width cuts drop samples, never the
count. Background Bash results identify the task by their first
metadata line instead of trailing internal hints, and header truncation
now treats ANSI escapes as atomic zero-width units and stays bounded by
the terminal width for huge arguments.

* fix(kimi-code): keep tool notices and context rows out of result counts

Glob's timeout, truncation, and warning lines no longer inflate the
file count or pose as glance samples, and unnumbered Grep content with
context flags falls back to an exact file count instead of claiming
matches it cannot distinguish. The footer's ctrl+o hint now also
appears when an outcome row is cut by the terminal width — one to three
very long lines hide the remainder that ctrl+o reveals wrapped.

* fix(kimi-code): align the ctrl+o hint with what expansion reveals

The Edit check now uses the same clustered diff render as the preview
(context rows and inter-hunk separators count toward the cap), and an
ExitPlanMode outcome card no longer reports hidden content — the plan
is fully rendered by the call preview and its result body is
expansion-independent. OUTCOME_MAX_LINES moves to the TUI constant
directory with the other shared rendering limits.

* fix(kimi-code): tighten the collapsed-card hidden-content signals

Outcome rows drop terminal control sequences before they are cut, a
failed Bash card leaves the hidden-line count to its preview trailer,
an unnumbered Grep glance lists each file once, a solo subagent card
never reports hidden content, and the glance sample cap joins the other
collapsed-card limits in the rendering constants.

* fix(kimi-code): count paginated Grep totals and wrapped error previews as hidden

The Grep chip and glance use the tool's count-mode summary and pagination
total instead of the current page, Windows drive letters stay inside
unnumbered content paths, Glob's ripgrep stderr continuation lines no
longer count as files, a background question follows the line-count rule,
and an error preview whose long line wraps past its row cap keeps the
footer's ctrl+o hint on.

* fix(kimi-code): treat spilled tool output as an envelope, not as results

An oversized result reaches the TUI as agent-core's truncation envelope;
cards now render its first line as the outcome row and carry no chip
instead of counting its metadata as files or lines. The Grep chip keeps
the count-mode totals on an empty page, and the Bash chip counts rows
the way the outcome rows do, so whitespace-only rows never claim hidden
lines.

* fix(kimi-code): widen the hidden-content signal to failed previews and ! cards

A paginated content search reports the tool's match total, a capped Edit
or Write preview counts as hidden even when the call failed, and a
user-run ! command card tells the footer about its running tail or
capped result.

* fix(kimi-code): keep result chips honest on incomplete, narrow, and cut-off cards

Grep and Glob counts read as lower bounds (`12+ files`) when the tool
reports a timeout or output cap, a header too narrow for its fixed parts
drops the middle and cuts the head before the chip, and a call whose
arguments were cut off by max_tokens no longer claims hidden content.

* fix(kimi-code): stop the expand hint lying on goal cards, ! cards, and paginated context

A pagination total only stands in for the match count when no context
flag is set, a ! command card that finished while expanded still counts
its rows past the preview cap, parsed goal snapshots and bodiless goal
updates report nothing to expand, header fitting measures graphemes
instead of trusting code-unit length, and the escape pattern and tail
window join the rendering constants.

* fix(kimi-code): read zero context flags as none and mirror the Edit cap exactly

A Grep call with -A/-B/-C set to zero produces no context rows, so its
matches stay countable; the Edit hidden-content check now renders the
preview capped and uncapped and compares them, so a body that fills the
cap exactly no longer counts as cut.

* fix(kimi-code): keep the collapse hint for expanded cards outside the window

Toggling ctrl+o off collapses every expanded card, including one that
slid before the three-turn cutoff since it was expanded, so the footer
now keeps offering collapse while any expanded card hides content. Grep
context detection follows the backend's -C precedence, where a defined
-C makes -A and -B moot.

* fix(kimi-code): render Edit and Write results the same way in both states

Their one-line success acknowledgements repeat what the header, chip and
preview already show, so they render in neither state; any other
successful output shows as an outcome row in both. The footer's expand
hint therefore depends only on the capped preview for these cards.

* fix(kimi-code): keep a Read group's failure count on narrow rows

The finished header is three segments — label, line count, `· N failed`
tail — so a narrow row drops the line count before the failure count,
which is the only sign of partial failure while the per-file body is
collapsed.

* fix(kimi-code): show cut-short empty searches and keep the hint with a status command

A Grep or Glob the tool cut short before any row renders its notice
instead of an exact-looking empty result and carries no chip, a
ReadMediaFile result that is not a media envelope follows the line-count
rule, and the footer's ctrl+o hint moves to line 2 when a
status_line.command owns line 1.

* fix(kimi-code): count unreadable directories as an incomplete Glob and stop hinting on notice-only searches

A Glob that skipped unreadable directories reports its file count as a
lower bound, and a search cut short before any row — which renders only
the tool's notice, the same way in both states — no longer makes the
footer offer ctrl+o.

* fix(kimi-code): let the ctrl+o hint displace an inline tip and count parsed WaitFor results as hidden

An inline tips slot gives way when the fixed hint would not fit beside
it, and a parsed WaitFor result — whose raw fields only render when
expanded — reports hidden content instead of falling to the line-count
rule.

* fix(kimi-code): keep spill pointers and sensitive-only notices out of counts and honor streaming previews

The per-line truncation pointer agent-core appends to an oversized
result stays out of line and file counts, byte sizes and outcome rows; a
search whose only matches were filtered as sensitive files shows the
tool's notice instead of an exact-looking empty result; and while
arguments still stream, only a Bash card (whose partial command appears
once expanded) reports hidden content.
2026-09-07 20:36:46 +08:00
Haozhe
75682b0ef1
fix(agent-core-v2): skip stray non-directory entries during session index scans (#3618) 2026-09-07 19:06:09 +08:00
Kexin Liu
fb0353a8ba
feat(agent-core-v2): watch user-level skill roots so the catalog stays fresh (#3608)
* feat(agent-core-v2): watch user-level skill roots so the catalog stays fresh

UserFileSkillSource previously only re-scanned the user skill roots
(KIMI_CODE_HOME/skills and ~/.agents/skills) on catalog load, so a skill
created while the daemon was running never appeared until a restart.

Mirror the workspace-root source: watch both user-level base directories
with a subtree filter limited to the skill-root candidates, debounce
(200ms) change events, and fire onDidChange so the catalog reloads the
'user' source automatically. Watch handles are registered on the
service's DisposableStore and disposed with the App scope.

Supersedes the skills:reload endpoint approach (#3597).

* fix(agent-core-v2): merge same-base watch candidates and drop test comments

Codex review on #3608:

- When KIMI_CODE_HOME equals the OS home dir, deduplicating watch bases
  skipped the .agents/skills candidate entirely. Group candidates by
  base instead so one watch covers both roots.
- Remove // phase labels from the catalog test: agent-core-v2 is a
  comment-free zone enforced by scripts/check-no-comments.mjs (lint was
  red on CI).
2026-09-07 17:41:16 +08:00
HydrogenE7
5eea890165
fix(agent-core-v2): attribute event-loop-busy decode time to the client (#3607)
The decode-window split measured part arrival at the moment the event
loop resumed the pending await, so any loop-busy work (rendering,
timers, GC) between parts was reported as server time. Measure loop
utilization across the decode window with perf_hooks and split it into
loop-idle wait (server), per-part processing (client), and a new
clientBlockedMs bucket (loop busy with other work), carried through to
the step events, wire record, transcript contract, and the TUI debug
timing line.
2026-09-07 16:43:44 +08:00
HydrogenE7
f1e9152776
fix(sdk): count cron turns as replay turn boundaries (#3605)
Some checks are pending
CI / test-windows (push) Waiting to run
CI / lint (push) Waiting to run
CI / build (push) Waiting to run
CI / test (1) (push) Waiting to run
CI / test (2) (push) Waiting to run
CI / test (3) (push) Waiting to run
CI / test (4) (push) Waiting to run
CI / test (5) (push) Waiting to run
CI / test-pi-tui (push) Waiting to run
CI / test-vscode-legacy (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 / Release (push) Waiting to run
Release / Deploy docs (push) Blocked by required conditions
Release / Publish native release assets (push) Blocked by required conditions
Publish VS Code extension / Publish VSIX to marketplaces (push) Waiting to run
Resuming a session dominated by cron-fired turns mounted an unbounded
transcript: limitAgentReplayByTurns only counted human-typed prompts as
turn boundaries, so the replay limit never engaged (10,478 records for
11 'turns' on an affected session). The mounted transcript made every
render frame O(total lines), starving the event loop during streaming
and collapsing client-side drain throughput.

Treat cron_job and cron_missed replay records as turn boundaries,
matching the TUI transcript window's own boundary rule.
2026-09-07 16:05:42 +08:00
Kai
55685c58b5
feat(agent-core-v2): remove the context budget reminders (#3526)
* feat(agent-core-v2): remove the context budget reminders

PR #3423 shipped two behaviors together: the context budget reminders
(context_budget and compaction_ahead) and the compaction recovery
pointer. Remove the reminders so the recovery pointer's effect can be
measured on its own in an ablation run.

Removed: the features/contextBudget feature, the budget-only
CompactionStrategy.budget()/CompactionTriggerBudget/
IAgentFullCompactionService.budget() surface, the summarizer-input
reminder filter, and the context_budget_reminder /
compaction_ahead_reminder telemetry plus the ahead_* fields on
compaction_finished. The recovery pointer (Context Recovery footer,
wire journal line ranges, whole-line wire.jsonl reads, empty-history
compaction failure) is unchanged.

* chore: add the changeset for removing the context budget reminders
2026-09-07 16:00:15 +08:00
silentiris
ed1dc720e2
fix(kosong): tolerate undefined model name in Anthropic profile matching (#3003)
A malformed config entry (e.g. an unquoted dotted TOML key like
[models.kimi-k2.7-code]) parses into a nested object that lacks the
top-level model field. The v2 config schema marks model optional, so the
entry reaches profile matching with undefined, crashing getModels with
TypeError: Cannot read properties of undefined (reading 'toLowerCase').

matchKnownAnthropicModelProfile, matchUnknownClaudeProfile, and
parseAnthropicModelVersion now return undefined/null for undefined input
instead of throwing.

Fixes #2981

Co-authored-by: zhaopeiwen.dev <zhaopeiwen.dev@bytedance.com>
2026-09-07 15:48:24 +08:00
7Sageer
924da9cdb4
feat(agent-core-v2): add env bindings for print-mode and bash task timeout config keys (#3598)
* feat(agent-core-v2): add env bindings for print-mode and bash task timeout config keys

Wire bashTaskTimeoutS, printBackgroundMode, printWaitCeilingS, and
printMaxTurns into taskEnvBindings as KIMI_CODE_BACKGROUND_* variables
so headless/print runs (e.g. container harnesses) can bound or disable
the print background policy without mounting a config file. bashTaskTimeoutS
accepts 0 (no timeout); invalid values are ignored. Env-set values count
as set for applyPrintModeConfigDefaults and win over the print fill.

Both integer parsers use Number.isSafeInteger: zod's int() rejects
unsafe integers, and since applySectionEnvBindings validates the combined
overlay, one unsafe value would otherwise discard the whole section's
env bindings, including valid siblings.

* Delete .changeset/print-task-env-bindings.md

Signed-off-by: 7Sageer <sag77r@hotmail.com>

---------

Signed-off-by: 7Sageer <sag77r@hotmail.com>
2026-09-07 14:36:09 +08:00
7Sageer
00cfbb0547
fix(cli): warn in kimi -p when workspace trust skips project MCP servers (#3593)
* fix(cli): warn in kimi -p when workspace trust skips project MCP servers

* fix(cli): report project MCP overrides in trust warnings
2026-09-07 14:35:58 +08:00
Haozhe
73ff2bf6e6
fix(agent-core-v2): merge text deltas across empty reasoning stream parts (#3601) 2026-09-07 14:21:22 +08:00
Haozhe
369dbff8db
fix(remote-control): release the lock before reporting off and re-read the server token per forward (#3599)
* fix(remote-control): release the lock before reporting off and re-read the server token per forward

* fix(remote-control): pass the token provider through the manager
2026-09-07 14:15:28 +08:00
Haozhe
48f5dc9740
feat(kap-server): add remote-control runtime toggle API (#3594)
* feat(kap-server): add remote-control runtime toggle API

* feat(remote-control): manage tunnel lifecycle with an xstate state machine
2026-09-07 13:46:22 +08:00
Haozhe
3f967e1410
refactor(agent-core-v2): unify fs watching into a single xstate watch service (#3502) 2026-09-07 13:30:25 +08:00
Haozhe
c1cac3436d
fix(kap-server): stop event journal writes after server close (#3595) 2026-09-07 12:07:30 +08:00
Haozhe
f0434f2d25
feat: graduate remote-control, minidb read model and search worker from experimental flags (#3552)
- remote-control is always available: kimi rc, kimi web --remote-control and /remote-control no longer require KIMI_CODE_EXPERIMENTAL_REMOTE_CONTROL or the master flag
- add the [database] config section with base (session-index read model) and search (global search worker) kill switches, both defaulting to true
- rename the kill-switch env vars to KIMI_CODE_PERSISTENCE_MINIDB_READMODEL and KIMI_CODE_SEARCH_WORKER (precedence: env > config > default)
2026-09-07 11:28:35 +08:00
Haozhe
bb16383aa1
refactor: remove the legacy agent-core v1 package (#3542)
* refactor: remove the legacy agent-core v1 package

Delete packages/agent-core (v1 engine) and migrate node-sdk fully onto
agent-core-v2:

- node-sdk owns its public contract (error protocol, KimiConfig schema
  and file IO, process-global logging facade, telemetry client
  interface); event and interaction types re-export from
  @moonshot-ai/protocol or agent-core-v2
- createKimiHarness is now the single harness factory, backed by the
  v2 client; the v1 SDKRpcClient is deleted
- CLI and vscode run agent-core-v2 unconditionally;
  KIMI_CODE_LEGACY_FLAG and useAgentCoreV1 are removed
- the wire.jsonl replay fold moves into agent-core-v2's replayBuilder
  (foldWireRecords), and the v2 journal now persists tool-call display
  so replay restores diff/todo displays
- TUI engineV2 branches collapse to the v2 path

* test(vscode): retry temp-dir teardown in replay-resume integration test
2026-09-07 11:17:51 +08:00
Haozhe
ccf3d5d6d7
fix(agent-core-v2): deduplicate repeated tool call ids inside the turn machine (#3586)
Some checks are pending
CI / build (push) Waiting to run
CI / test (1) (push) Waiting to run
CI / test (2) (push) Waiting to run
CI / test (3) (push) Waiting to run
CI / test (4) (push) Waiting to run
CI / test (5) (push) Waiting to run
CI / test-pi-tui (push) Waiting to run
CI / test-vscode-legacy (push) Waiting to run
CI / test-windows (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 / Release (push) Waiting to run
Release / Deploy docs (push) Blocked by required conditions
Release / Native release artifact (push) Blocked by required conditions
Publish VS Code extension / Publish VSIX to marketplaces (push) Waiting to run
* fix(agent-core-v2): deduplicate repeated tool call ids inside the turn machine

* fix(agent-core-v2): keep the raw tool call id whenever a normalizer rewrites it
2026-09-07 00:11:13 +08:00
Haozhe
00265b0974
fix(agent-core-v2): deduplicate repeated tool call ids in the loop machine requester (#3582) 2026-09-06 22:38:11 +08:00