Skip to content
This repository was archived by the owner on Sep 23, 2026. It is now read-only.
This repository was archived by the owner on Sep 23, 2026. It is now read-only.

ACP terminal tool fails with 'module acp has no attribute TerminalHandle' in v1.17 & v1.18 #1380

Closed

Description

@gp3t1

What version of Kimi Code CLI is running?

kimi, version 1.18.0

Which open platform/subscription were you using?

moonshot.ai

Which model were you using?

kimi-k2.5 (thinking)

What platform is your computer?

Linux 6.18.12-1-MANJARO x86_64 unknown

What issue are you seeing?

When using kimi-cli (v1.17.0 or v1.18.0) as an ACP agent in Zed IDE, the terminal/shell tool fails with:
Error running tool: module acp has no attribute TerminalHandle.

The root cause is that kimi-cli v1.17+ depends on agent-client-protocol==0.8.0, where TerminalHandle was removed from the public API (per ACP SDK migration guide / changelog).

However, the code in src/kimi_cli/acp/tools.py still uses it:

terminal: acp.TerminalHandle | None = None
assert isinstance(term, acp.TerminalHandle)

What steps can reproduce the bug?

  1. Install kimi-cli with Zed's ACP registry (which pins latest → currently 1.18.0)
  2. Create a new agent thread in Zed using Kimi CLI.
  3. Ask the agent to run any shell command (e.g., "Run git log --oneline -6 in the terminal").
  4. Observe failure in ACP logs (dev: open acp logs) with the exact error above.

Example failing tool call payload from logs:

...
{
  "sessionId": "e08a18f9-49c7-4d40-ba11-b11e625ad122",
  "command": "git log --oneline -6",
  "outputByteLimit": 50000
}
{
  "terminalId": "edb98742-9bb3-444d-a2bd-71c5fb5b2837"
}
{
  "sessionId": "e08a18f9-49c7-4d40-ba11-b11e625ad122",
  "update": {
    "sessionUpdate": "tool_call_update",
    "toolCallId": "b27673b8-7c6f-416e-ad81-8dac1993e233/Shell:0",
    "status": "failed",
    "content": [
      {
        "type": "content",
        "content": {
          "type": "text",
          "text": "Error running tool: module acp has no attribute TerminalHandle"
        }
      }
    ]
  }
}
...

What is the expected behavior?

  • The terminal tool should execute successfully
  • Status returns "success" in the tool call update.
  • No AttributeError on acp.TerminalHandle.

Additional information

  • Downgrading to kimi-cli==1.16.0 fixes the issue completely (aligns with acp 0.7.0).
  • Zed uses agent-client-protocol==0.9.4 (with unstable features), which should support the new terminal_id pattern.
  • Zed's ACP registry installs the latest kimi-cli (currently 1.18.0), forcing users into the broken version unless they use a custom agent config.
  • No public issues yet on kimi-cli or zed-industries/zed specifically mentioning "TerminalHandle" or this exact error (as of March 10, 2026).

Activity

  1. added
    bug
    on Mar 10, 2026
  2. mozhewen commented on Mar 11, 2026

    @mozhewen

    Still not work in 1.19.0

  3. added a commit that references this issue on Mar 11, 2026
    9e38a6c
  4. try-works commented on Mar 19, 2026

    @try-works

    I want to bump this issue because the failing terminal tool is causing Kimi to fail on tasks when called as a sub-agent

  5. Br1an67 commented on Mar 20, 2026

    @Br1an67

    The root cause is that acp.TerminalHandle was removed in agent-client-protocol >= 0.8.0 (per the migration guide), but tools.py and kaos.py still reference it for type annotations and runtime assertions.

    Fix in #1524: adds a lightweight local TerminalHandle adapter in acp/terminal.py that wraps the raw Client.wait_for_terminal_exit(), Client.terminal_output(), Client.kill_terminal(), and Client.release_terminal() methods behind the same interface. All 21 ACP tests pass.

  6. gp3t1 commented on Mar 20, 2026

    @gp3t1
    Author

    I tested PR #1400 locally and it resolves the problem on my setup.

    @RealKai42 Could you share your thoughts on this approach?
    Is this aligned with the expected ACP usage going forward?

    Happy to help test, if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions