Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
080b57d
feat(agent-core): custom agent files and secondary model on the v1 en…
7Sageer Jul 29, 2026
20c3316
fix(node-sdk): wire applyPersistedSecondaryModel to agent-core-v2 (#2…
7Sageer Jul 29, 2026
fa1a2d3
docs: fix dead anchor links in en/zh docs (#2348)
wenhua020201-arch Jul 29, 2026
3b3427a
feat(agent-core-v2): let plugins contribute system prompt instruction…
7Sageer Jul 29, 2026
3c89898
feat: support plugin-contributed custom agents (#2365)
7Sageer Jul 29, 2026
63b4062
fix: remove the blocking wait from the TaskOutput tool (#2379)
RealKai42 Jul 29, 2026
aefa7a7
fix(vscode): all AskUserQuestions should be answered and added to the…
Jul 28, 2026
a3f65e9
fix(vscode): open plan files from review
Jul 28, 2026
90a7590
fix(vscode): bind plan reviews to their files
Jul 29, 2026
4a5542e
fix(agent-core-v2): honor configured permission rules
gunnlace Jul 29, 2026
19ee7ad
fix(anthropic): omit incompatible tool schemas
ousamabenyounes Jul 29, 2026
bac6616
fix(agent-core-v2): rescan agent profile catalog when a dispatch look…
lostforwurdz Jul 29, 2026
742b3d9
fix(tui): refresh task output previews
ousamabenyounes Jul 29, 2026
ac3bf6b
fix(tui): stop polling completed task output
ousamabenyounes Jul 29, 2026
706d22b
fix(tui): preserve final task output refresh
ousamabenyounes Jul 29, 2026
5dee32e
fix(tui): stop polling newly completed task output
ousamabenyounes Jul 29, 2026
7d972aa
fix(kimi-web): follow window width for the chat column
Tolik-Trek Jul 29, 2026
652978c
fix(kimi-web): swallow Ctrl+S in the composer to block the Save Page …
Tolik-Trek Jul 29, 2026
d8a6194
fix(kimi-web): anchor the conversation outline to the pane's right edge
Tolik-Trek Jul 29, 2026
7ffcd70
fix(kimi-web): swallow Ctrl+S app-wide so the browser never opens Sav…
Tolik-Trek Jul 29, 2026
fbdeec9
fix(kimi-web): keep code font metrics in bare markstream code blocks
Tolik-Trek Jul 29, 2026
983f245
fix(kimi-web): drop the TOC hover bridge and uncap the design-system …
Tolik-Trek Jul 30, 2026
9f6e497
Infer the Anthropic wire from a provider's /anthropic endpoint path
octo-patch Jul 29, 2026
b831b6e
fix(agent-core): nudge todo reconciliation when a turn ends with unfi…
airudotsh Jul 29, 2026
d30be0f
fix(agent-core): honor same-turn TodoList writes in the turn-end remi…
airudotsh Jul 29, 2026
858226a
fix(kap-server): defer global search activation
linxule Jul 29, 2026
e40132a
fix(tui): preserve quotes in Windows status line commands
Jul 29, 2026
61df0ad
test(tui): stabilize Windows quote regression
Jul 29, 2026
2696f7f
fix(agent-core-v2): preserve select_tools for disclosure
lurenjia534 Jul 29, 2026
146e613
test(agent-core-v2): align optional harness option
lurenjia534 Jul 29, 2026
111882c
fix(tui): bound completed shell output frames
lurenjia534 Jul 29, 2026
d86876e
feat(hooks): expose effective permission mode
lurenjia534 Jul 29, 2026
247e6fd
fix(mcp): reinitialize expired HTTP sessions
lurenjia534 Jul 29, 2026
d82a6dd
fix(acp): stream agent-initiated turns
lurenjia534 Jul 30, 2026
3075392
chore: prepare kkm 0.30.0 portable upstream release
codex Jul 30, 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
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .changeset/agent-catalog-reload-on-miss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@moonshot-ai/agent-core-v2": patch
"@moonshot-ai/kimi-code": patch
---

Pick up agent files written after a session started: when a subagent dispatch names a profile the session catalog does not have, the agent directories are rescanned once and the lookup retried before the dispatch fails. Fixes long-lived `kimi web` sessions never seeing newly added agent Markdown files.
5 changes: 5 additions & 0 deletions .changeset/bound-completed-shell-output.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Keep completed shell-command frames bounded in the terminal UI while preserving the full command output in session transcripts and exports.
5 changes: 5 additions & 0 deletions .changeset/clean-tools-anthropic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Prevent Anthropic requests from failing when MCP tools use unsupported top-level JSON Schema combinators.
5 changes: 5 additions & 0 deletions .changeset/expose-hook-permission-mode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Expose the current effective permission mode to external hooks through the optional `permission_mode` payload field.
5 changes: 5 additions & 0 deletions .changeset/fix-windows-status-line-quotes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Fix status line commands with quoted arguments on Windows.
5 changes: 5 additions & 0 deletions .changeset/fresh-task-output-preview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Keep the `/tasks` output preview fresh and show retryable output-loading errors.
5 changes: 5 additions & 0 deletions .changeset/manual-permission-rules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Fix `kimi web` honoring configured permission rules in manual mode.
5 changes: 5 additions & 0 deletions .changeset/plugin-custom-agents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": minor
---

Add support for plugin-contributed custom agents, discovered automatically and available for sub-agent delegation. Ship an `agents/` directory in the plugin (or declare `agents` paths in the plugin manifest) to provide them.
5 changes: 5 additions & 0 deletions .changeset/plugin-system-prompt-section.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": minor
---

Allow enabled plugins to contribute agent system-prompt instructions through `systemPrompt` or `systemPromptPath` in `kimi.plugin.json`, effective on both agent engines (the TUI, `kimi -p`, and `kimi web`).
5 changes: 5 additions & 0 deletions .changeset/reinitialize-expired-mcp-sessions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Reinitialize expired Streamable HTTP MCP sessions and retry the interrupted tool call once when the server explicitly reports that the session is invalid.
5 changes: 5 additions & 0 deletions .changeset/stream-agent-initiated-acp-turns.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Stream agent-initiated turns to connected ACP sessions, preserve live updates while resuming, and keep later prompts responsive when hooks block before a turn starts.
5 changes: 5 additions & 0 deletions .changeset/task-output-nonblocking.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Remove the blocking `block`/`timeout` wait from the TaskOutput tool so checking a background task can no longer stall the conversation; it now always returns an immediate snapshot, and completion still arrives via automatic notification.
5 changes: 5 additions & 0 deletions .changeset/todo-turn-end-reminder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Nudge todo reconciliation when a turn ends with unfinished todos, instead of waiting out the 10-turn reminder cadence.
5 changes: 5 additions & 0 deletions .changeset/v1-custom-agent-files.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": minor
---

Support Markdown-defined custom agents on agent-core.
5 changes: 5 additions & 0 deletions .changeset/v1-secondary-model.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": minor
---

Add the /secondary_model slash command to configure the secondary model used by subagents.
5 changes: 5 additions & 0 deletions .changeset/vscode-question-dialog-multi-answers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kimi-code": patch
---

Fix only the first question being answerable when the agent asked multiple questions at once; each question is now answered one by one and submitted together.
5 changes: 5 additions & 0 deletions .changeset/web-code-block-line-numbers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

web: Fix code block line numbers drifting out of sync with the code lines in plain-text code blocks.
5 changes: 5 additions & 0 deletions .changeset/web-ctrl-s-save-dialog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

web: Prevent the browser Save Page dialog on Ctrl+S / Cmd+S anywhere in the app; the shortcut still steers into the running turn from the message input.
5 changes: 5 additions & 0 deletions .changeset/web-full-width-chat-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

web: Let the chat column follow the window width instead of capping it at a fixed reading width, removing the wide empty margins on large screens.
2 changes: 1 addition & 1 deletion apps/kimi-code/KKM_RELEASE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.29.2-kkm.2
v0.30.0-kkm.1
2 changes: 1 addition & 1 deletion apps/kimi-code/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@moonshot-ai/kimi-code",
"version": "0.29.2-kkm.2",
"version": "0.30.0-kkm.1",
"description": "KKM, a portable Kimi Code fork with curated upstream fixes",
"license": "MIT",
"author": "Moonshot AI",
Expand Down
42 changes: 42 additions & 0 deletions apps/kimi-code/src/cli/agent-selection.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { readFile } from 'node:fs/promises';
import { homedir } from 'node:os';

import { parseAgentFileText, resolveAgentPath } from '@moonshot-ai/kimi-code-sdk';

import type { CLIOptions } from './options';

/**
* Resolve which agent profile the launch flags select.
*
* `--agent` carries the profile name directly; `--agent-file` implicitly
* selects the profile the file defines, so the file is parsed here (fatal on
* error) so a bad file fails before any session work. Returns undefined when
* neither flag is present.
*/
export async function resolveAgentProfileSelection(
opts: Pick<CLIOptions, 'agent' | 'agentFiles'>,
workDir: string,
): Promise<string | undefined> {
if (opts.agent !== undefined) return opts.agent;
const agentFile = opts.agentFiles?.[0];
if (agentFile === undefined) return undefined;

const path = resolveAgentPath(agentFile, workDir, homedir());
let text: string;
try {
text = await readFile(path, 'utf8');
} catch (error) {
throw new Error(
`Failed to read agent file "${path}": ${error instanceof Error ? error.message : String(error)}`,
{ cause: error },
);
}
try {
return parseAgentFileText({ path, source: 'explicit', text }).name;
} catch (error) {
throw new Error(
`Invalid agent file "${path}": ${error instanceof Error ? error.message : String(error)}`,
{ cause: error },
);
}
}
4 changes: 2 additions & 2 deletions apps/kimi-code/src/cli/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export function createProgram(
.addOption(
new Option(
'--agent <name>',
'Agent profile to use for this invocation (v2 engine only). Custom profiles are discovered from agent directories or loaded via --agent-file.',
'Agent profile to start the new session with. Custom profiles are discovered from agent directories or loaded via --agent-file. Cannot be combined with --session/--continue.',
)
.argParser((value: string, previous: string | undefined) => {
if (previous !== undefined) {
Expand All @@ -90,7 +90,7 @@ export function createProgram(
.addOption(
new Option(
'--agent-file <path>',
'Load an agent definition from a Markdown file and select it (v2 engine only).',
'Load an agent definition from a Markdown file and select it for the new session. Cannot be combined with --session/--continue.',
)
.argParser((value: string, previous: string[] | undefined) => {
if ((previous?.length ?? 0) > 0) {
Expand Down
8 changes: 2 additions & 6 deletions apps/kimi-code/src/cli/options.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import { CLI_COMMAND_NAME } from '#/constant/app';

import { isKimiV2Enabled } from './experimental-v2';

export type UIMode = 'shell' | 'print';
export type PromptOutputFormat = 'text' | 'stream-json';

Expand Down Expand Up @@ -103,10 +99,10 @@ export function validateOptions(
}
if (
(opts.agent !== undefined || opts.agentFiles.length > 0) &&
(!promptMode || !isKimiV2Enabled(env))
(opts.session !== undefined || opts.continue)
) {
throw new OptionConflictError(
`--agent/--agent-file are only available with the v2 engine (${CLI_COMMAND_NAME} -p with KIMI_CODE_EXPERIMENTAL_FLAG=1).`,
'Cannot combine --agent/--agent-file with --session/--continue: the agent is bound at session creation and the bound agent is restored automatically on resume.',
);
}
if (promptMode && opts.session === '') {
Expand Down
7 changes: 7 additions & 0 deletions apps/kimi-code/src/cli/run-prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
PROMPT_CLEANUP_TIMEOUT_MS,
} from '#/constant/app';

import { resolveAgentProfileSelection } from './agent-selection';
import { isKimiV2Enabled } from './experimental-v2';
import { drainStdio } from './headless-exit';
import { resolveOutputFormat } from './options';
Expand Down Expand Up @@ -332,6 +333,9 @@ async function resolvePromptSession(
stderr: PromptOutput,
setRestorePermission: (restorePermission: () => Promise<void>) => void,
): Promise<ResolvedPromptSession> {
// `--agent`/`--agent-file` are creation-only: validateOptions rejects them
// together with --session/--continue, so resume paths never forward a
// profile — the bound agent is restored from the session itself.
if (opts.session !== undefined) {
const sessions = await harness.listSessions({ sessionId: opts.session, workDir });
const target = sessions[0];
Expand Down Expand Up @@ -401,12 +405,15 @@ async function resolvePromptSession(
stderr.write(`No sessions to continue under "${workDir}"; starting a fresh session.\n`);
}

const agentProfile = await resolveAgentProfileSelection(opts, workDir);
const model = requireConfiguredModel(opts.model, defaultModel);
const session = await harness.createSession({
workDir,
model,
permission: 'auto',
additionalDirs: opts.addDirs?.length ? opts.addDirs : undefined,
agentProfile,
agentFiles: opts.agentFiles?.length ? opts.agentFiles : undefined,
drainAgentTasksOnStop: true,
});
installHeadlessHandlers(session);
Expand Down
5 changes: 5 additions & 0 deletions apps/kimi-code/src/cli/run-shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { toTerminalHyperlink } from '#/utils/terminal-hyperlink';
import { restoreTerminalModes } from '#/utils/terminal-restore';

import type { CLIOptions } from './options';
import { resolveAgentProfileSelection } from './agent-selection';
import { isKimiV2Enabled } from './experimental-v2';
import { createCliTelemetryBootstrap, initializeCliTelemetry } from './telemetry';
import { createKimiCodeHostIdentity } from './version';
Expand Down Expand Up @@ -110,8 +111,12 @@ export async function runShell(
configWarning = combineStartupNotice(configWarning, warning);
}
const configMs = Date.now() - configStartedAt;
// Resolve --agent/--agent-file once for the startup session; validateOptions
// has already rejected them alongside --session/--continue.
const agentProfile = await resolveAgentProfileSelection(opts, workDir);
const tui = new KimiTUI(harness, {
cliOptions: opts,
agentProfile,
additionalDirs: opts.addDirs?.length ? opts.addDirs : undefined,
tuiConfig,
version,
Expand Down
27 changes: 7 additions & 20 deletions apps/kimi-code/src/cli/v2/run-v2-print.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,27 +324,14 @@ async function resolveNativeSession(
}
}

// `--agent` / `--agent-file` bind an explicit profile; without them the
// historical setModel path (default profile on first bind) is kept. A
// same-name re-select on a resumed session keeps the profile and only applies
// an explicitly requested model; a different name is rejected by the
// engine's first-bind guard inside `bind`.
const applyProfileSelection = async (
// `--agent` / `--agent-file` are creation-only: validateOptions rejects them
// together with --session/--continue, so resume paths only apply an
// explicitly requested model — the bound profile is restored by the engine.
const applyModelOverride = async (
profile: IAgentProfileService,
model: string | undefined,
): Promise<void> => {
if (agentProfileName !== undefined) {
if (profile.data().profileName === agentProfileName) {
if (model !== undefined) await profile.setModel(model);
return;
}
await profile.bind({
profile: agentProfileName,
model: requireConfiguredModel(model ?? profile.getModel(), defaultModel),
});
} else if (model !== undefined) {
await profile.setModel(model);
}
if (model !== undefined) await profile.setModel(model);
};

const resumeById = async (id: string): Promise<ISessionScopeHandle> => {
Expand Down Expand Up @@ -384,7 +371,7 @@ async function resolveNativeSession(
const session = await resumeById(opts.session);
const agent = await ensureMainAgent(session);
const profile = agent.accessor.get(IAgentProfileService);
await applyProfileSelection(profile, opts.model);
await applyModelOverride(profile, opts.model);
const currentModel = profile.getModel();
const { restorePermission } = forceAuto(agent);
return {
Expand All @@ -403,7 +390,7 @@ async function resolveNativeSession(
const session = await resumeById(previous.id);
const agent = await ensureMainAgent(session);
const profile = agent.accessor.get(IAgentProfileService);
await applyProfileSelection(profile, opts.model);
await applyModelOverride(profile, opts.model);
const currentModel = profile.getModel();
const { restorePermission } = forceAuto(agent);
return {
Expand Down
Loading
Loading