fix: replace removed acp.TerminalHandle with local adapter#1524
Closed
Br1an67 wants to merge 1 commit intoMoonshotAI:mainfrom
Closed
fix: replace removed acp.TerminalHandle with local adapter#1524Br1an67 wants to merge 1 commit intoMoonshotAI:mainfrom
Br1an67 wants to merge 1 commit intoMoonshotAI:mainfrom
Conversation
acp.TerminalHandle was removed in agent-client-protocol >= 0.8.0,
causing 'module acp has no attribute TerminalHandle' when the shell
tool runs under ACP (e.g. Zed IDE).
Adds acp/terminal.py with a lightweight TerminalHandle dataclass that
wraps the raw Client.{wait_for_terminal_exit, terminal_output,
kill_terminal, release_terminal} methods behind the same interface.
Updates tools.py and kaos.py to use the new adapter.
This was referenced Mar 20, 2026
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
Resolve #1380
Description
Since
agent-client-protocol >= 0.8.0, theacp.TerminalHandleconvenience class was removed from the SDK (migration guide). This causes:when Kimi CLI is used as an ACP agent (e.g. in Zed IDE) and the shell tool attempts to run a command.
Root cause:
tools.pyandkaos.pyreferenceacp.TerminalHandlefor type annotations and runtime assertions, but the class no longer exists in the current ACP SDK.Fix: Added
acp/terminal.pywith a lightweightTerminalHandledataclass adapter that wraps the rawacp.Clientterminal methods (wait_for_terminal_exit,terminal_output,kill_terminal,release_terminal) behind the same interface. Bothtools.pyandkaos.pynow import from this local adapter instead of from theacppackage.Changes:
src/kimi_cli/acp/terminal.py—TerminalHandleadapter +create_terminal()factorysrc/kimi_cli/acp/tools.py— uses new adapter, removes broken assertionsrc/kimi_cli/acp/kaos.py— updated type annotationChecklist
make gen-changelogto update the changelog.make gen-docsto update the user documentation.