-
Notifications
You must be signed in to change notification settings - Fork 179
ACP Support #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ACP Support #3
Conversation
Implements modular ACP integration for Mini-Agent, enabling communication with ACP-compatible clients like Zed over stdin/stdout using JSON-RPC. ## Features - Multiple concurrent sessions with isolated state - Real-time streaming updates (thoughts, messages, tool execution) - MiniMax-specific support (thinking blocks, tool format) - Modular architecture in mini_agent/acp/ directory ## Components - agent.py: ACP Agent implementation bridging to Mini-Agent - session.py: Session management for concurrent conversations - converter.py: Message format conversion (ACP ↔ Mini-Agent) - server.py: Entry point for ACP server mode ## Configuration - New CLI command: mini-agent-acp - Uses existing Mini-Agent configuration - Added agent-client-protocol>=0.1.0 dependency ## Documentation - Comprehensive README in mini_agent/acp/ - Updated main README with ACP section - Integration examples for Zed and other ACP clients Closes #<issue-number>
…1CV24tzSFTdCx1Jc9DHoxU feat: add Agent Client Protocol (ACP) support
…topReason values to enum-compliant (refusal, max_turn_requests, cancelled)\n- Use raw_input/raw_output and status with start/update_tool_call\n- Pass tool schemas to LLM, not tool objects\n- InitializeRequest protocolVersion compatibility patch (schema_fix)\n- Fallback logger path when HOME not writable\n- Offline-safe token counting fallback for file tools\n\nDocs:\n- Expand README and ACP README with Zed setup steps and config guidance\n\nChore:\n- Remove ignored local config with API key; ensure secrets not tracked
|
Thanks for you PR, our engineer will review it soon |
|
Thank you @0xSero for this comprehensive PR! |
Hello, I hear you it's definitely a lot. I am not insisting feel free to close this PR, I will maintain a version of this on my repo that's more complex. However I will note Zed has 150k monthly active users, and they only support Claude, GPT, and Gemini out the box. It's currently my favorite browser. Regardless, thank you for this example repo it's very nice to see how the agentic loop boils down. |
Add ACP Support with Zed Integration, Protocol Fixes, and Tool Streaming
Overview
Why
What’s Included
mini_agent/acp/server.py: stdio ACP server entry (mini-agent-acp), config/bootstrap.mini_agent/acp/agent.py: ACP Agent implementation with multi‑session, streaming, tool execution.mini_agent/acp/session.py: Session manager.mini_agent/acp/converter.py: Message/content conversion.mini_agent/acp/schema_fix.py: Monkeypatch to accept stringprotocolVersionfrom some clients (e.g., “1.0.0”).end_turn,max_tokens,max_turn_requests,refusal,cancelled.start_tool_call(...)andupdate_tool_call(...)withstatus,raw_input,raw_output, and content blocks.protocolVersion; InitializeRequest accepts string versions via monkeypatch.tool.to_schema()) to the LLM instead of Tool objects.mini_agent/logger.py: Fallback log path in CWD when HOME is not writable.mini_agent/tools/file_tools.py: Offline-safe token counting fallback iftiktokenisn’t available.config.yaml.README.md: Detailed Zed integration steps (using absolute venv path), version verification wrapper, and configuration search order.mini_agent/acp/README.md: Expanded “With Zed” section, config locations, and explicit statement of ACP stopReason compliance.How To Test
pytest -q(44 passed, 3 skipped in local run).mini-agent-acpand connect an ACP client over stdio.python -m acp.examples.client mini-agent-acp./absolute/path/to/venv/bin/mini-agent-acp/bin/bash-lc,echo 'mini-agent:' $(python -c 'import importlib.metadata as m; print(m.version("mini-agent"))') 'at' $(python -c 'import mini_agent; print(mini_agent.__file__)') >&2; exec /absolute/path/to/venv/bin/mini-agent-acpin_progress→completed|failed) withraw_inputandraw_output.Compatibility
mini-agent).mini-agent-acp.Known Limitations
loadSessionandsetSessionModenot implemented.Notes For Reviewers
Changelog
tiktokenencoder unavailable.How To Roll Back
mini-agent-acpentrypoint andmini_agent/acp/*.mini_agent/acp/agent.py,mini_agent/acp/server.py,mini_agent/config.py,mini_agent/tools/file_tools.py,mini_agent/logger.py, and the README updates.