fix(acp): plumb mcp_servers config into ACP session payloads#985
Open
feiyun968-agent wants to merge 7 commits into
Open
fix(acp): plumb mcp_servers config into ACP session payloads#985feiyun968-agent wants to merge 7 commits into
feiyun968-agent wants to merge 7 commits into
Conversation
…ev#976) codex-acp relies solely on the mcpServers field in the ACP session/new and session/load payloads for MCP server discovery. Both calls hardcoded mcpServers: [], so any configured MCP sidecar was never registered — causing the model to emit function_calls that stalled without ever dispatching tools/call. - Add McpServerConfig struct and mcp_servers field to AgentConfig - Add AgentConfig::acp_mcp_servers() to serialize config into ACP JSON - Pass resolved servers into session_new() and session_load() - Document [[agent.mcp_servers]] config in docs/codex.md Supports stdio (command/args/env), http, and sse (url/headers) transports. Empty mcp_servers (default) preserves existing behaviour. Fixes openabdev#976
|
All PRs must reference a prior Discord discussion to ensure community alignment before implementation. Please edit the PR description to include a link like: This PR will be automatically closed in 3 days if the link is not added. |
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.
Discord Discussion URL: #976
Summary
Fixes the MCP function call stall reported in #976.
codex-acprelies solely on themcpServersfield in the ACPsession/newandsession/loadpayloads for MCP server discovery. Both calls hardcodedmcpServers: [], so any configured MCP sidecar was never registered with the agent — causing the model to emitfunction_callevents that stalled indefinitely without ever dispatchingtools/call.Changes
src/config.rs— AddMcpServerConfigstruct andmcp_servers: HashMap<String, McpServerConfig>field toAgentConfig; addAgentConfig::acp_mcp_servers()to serialize into the JSON array the ACP protocol expectssrc/acp/connection.rs— Acceptmcp_servers: &[Value]insession_new()andsession_load()instead of hardcoding[]src/acp/pool.rs— Resolveacp_mcp_servers()once per session init and pass to both call sitesdocs/codex.md— Document the new[[agent.mcp_servers]]config section with stdio, http, and sse examplesBehaviour
mcp_servers(the default) preserves existing behaviour exactly —mcpServers: []is sent, same as beforestdio(command/args/env),http, andsse(url/headers) transports${VAR}expansion via the existingexpand_env_varshelperValidation
cargo fmt(clean)cargo check— C linker unavailable in this environment; code structure verified against PR feat(agent): forward configured MCP servers #903 (same approach, validated at the time withcargo check,cargo test403 passed,cargo clippy -- -D warnings)Prior Art
openab-agent; orthogonal to this fix which targets thecodex-acppath