feat(acp): add Kimi Code ACP provider#1135
Open
taoyongac wants to merge 4 commits intoslopus:mainfrom
Open
Conversation
Kimi Code CLI now supports ACP protocol (`kimi acp`). This adds the full provider integration following the established Gemini pattern: - KimiTransport: stdout JSON filtering, stderr error detection (429/401), tool patterns (change_title, think), custom timeouts - Factory: createKimiBackend with KIMI_API_KEY env, auto-approve for change_title instructions - Config: kimi added to KNOWN_ACP_AGENTS and AgentId type - 31 tests passing (23 transport + 8 config) Ref: slopus#1114 Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
Add resolveTransport() to pick KimiTransport/GeminiTransport by agentName, replacing hardcoded DefaultTransport. Also register Kimi agent factory in initializeAgents().
Adds a --yolo CLI flag for `happy acp` (also accepts --dangerously-skip-permissions) that auto-approves all tool calls via GenericAcpPermissionHandler. Supports runtime toggling: /bypass or /yolo turns on, /ask or /default turns off. Mobile permissionMode meta (bypassPermissions/acceptEdits) also triggers yolo.
The runtime toggle was intercepting /yolo and /default, preventing them from reaching the underlying agent (e.g. Kimi has its own /yolo mode for conversational auto-approval). Keep /bypass and /ask as Happy-side toggles; let /yolo and /default flow to the agent.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for Kimi Code CLI as a first-class ACP agent, so users can run
happy acp kimialongside the existinggemini/opencodeproviders.Changes
KNOWN_ACP_AGENTS['kimi']→kimi acp; factory atagent/factories/kimi.ts;KIMI_API_KEYenv handling.KimiTransport— Kimi-specific stdout JSON filtering, 401/429 stderr detection, tool-pattern extraction (change_title,think), init/tool/think/idle timeouts. Unit tests included (KimiTransport.test.ts).resolveTransport()inrunAcp.ts— replaces the hardcodedDefaultTransportsohappy acp <agent>selectsgeminiTransport/kimiTransport/DefaultTransportby name. Without this,happy acp kimiwould have gotten generic transport handling.--yoloflag forhappy acp— mirrors the Claude shortcut; auto-approves all tool calls viaGenericAcpPermissionHandler. Also accepts--dangerously-skip-permissions./bypass(or/yolo) to turn YOLO on,/ask(or/default) to turn off. MobilepermissionModemeta (bypassPermissions/acceptEdits) also triggers it, so the Claude-style mobile mode selector works out of the box if/when exposed for ACP sessions.Motivation
Kimi Code CLI exposes an ACP server via
kimi acp(Kimi 1.36.0+). With just aKNOWN_ACP_AGENTSentry,happy acp kimilaunched but used generic transport, which mis-filtered stdout and didn't surface auth/rate-limit errors clearly. The dedicated transport + permission shortcut match the UX of the existing Claude path.The YOLO bits were motivated by mobile UX: ACP sessions don't surface Claude's permission-mode selector, so every tool call prompts on the phone.
--yolo+/bypassgives parity.Tested
npm run build(tsc --noEmit + pkgroll) clean on Linux/Node.happy acp kimion a Linux server, connected from Happy mobile — statusstarting→idle, slash commands + models list delivered, tool calls execute under--yolowithout prompting.KimiTransport.test.tscovers stdout JSON filter, stderr 401/429 detection, tool-pattern resolution.Notes
kimiCLI in PATH (install per Kimi CLI docs).happy acp gemini/happy acp opencode/happy acp -- <cmd>paths preserved.