Skip to content

feat(native-chat): run Kimi Code in Chat over its ACP server - #41661

Merged
AmoabaKelvin merged 2 commits into
mainfrom
support-for-kimi-in-native-chat
Nov 12, 2026
Merged

AmoabaKelvin merged 2 commits into
mainfrom
support-for-kimi-in-native-chat

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

Kimi Code can now run as a chat in Orca, not only in a terminal. Kimi ships its own chat server (kimi acp), so Orca talks to it the same way it already talks to Copilot, Grok and OpenCode.

Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​86 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​86
Prod 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​142 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​139

What Changed

Before, picking Kimi always opened a terminal. Now Kimi can open as a chat, with its own sign-in, model picker, permission modes, questions and /compact.

  • Launch. Chats run kimi acp with Kimi's own sign-in and KIMI_CODE_HOME, and with auto-update turned off so a staged update doesn't swap the binary under a running chat. Signed out, the chat shows the usual sign-in card with kimi login. Requires Kimi Code 2.5.0 or later: 2.5.0 fixed initialize failing when the first request arrives during startup.

  • Permissions. Kimi enforces its own modes, so Orca sets one at every start:

    • Ask for approval → Kimi's default
    • Approve for me → Kimi's yolo ("Ask When Needed": routine edits and commands run, risky commands still ask)
    • Full access → Kimi's auto ("Never Ask")

    Setting the mode is required. Without it, a default_permission_mode in Kimi's config.toml applies silently while the session still reports default. I reproduced this: with default_permission_mode = "auto" a command ran unasked, and after setting default it asked. Kimi's own ACP labels for auto and yolo are swapped relative to what its engine does; the mapping follows the engine.

  • Kimi dialect:

    • Bash results come back as one string ending in Command failed with exit code: N.; the dialect turns that into output plus an exit code.
    • While a call runs, Kimi sends its arguments as text; the dialect drops it so the arguments don't show as output.
    • Approval cards are titled with the bare tool name, so the dialect adds Kimi's action line (Running: rm -rf build) as the description.
    • Questions arrive as forms. Over the permission fallback, Kimi drops every question after the first.
  • Chat naming. Skipped for Kimi, as for Copilot: kimi --prompt saves every run, so naming runs would land in the user's Kimi history and in kimi --continue.

  • History. Chats and terminals share Kimi's session store and session_<uuid> ids, so kimi --session <id> / -S / -r / --continue resume lines are recognised.

Why

The issue asks for Kimi as a chat agent. Kimi maintains its own ACP server, so this is an ACP launch spec plus a small dialect, not an adapter. Mapping the chat's modes onto Kimi's own modes is the only way to make Ask mean Ask when the user's config says otherwise.

Linked Issue

Fixes #41592

Visual Proof

Before: Kimi only opened as a terminal. After, against Kimi Code 2.6.0 driven by a local fake model server:

Permission modes offered for a Kimi chat:
s7.png

Approval card names the command:
s16.png

Failed command shows its output and exit code:
s6.png

Two questions arrive as one form:
s12.png

/compact with instructions:
s22.png

Signed out:
s24.png

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below
  • Every added test fails without this change and avoids the test anti-patterns

On macOS, in a hidden dev build, with Kimi Code 2.6.0 from npm in a scratch KIMI_CODE_HOME. A fake OpenAI-compatible provider in Kimi's config.toml served the model, so the runs used no account and no spend. Checked:

  • A first turn, with the model pill and context ring.
  • Full access ran a command unasked. Ask for approval showed the card, and Approve once ran it. Approve for me ran echo unasked and asked before rm -rf in the home folder.
  • A failed command showed its output and exit 3.
  • A two-question form, with both answers reaching Kimi.
  • /compact keep the database choice, with the instruction reaching the model.
  • Switching modes mid-chat restarted Kimi on the same session.
  • Reopening after an app restart.
  • The signed-out sign-in card.

I also probed kimi acp directly for the config-mode override and session/delete. kimi-dialect.test.ts pins the recorded Bash result shapes and the approval description. Not tested: Windows, SSH hosts, and a real Kimi account.

Risk

The riskiest part is the permission mapping. If a future Kimi release changed what its mode ids mean, the modes would drift. Orca confirms the mode it set before the chat starts, and refuses to start if Kimi reports a different one. Nothing changes for terminal Kimi or for other agents. Backing out is a plain revert; existing Kimi chats would then stop opening as chats.

Level: Low

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

  • The install directory is ~/.kimi-code/bin (%USERPROFILE%\.kimi-code\bin on Windows), which Kimi's install scripts use.
  • Mobile reads the same permission-mode table, so phone chats get the same three modes.
  • Follow-ups not in this PR:
    • Kimi titles its own sessions (session_info_update), which could name chats without a naming run.
    • Resume a terminal Kimi session in chat (needs a transcript importer).

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds Kimi as a structured ACP agent. It introduces Kimi-specific tool-update normalization and permission-request presentation, configures and registers the Kimi launch specification, and adds Kimi permission modes and setup commands. It also excludes Kimi CLI runs from native chat-agent naming when the chat agent is used.

Merge Risk: Minimal · up to f3b85

Kimi Code chat support looks ready to merge. The module path that previously broke the host builds now resolves in source, though the builds themselves were not re-run.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "feat(native-chat): run Kimi Code in Chat over its ACP server" matches the main change. The PR adds a Kimi ACP launch spec, a Kimi dialect, permission-mode mapping, and chat naming exclusion…
Description check Passed The description follows the repository template closely. It has ELI5, What Changed, Why, Linked Issue (Fixes #41592), Visual Proof with before/after context and screenshots, Testing with manual steps …
Linked Issues check Passed Issue #41592 asks for Kimi Code CLI as a structured chat agent that uses the native ACP server (kimi acp) over stdio, without an adapter. The reviewed head implements this. KIMI_LAUNCH_SPEC in `sr…
Out of Scope Changes check Passed Each changed area supports the Kimi chat agent. The launch spec (kimi-acp-launch-spec.ts) and its registration in ACP_LAUNCH_SPECS (acp-launch-registry.ts) define the chat launch. The dialect an…
Full details: Title check

Explanation

The title "feat(native-chat): run Kimi Code in Chat over its ACP server" matches the main change. The PR adds a Kimi ACP launch spec, a Kimi dialect, permission-mode mapping, and chat naming exclusion so Kimi Code runs as a chat through kimi acp. The title is concise, single-sentence, and specific.

Full details: Description check

Explanation

The description follows the repository template closely. It has ELI5, What Changed, Why, Linked Issue (Fixes #41592), Visual Proof with before/after context and screenshots, Testing with manual steps and platforms tested, Risk with level and back-out plan, AI Disclosure, Review, Agent skill boundary, Notes, and Checklist. It explains the mechanism, the user-facing behavior, and the alternatives considered. Gaps: the Visual Proof 'Before' is described in text only, not as a switchable image pair. The Linked Issue is an existing issue. The AI Disclosure section is left as the template placeholder, and the lint/typecheck/test/build checklist item is unchecked, though the description notes CI may cover them.

Full details: Linked Issues check

Explanation

Issue #41592 asks for Kimi Code CLI as a structured chat agent that uses the native ACP server (kimi acp) over stdio, without an adapter. The reviewed head implements this. KIMI_LAUNCH_SPEC in src/main/kimi/kimi-acp-launch-spec.ts sets command: 'kimi' and args: () =&gt; ['acp'], and it sets dialect: KIMI_ACP_DIALECT. The spec sets minimumVersions: ['2.5.0'], a login command from agentSessionSetupFor('kimi'), and an account binding through KIMI_CODE_HOME. The permission mapping ask→default, auto→yolo, full-access→auto matches the PR description. The PR also adds KIMI_ACP_DIALECT (src/main/acp/acp-dialects/kimi-dialect.ts) for Bash result, streamed-argument, and approval-description handling. kimi-dialect.test.ts (+86 lines) covers these paths with automated tests. The non-coding items (vendor documentation, Kimi login flow, manual testing) need no code. Evidence limits: the incremental diff from the previous reviewed head could not be read, so changes since that head are assessed only from the supplied summary and the launch spec file at head. The previous PASS was preserved because the launch spec and summary remain consistent.

Full details: Out of Scope Changes check

Explanation

Each changed area supports the Kimi chat agent. The launch spec (kimi-acp-launch-spec.ts) and its registration in ACP_LAUNCH_SPECS (acp-launch-registry.ts) define the chat launch. The dialect and its tests implement the Kimi-specific tool-update and permission handling. agent-chat-permission-support.ts adds the ask, auto, and full-access modes for kimi, which the launch spec's permissionModeConfig maps. agent-session-setup-commands.ts adds the kimi login and install-script setup used by the launch spec. structured-chat-naming-runtime.ts excludes Kimi from naming runs, which matches the existing Copilot exclusion and avoids saving naming runs to Kimi history. The session-history rows in the launch spec use the shared Kimi session store, which the PR description requires for chats and terminals. No unrelated change is evident. Evidence limits: the incremental diff since the previous reviewed head could not be read, so this verdict relies on the supplied summary and the launch spec at head.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 351e6605-0eb7-41ea-94d7-53fa0a92a722
Commits

Reviewing files that changed from the base of the PR and between c601b5e and f3b85c6.

Files selected for processing: 1

  • src/main/kimi/kimi-acp-launch-spec.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 59ce5b9b-1347-451c-acc4-b746dcc629a2
Commits

Reviewing files that changed from the base of the PR and between 3cfdd60 and c601b5e.

Files selected for processing: 7

  • src/main/acp/acp-dialects/kimi-dialect.test.ts
  • src/main/acp/acp-dialects/kimi-dialect.ts
  • src/main/acp/launch/acp-launch-registry.ts
  • src/main/kimi/kimi-acp-launch-spec.ts
  • src/main/runtime/agent-session/naming/structured-chat-naming-runtime.ts
  • src/shared/agent-launch/permissions/agent-chat-permission-support.ts
  • src/shared/agent-session/lifecycle/agent-session-setup-commands.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

Comment thread src/main/kimi/kimi-acp-launch-spec.ts Resolved
Kimi chats launch `kimi acp` with Kimi's own sign-in and KIMI_CODE_HOME.
Orca sets Kimi's own permission mode at every start: Ask is Kimi's
default, Approve for me is its Ask When Needed mode, and Full access is
its Never Ask mode. Without that, a default_permission_mode in Kimi's
config.toml would apply while the session reports default.

A Kimi dialect reads Bash results as output and exit code, drops the
streamed arguments a running call shows as text, names the command or
path on approval cards, and takes questions as forms so every question
reaches the chat.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: add Kimi Code CLI as a structured (chat) agent — it has native ACP support via kimi acp

1 participant