Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .changeset/animated-terminal-title-spinner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Add an animated terminal-title indicator while the agent is busy. Set `KIMI_TITLE_SPINNER=off` to disable it.
5 changes: 5 additions & 0 deletions .changeset/bash-mode-large-paste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Enter shell mode when pasting a large `!` command into an empty prompt, even if the paste is folded into a marker.
5 changes: 5 additions & 0 deletions .changeset/calm-ravens-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Keep CLI shutdown within one bounded timeout when multiple telemetry pipelines are active.
5 changes: 5 additions & 0 deletions .changeset/context-usage-command.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": minor
---

Add the /context slash command to show a Claude Code-style context usage breakdown with estimated tokens per category (system prompt, tools, MCP tools, memory files, skills, messages). Run /context to see it.
5 changes: 5 additions & 0 deletions .changeset/dedup-register-rejected-calls.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Count validation-rejected tool calls toward the repeat breaker so reminders fire at 3/5/8 and the turn force-stops at 12.
5 changes: 5 additions & 0 deletions .changeset/dedupe-reminder-survives-truncation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Keep repeat-call warnings visible when oversized tool results are offloaded.
5 changes: 5 additions & 0 deletions .changeset/disabled-skills-config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Add `disabled_skills` config to fully hide selected skill names from Kimi (model listing, Skill tool, slash menu, and activation). Set `disabled_skills = ["name"]` in `config.toml`, then run `/reload`.
5 changes: 5 additions & 0 deletions .changeset/fix-web-stream-text-wrapping.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

web: Fix streamed assistant text rendering with unintended line breaks between chunks.
5 changes: 5 additions & 0 deletions .changeset/localhost-bind-classification.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Classify localhost bind hosts case-insensitively.
5 changes: 5 additions & 0 deletions .changeset/monitor-tool.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": minor
---

Add a `Monitor` tool: run a self-filtering shell command in the background and receive each new stdout line as a notification (with batching and an auto-stop volume cap). Stop with `TaskStop` or let it time out; `persistent` watches run until the session ends.
5 changes: 5 additions & 0 deletions .changeset/mouse-select-editor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/pi-tui": minor
---

Add text selection, replacement, deletion, rendering, and mouse-position mapping to the editor component.
5 changes: 5 additions & 0 deletions .changeset/node-sdk-v2-surface.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code-sdk": minor
---

Add the v2 SDK surface for sessions, configuration, events, and global MCP management.
5 changes: 5 additions & 0 deletions .changeset/qualified-plugin-skills.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Fix plugin-qualified Skill listing and invocation, and report ambiguous bare plugin Skill names.
6 changes: 6 additions & 0 deletions .changeset/quota-exhausted-fail-fast.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@moonshot-ai/kimi-code": patch
"@moonshot-ai/kimi-code-sdk": patch
---

Fail fast on quota/balance-exhausted HTTP 429 errors (e.g. Moonshot `exceeded_current_quota_error`, OpenAI `insufficient_quota`) instead of silently retrying for ~3 minutes. Transient rate-limit 429s keep the existing retry, backoff, and Retry-After behavior.
5 changes: 5 additions & 0 deletions .changeset/refresh-web-skill-menus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

web: Refresh loaded skill menus after configuration changes.
5 changes: 5 additions & 0 deletions .changeset/status-line-config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@moonshot-ai/kimi-code': minor
---

Customizable footer status line: compose built-in slots via `[status_line] items` in `tui.toml`, or render the first stdout line of a user script via `[status_line] command`.
5 changes: 5 additions & 0 deletions .changeset/strict-colorfgbg-background.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Ignore malformed COLORFGBG background color indexes during terminal theme detection.
5 changes: 5 additions & 0 deletions .changeset/strict-vis-port-values.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Reject malformed port values for the session visualizer command.
5 changes: 5 additions & 0 deletions .changeset/strict-web-port-values.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Reject malformed port values for the web server command.
5 changes: 5 additions & 0 deletions .changeset/terminal-mouse-selection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": minor
---

Add experimental mouse selection to the prompt editor. Set `KIMI_CODE_EXPERIMENTAL_TERMINAL_MOUSE_INPUT=1` to enable it.
5 changes: 5 additions & 0 deletions .changeset/unify-page-title-moon-spinner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

web: Unify the running-session page title spinner with the chat MoonSpinner sequence and timing.
5 changes: 5 additions & 0 deletions .changeset/upload-no-size-cap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": minor
---

Remove the 50 MB size limit on file uploads to the built-in server, so large attachments (for example in the web UI) no longer fail with an upload-too-large error. Uploads now stream to disk instead of being buffered in memory.
5 changes: 5 additions & 0 deletions .changeset/validate-installed-plugin-records.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Report a malformed record in `plugins/installed.json` as a load error naming the offending entry, instead of handing the record to the plugin manager and crashing later on a missing field.
5 changes: 5 additions & 0 deletions .changeset/web-initial-file-mention.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

web: Fix file mentions returning no matches while drafting the first message in a workspace.
5 changes: 5 additions & 0 deletions .changeset/web-network-hints-fallback.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

Keep `kkm web` usable when the host cannot enumerate network interfaces.
5 changes: 5 additions & 0 deletions .changeset/web-settings-accent-highlight.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

web: Highlight selected settings options (theme, language, default permission) with the current accent color.
5 changes: 5 additions & 0 deletions .changeset/web-steer-capslock-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

web: Fix Ctrl+S steering not triggering when CapsLock is on.
5 changes: 5 additions & 0 deletions .changeset/web-steer-queued-messages.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

web: Add "Steer now" buttons to the queued-message list to inject queued messages into the running turn — one message at a time or the whole queue from the queue header. Click the bolt button next to a queued message to steer it.
5 changes: 5 additions & 0 deletions .changeset/web-steer-telemetry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@moonshot-ai/kimi-code": patch
---

web: Count steered messages sent from the web UI in usage telemetry, the same way steers from the TUI are counted.
6 changes: 4 additions & 2 deletions AGENTS.md

Large diffs are not rendered by default.

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.1
v0.29.2-kkm.2
8 changes: 4 additions & 4 deletions 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.1",
"version": "0.29.2-kkm.2",
"description": "KKM, a portable Kimi Code fork with curated upstream fixes",
"license": "MIT",
"author": "Moonshot AI",
Expand Down Expand Up @@ -65,9 +65,9 @@
"test:native:smoke": "node scripts/native/smoke.mjs",
"dev": "node scripts/dev.mjs",
"dev:cli-only": "tsx --import ../../build/register-raw-text-loader.mjs ./src/main.ts",
"dev:server": "tsx --tsconfig ./tsconfig.dev.json --import ../../build/register-raw-text-loader.mjs ./src/main.ts web --no-open --debug-endpoints",
"dev:kap-server": "tsx --tsconfig ./tsconfig.dev.json --import ../../build/register-raw-text-loader.mjs ./src/main.ts web --no-open --debug-endpoints",
"dev:kap-server:multi": "tsx --tsconfig ./tsconfig.dev.json --import ../../build/register-raw-text-loader.mjs ./src/main.ts web --no-open --debug-endpoints",
"dev:server": "KIMI_CODE_DEV_SERVER=1 tsx --tsconfig ./tsconfig.dev.json --import ../../build/register-raw-text-loader.mjs ./src/main.ts web --no-open --debug-endpoints",
"dev:kap-server": "KIMI_CODE_DEV_SERVER=1 tsx --tsconfig ./tsconfig.dev.json --import ../../build/register-raw-text-loader.mjs ./src/main.ts web --no-open --debug-endpoints",
"dev:kap-server:multi": "KIMI_CODE_DEV_SERVER=1 tsx --tsconfig ./tsconfig.dev.json --import ../../build/register-raw-text-loader.mjs ./src/main.ts web --no-open --debug-endpoints",
"dev:server:restart": "node scripts/dev-server-restart.mjs",
"dev:plugin-marketplace": "node scripts/dev-plugin-marketplace-server.mjs",
"build:plugin-marketplace": "node scripts/build-plugin-marketplace-cdn.mjs",
Expand Down
2 changes: 1 addition & 1 deletion apps/kimi-code/scripts/dev-server-restart.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function start() {
console.error('[dev:server:restart] starting server…');
child = spawn(tsxBin, tsxArgs, {
cwd: APP_ROOT,
env: process.env,
env: { ...process.env, KIMI_CODE_DEV_SERVER: '1' },
// Server does not read stdin; keep ours free for the Enter trigger.
stdio: ['ignore', 'inherit', 'inherit'],
});
Expand Down
15 changes: 9 additions & 6 deletions apps/kimi-code/src/cli/experimental-v2.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
/**
* Experimental agent-core-v2 engine gate for `kimi -p` (print mode).
* Experimental agent-core-v2 engine gate for the CLI surfaces.
*
* When the master switch `KIMI_CODE_EXPERIMENTAL_FLAG` is truthy, print mode
* routes to the native agent-core-v2 runner instead of the default v1
* harness (see `run-prompt.ts`). Read directly from the env (matching
* When the master switch `KIMI_CODE_EXPERIMENTAL_FLAG` is truthy, `kimi -p`
* (print mode) routes to the native agent-core-v2 runner (see
* `run-prompt.ts`) and the interactive TUI builds its harness through the
* SDK's v2-backed client (see `run-shell.ts`), both instead of the default
* v1 engine. The master switch also enables every experimental feature flag
* in the engine. Read directly from the env (matching
* `cli/update/rollout.ts`) because the CLI must not depend on the core flag
* registry. Unset / any non-truthy value keeps the v1 harness.
* registry. Unset / any non-truthy value keeps the v1 path.
*
* Note: `kimi web` always boots kap-server (the agent-core-v2 engine
* server) — it no longer consults this switch.
* server) — it does not consult this switch.
*/

export const KIMI_V2_ENV = 'KIMI_CODE_EXPERIMENTAL_FLAG';
Expand Down
14 changes: 13 additions & 1 deletion apps/kimi-code/src/cli/run-prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ import {
import type { PromptHarness, PromptSession } from './prompt-session';
import { PromptJsonWriter, PromptTranscriptWriter, writeResumeHint } from './prompt-render';
import { createCliTelemetryBootstrap, initializeCliTelemetry } from './telemetry';
import {
createTelemetryShutdownDeadline,
formatTelemetryShutdownWarning,
} from './telemetry-shutdown';
import { createKimiCodeHostIdentity } from './version';

/**
Expand Down Expand Up @@ -162,7 +166,15 @@ export async function runPrompt(
try {
await restorePromptSessionPermission();
} finally {
await shutdownTelemetry({ timeoutMs: CLI_SHUTDOWN_TIMEOUT_MS });
const telemetryDeadline = createTelemetryShutdownDeadline(
CLI_SHUTDOWN_TIMEOUT_MS,
(error) => {
stderr.write(formatTelemetryShutdownWarning(error));
},
);
await telemetryDeadline.run((remainingMs) =>
shutdownTelemetry({ timeoutMs: remainingMs }),
);
await harness.close();
}
})());
Expand Down
13 changes: 11 additions & 2 deletions apps/kimi-code/src/cli/run-shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import { join } from 'node:path';

import {
createKimiHarness,
createKimiHarnessV2,
flushDiagnosticLogsSync,
log,
type KimiHarness,
type KimiHarnessOptions,
type TelemetryClient,
} from '@moonshot-ai/kimi-code-sdk';
import {
Expand All @@ -29,6 +31,7 @@ import { toTerminalHyperlink } from '#/utils/terminal-hyperlink';
import { restoreTerminalModes } from '#/utils/terminal-restore';

import type { CLIOptions } from './options';
import { isKimiV2Enabled } from './experimental-v2';
import { createCliTelemetryBootstrap, initializeCliTelemetry } from './telemetry';
import { createKimiCodeHostIdentity } from './version';

Expand Down Expand Up @@ -60,7 +63,7 @@ export async function runShell(
withContext: withTelemetryContext,
setContext: setTelemetryContext,
};
const harness = createKimiHarness({
const harnessOptions: KimiHarnessOptions = {
homeDir: telemetryBootstrap.homeDir,
identity: createKimiCodeHostIdentity(version),
skillDirs: opts.skillsDirs,
Expand All @@ -76,7 +79,13 @@ export async function runShell(
});
},
sessionStartedProperties: { yolo: opts.yolo, auto: opts.auto, plan: opts.plan, afk: false },
});
};
// Experimental agent-core-v2 route (same master switch as `kimi -p`): the
// harness is the SDK's v2-backed client, so the whole TUI runs on the
// agent-core-v2 engine.
const harness = isKimiV2Enabled()
? createKimiHarnessV2(harnessOptions)
: createKimiHarness(harnessOptions);
log.info('kimi-code starting', {
version,
uiMode: CLI_UI_MODE,
Expand Down
19 changes: 15 additions & 4 deletions apps/kimi-code/src/cli/sub/vis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,28 @@ export function registerVisCommand(parent: Command, overrides?: Partial<VisDeps>
sessionId: string | undefined,
options: { port?: string; host?: string; open?: boolean },
) => {
const port = options.port === undefined ? undefined : Number.parseInt(options.port, 10);
await handleVis(createDefaultVisDeps(overrides), {
open: options.open !== false,
...(port === undefined || Number.isNaN(port) ? {} : { port }),
...(options.host === undefined ? {} : { host: options.host }),
...(sessionId === undefined ? {} : { sessionId }),
port: parseVisPort(options.port),
host: options.host,
sessionId,
});
},
);
}

export function parseVisPort(raw: string | undefined): number | undefined {
if (raw === undefined) return undefined;
if (!/^\d+$/.test(raw)) {
throw new Error(`error: invalid --port value: ${raw}`);
}
const port = Number.parseInt(raw, 10);
if (!Number.isFinite(port) || port < 0 || port > 65535) {
throw new Error(`error: invalid --port value: ${raw}`);
}
return port;
}

function createDefaultVisDeps(overrides: Partial<VisDeps> = {}): VisDeps {
return {
getHomeDir: overrides.getHomeDir ?? (() => createCliTelemetryBootstrap().homeDir),
Expand Down
10 changes: 9 additions & 1 deletion apps/kimi-code/src/cli/sub/web/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@ export interface NetworkAddress {
*/
export function listNetworkAddresses(): NetworkAddress[] {
const raw: NetworkAddress[] = [];
for (const entries of Object.values(networkInterfaces())) {
let interfaces: ReturnType<typeof networkInterfaces>;
try {
interfaces = networkInterfaces();
} catch {
// Some restricted containers do not expose interface metadata. Network
// hints are optional, so keep the server usable and omit them.
return [];
}
for (const entries of Object.values(interfaces)) {
for (const info of entries ?? []) {
if (info.internal) {
continue;
Expand Down
Loading
Loading