Skip to content

Releases: yazelin/claude-code-acp-py

v0.5.1

Choose a tag to compare

@yazelin yazelin released this 19 Mar 08:23

Fix

  • Pass authentication headers for HTTP/SSE MCP servers (fixes GitHub MCP integration)

v0.5.0

Choose a tag to compare

@yazelin yazelin released this 25 Feb 07:03

What's New

on_tool_input_transform callback

New ClaudeClient callback for framework-level tool input transformation. Called after permission is granted, before tool execution.

Use case: Inject parameters (e.g., user identity) into MCP tool calls at the framework level, independent of LLM behavior.

client = ClaudeClient(cwd=".")

@client.on_tool_input_transform
async def inject_user(tool_name: str, tool_input: dict) -> dict | None:
    if tool_name.startswith("mcp__my-server__"):
        return {**tool_input, "user_id": current_user_id}
    return None  # keep original

Key properties:

  • Leverages claude_agent_sdk's native PermissionResultAllow(updated_input=...) support
  • Framework-controlled: LLM cannot manipulate injected values
  • Backward compatible: no changes to existing on_permission callback
  • Does not affect AcpClient or external ACP client connections

Full Changelog: v0.4.4...v0.5.0

v0.4.4 - Proper session lifecycle management

Choose a tag to compare

@yazelin yazelin released this 11 Feb 09:36

What's Changed

Fix: Unclosed client sessions

Added proper lifecycle management to ClaudeAcpAgent and ClaudeClient to prevent unclosed subprocess connections (and associated aiohttp session warnings).

New methods:

  • ClaudeAcpAgent.close() / close_session(session_id) — properly disconnects ClaudeSDKClient instances
  • ClaudeClient.close() — delegates to agent cleanup
  • Both now support async with context manager for automatic cleanup

Usage:

# Recommended: async context manager
async with ClaudeClient(cwd=".") as client:
    response = await client.query("Hello")

# Or manual cleanup
client = ClaudeClient(cwd=".")
try:
    response = await client.query("Hello")
finally:
    await client.close()

Also:

  • run() entry point now ensures agent.close() on shutdown via try/finally
  • Updated README examples to use async with pattern
  • Added unit tests for lifecycle methods

v0.4.3

Choose a tag to compare

@yazelin yazelin released this 09 Feb 02:22

Fix

  • input_tokens 計算改為加總 input_tokens + cache_creation_input_tokens + cache_read_input_tokens,反映完整的 token 使用量
  • on_result callback info 新增 usage 欄位,傳遞原始 usage dict

v0.4.2

Choose a tag to compare

@yazelin yazelin released this 08 Feb 11:36

Bug Fix

  • fix: StreamReader has no close() method — only close stdin (StreamWriter) on disconnect, skip stdout/stderr (StreamReader)

v0.4.1 - Subprocess Cleanup Fix

Choose a tag to compare

@yazelin yazelin released this 06 Feb 14:33

v0.4.1

Fix

  • Close subprocess stdin/stdout/stderr pipes in AcpClient.disconnect() to prevent RuntimeError: Event loop is closed during garbage collection

This error occurred when the ACP agent process (e.g. Gemini) was slow to terminate and had to be force-killed. The orphaned subprocess transport would then trigger the error during GC after the event loop had already closed.

v0.4.0 - AvailableCommands & Models Support

Choose a tag to compare

@yazelin yazelin released this 05 Feb 08:27

What's New

Features

  • AvailableCommandsUpdate: Now sends available slash commands to ACP clients after session creation
  • SessionModelState: Returns available models (default/Opus, Sonnet, Haiku) in NewSessionResponse

Technical Details

  • Uses get_server_info() from Claude SDK to fetch commands and models
  • Filters unsupported commands (cost, login, logout, etc.)
  • Handles MCP commands with proper naming convention

This brings feature parity with the TypeScript implementation for model and command discovery.

v0.3.9 - Test Framework & MCP Fix

Choose a tag to compare

@yazelin yazelin released this 05 Feb 04:00

What's New

Test Framework

  • Add pytest test framework with 72 tests (55 unit + 17 integration)
  • Add pytest-asyncio, pytest-cov, pytest-timeout dependencies
  • Add Makefile for convenient test commands

Bug Fixes

  • Fix MCP server dynamic loading with --strict-mcp-config flag

Usage

# Run all tests
make test

# Run only unit tests (fast)
make test-unit

# Run integration tests
make test-integration

v0.3.8 - All Backends Model Support Verified

Choose a tag to compare

@yazelin yazelin released this 04 Feb 19:18

Model Parameter Support - All Backends Verified ✅

Backend Method Status
claude-code-acp ACP set_session_model ✅ opus, sonnet
Gemini CLI --model ✅ gemini-2.0-flash, gemini-2.5-flash, etc.
Copilot CLI --model + ACP ✅ See supported models below

Copilot Supported Models

claude-sonnet-4.5, claude-haiku-4.5, claude-opus-4.5, claude-sonnet-4
gemini-3-pro-preview
gpt-5.2-codex, gpt-5.2, gpt-5.1-codex-max, gpt-5.1-codex, gpt-5.1, gpt-5
gpt-5.1-codex-mini, gpt-5-mini, gpt-4.1

Install

pip install git+https://github.com/yazelin/claude-code-acp-py.git@v0.3.8

v0.3.7 - Model Parameter Support

Choose a tag to compare

@yazelin yazelin released this 04 Feb 19:10

Features

  • Model parameter now works for all backends:
    • claude-code-acp: via ACP set_session_model method (opus/sonnet)
    • Gemini: via CLI --model argument (gemini-2.0-flash, gemini-2.5-flash, etc.)
    • Copilot: via CLI --model argument (gpt-4, gpt-4o, etc.)

Fixes

  • Enable use_unstable_protocol=True to support set_session_model ACP method
  • Add _pending_model mechanism in AcpClient to apply model after session creation
  • Pass model as CLI argument for backends that don't support ACP method

Debug

  • Add ACP_PROXY_LOG_FILE environment variable for proxy debugging

Install

pip install git+https://github.com/yazelin/claude-code-acp-py.git@v0.3.7