Skip to content

feat(acp): add Kimi Code ACP provider#1135

Open
taoyongac wants to merge 4 commits intoslopus:mainfrom
taoyongac:feat/kimi-acp-provider
Open

feat(acp): add Kimi Code ACP provider#1135
taoyongac wants to merge 4 commits intoslopus:mainfrom
taoyongac:feat/kimi-acp-provider

Conversation

@taoyongac
Copy link
Copy Markdown

@taoyongac taoyongac commented Apr 19, 2026

Summary

Adds support for Kimi Code CLI as a first-class ACP agent, so users can run happy acp kimi alongside the existing gemini / opencode providers.

Changes

  • Kimi ACP agentKNOWN_ACP_AGENTS['kimi']kimi acp; factory at agent/factories/kimi.ts; KIMI_API_KEY env 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() in runAcp.ts — replaces the hardcoded DefaultTransport so happy acp <agent> selects geminiTransport / kimiTransport / DefaultTransport by name. Without this, happy acp kimi would have gotten generic transport handling.
  • --yolo flag for happy acp — mirrors the Claude shortcut; auto-approves all tool calls via GenericAcpPermissionHandler. Also accepts --dangerously-skip-permissions.
  • Runtime toggle — send /bypass (or /yolo) to turn YOLO on, /ask (or /default) to turn off. Mobile permissionMode meta (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 a KNOWN_ACP_AGENTS entry, happy acp kimi launched 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 + /bypass gives parity.

Tested

  • npm run build (tsc --noEmit + pkgroll) clean on Linux/Node.
  • End-to-end: happy acp kimi on a Linux server, connected from Happy mobile — status startingidle, slash commands + models list delivered, tool calls execute under --yolo without prompting.
  • KimiTransport.test.ts covers stdout JSON filter, stderr 401/429 detection, tool-pattern resolution.

Notes

  • Requires kimi CLI in PATH (install per Kimi CLI docs).
  • No breaking changes: existing happy acp gemini / happy acp opencode / happy acp -- <cmd> paths preserved.

taoyongac and others added 3 commits April 19, 2026 18:09
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.
@taoyongac taoyongac changed the title feat: add Kimi Code ACP provider support feat(acp): add Kimi Code ACP provider Apr 19, 2026
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.
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.

1 participant