feat(acp): Setup first ACP with mock agent#55
Merged
CSRessel merged 13 commits intofork/acp-with-geminifrom Nov 24, 2025
Merged
feat(acp): Setup first ACP with mock agent#55CSRessel merged 13 commits intofork/acp-with-geminifrom
CSRessel merged 13 commits intofork/acp-with-geminifrom
Conversation
…communication Adds full support for Agent Client Protocol (ACP) as a wire API option alongside existing Chat and Responses APIs. ACP enables subprocess-based agent communication over JSON-RPC 2.0 via stdin/stdout instead of HTTP requests. Core changes: - Add ACP agent registry (acp/src/registry.rs) mapping provider names to binary commands - Implement ModelClient::stream() for WireApi::Acp with event mapping to ResponseEvent - Add "mock-acp" and "gemini-acp" model families for proper model resolution - Configure mock-acp and gemini-acp providers with WireApi::Acp - Add comprehensive unit tests (8/8 passing) covering providers, registry, and model families Implementation follows existing Chat API patterns with subprocess spawning instead of HTTP. Event mapping: AcpEvent::TextDelta → ResponseEvent::OutputTextDelta, etc. Test coverage: - Unit tests: Provider configuration, model families, registry integration - Integration test: ModelClient streaming with mock-acp-agent binary - TUI test: Updated to use "mock-acp" model name (model resolution pending) Note: TUI integration test still needs model-name-to-provider-ID resolution work, tracked separately as it's a config loading concern rather than core ACP implementation. 🤖 Generated with [Nori](https://nori.ai) Co-Authored-By: Nori <noreply@tilework.tech>
Collaborator
Author
|
2nd in stack |
Add init_file_tracing() function to enable structured file logging for the ACP package. - Accepts custom log file path parameter - Filters at DEBUG level and above (TRACE excluded) - Uses non-blocking file appender for async-safe writes - Returns error on re-initialization (global subscriber constraint) - Includes comprehensive integration test - Updates package documentation 🤖 Generated with [Nori](https://nori.ai) Co-Authored-By: Nori <noreply@tilework.tech>
Add automatic initialization of ACP file tracing when the CLI starts. Logs are written to .codex-acp.log in the current working directory. - Add codex-acp dependency to cli/Cargo.toml - Call init_file_tracing() in cli_main() after CLI argument parsing - Log warning (non-fatal) if tracing initialization fails - Update acp/docs.md to document automatic CLI initialization This ensures ACP tracing is always available when using the codex CLI, without requiring manual initialization by library users. 🤖 Generated with [Nori](https://nori.ai) Co-Authored-By: Nori <noreply@tilework.tech>
…rary Replaces custom protocol.rs and transport.rs implementations with the official agent-client-protocol v0.7 library, eliminating ~250 lines of duplicative JSON-RPC code. Key changes: - Implement Client trait in new client_handler.rs for permission/session callbacks - Refactor AgentProcess to use ClientSideConnection instead of StdioTransport - Add tokio-util compat layer for AsyncRead/Write trait compatibility - Use LocalSet pattern throughout for handling !Send futures from the library - Replace custom JsonRpcRequest/Response with typed library requests - Update all tests to wrap in LocalSet contexts - Fix clippy warnings (unused variables, unwrap usage, error formatting) Benefits: - Type-safe protocol communication with compile-time validation - Spec-compliant implementation maintained by library authors - Reduced maintenance burden and code complexity - Better error handling with library-defined error types Breaking changes: - AgentProcess API updated with typed new_session() and prompt() methods - ClientEvent enum introduced for permission requests and session updates - Public API now exports library types instead of custom types 🤖 Generated with [Nori](https://nori.ai) Co-Authored-By: Nori <noreply@tilework.tech>
Add comprehensive JSON request/response logging for ACP protocol debugging: - Log initialize and new_session requests/responses with pretty-printed JSON - Change protocol version from V1 to V0 for Gemini compatibility - Fix client capabilities to use camelCase format with meta fields - Add retry configuration (2 retries) for ACP model providers - Increase log tail from 50 to 150 lines for better error diagnostics Switch integration tests to use mock-acp instead of gemini-acp for faster iteration during development. Note: Includes temporary debugging code (hardcoded mock-acp provider in client.rs) that should be reverted before merging.
Base automatically changed from
fork/playwright-for-tui
to
fork/acp-with-gemini
November 22, 2025 18:33
🤖 Generated with [Nori](https://nori.ai)\n\nCo-Authored-By: Nori <noreply@tilework.tech> Change the ACP registry to use model names for lookups instead of provider names. This separates the model identifier (what the user specifies) from the provider identifier (which agent subprocess to use). The provider field in AcpAgentConfig now uniquely identifies the agent subprocess, enabling future optimization to determine when an existing subprocess can be reused vs when a new one must be spawned when switching models. Changes: - Add provider field to AcpAgentConfig struct - Change get_agent_config() to accept model_name instead of provider_name - Update registry to map exact model names (e.g., "mock-model", "gemini-flash-2.0") to agent configurations - Fix client.rs WireApi::Acp to pass self.config.model to registry - Update all tests to use model names and verify provider field - Update documentation to reflect model-centric architecture The registry uses exact matching with case-insensitive normalization. Each model must be explicitly registered.
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.
No description provided.