feat(kimi-code): add ACP server support#239
Draft
robinfai wants to merge 1 commit into
Draft
Conversation
🦋 Changeset detectedLatest commit: 797d9ea The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Related Issue
Closes #133
Problem
See linked issue.
Kimi Code did not expose an ACP server entry point, so ACP-capable clients could not start, authenticate, create sessions, stream prompt turns, or use Kimi Code session capabilities through the Agent Client Protocol.
What changed
Adds a
kimi acpstdio server backed by@agentclientprotocol/sdk.Implemented ACP support for:
initializeauthenticatesession/newsession/promptsession/cancelsession/closesession/listsession/resumesession/forksession/set_modelThe ACP bridge maps prompt content, assistant/thinking/tool updates, tool permission requests, configured models, and session-scoped MCP servers into the existing Kimi Code SDK/session flow. ACP-provided MCP servers are passed through create/resume/fork session paths, with stdio and HTTP transports supported.
Unsupported ACP inputs such as audio prompt blocks,
additionalDirectories,session/listcursors, SSE MCP servers, and ACP-transport MCP servers returninvalid_paramsinstead of silently degrading.Also included:
kimi acp@moonshot-ai/kimi-codeand@moonshot-ai/kimi-code-sdkACP Compatibility Validation
Validated supported behavior:
initializereturns Kimi Code agent metadata, auth methods, prompt image/context capabilities, HTTP MCP support, and sessionclose/list/resume/forkcapabilities.authenticatechecks existing Kimi Code config, configured model/provider state, OAuth readiness, model-env configuration, and terminal auth availability when the ACP client supports it.session/new,session/prompt,session/cancel, andsession/closeare covered.session/list,session/resume, unstablesession/fork, and unstablesession/set_modelare covered.Intentional MVP boundaries:
invalid_paramsadditionalDirectoriesreturnsinvalid_paramssession/listcursor pagination returnsinvalid_paramsinvalid_paramsinvalid_paramsValidation performed:
pnpm run lintpassed with 0 errors; existing repository warnings remain.pnpm run typecheckpassed.pnpm testpassed.tsdownbuild forapps/kimi-codepassed.MoonshotAI/kimi-code/mainpassed with no conflicts.mainpassedpnpm run lint,pnpm run typecheck, andpnpm test.changeset status --since upstream/mainreports minor bumps for@moonshot-ai/kimi-codeand@moonshot-ai/kimi-code-sdk.Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.