fix(registry): carry api_protocol/default_model through _acpx_wrap#331
Merged
Conversation
_acpx_wrap built a new AgentConfig for acpx-wrapped agents but dropped api_protocol and default_model from the underlying config. PR #322 caches that wrapped config into AGENTS, and resolve_provider_env reads AGENTS[agent].api_protocol to pick provider endpoints. Cached entries like acpx:claude-agent-acp got api_protocol="", so multi-endpoint providers (e.g. zai) fell back to the provider default protocol instead of the agent-required one, routing acpx/<agent> to the wrong base URL. Carry api_protocol and default_model through the wrapper. The acpx wrapper only legitimately overrides name/install_cmd/launch_cmd; every other AgentConfig field now passes through. Add regression tests in test_agent_spec.py.
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.
Bug F —
_acpx_wrapdropsapi_protocol/default_modelAddresses an unaddressed review-bot comment (Codex P1 + Cursor High) on merged PR #322.
Problem
_acpx_wrapinsrc/benchflow/agents/registry.pybuilds a newAgentConfigfor theacpx:-wrapped agent but does not carry overapi_protocol(ordefault_model) from the underlying agent config. PR #322 caches that wrapped config intoAGENTS.Provider routing reads
AGENTS[agent].api_protocolinresolve_provider_envto pick endpoints. Cached entries likeacpx:claude-agent-acpgotapi_protocol="", so multi-endpoint providers (e.g.zai, which has both OpenAI and Anthropic endpoints) fell back to the provider default protocol instead of the agent-required one — routingacpx/<agent>to the wrong base URL/protocol.Confirmed live on
main:resolve_agent_key("acpx/claude-agent-acp")yields a cached config withapi_protocol=''while the underlyingclaude-agent-acphasapi_protocol='anthropic-messages'.Fix
_acpx_wrapnow carriesapi_protocolanddefault_modelthrough. The acpx wrapper only legitimately overridesname,install_cmd, andlaunch_cmd(protocolstays"acp"since acpx itself speaks ACP); every otherAgentConfigfield passes through from the underlying agent.Tests
Two regression tests added to
tests/test_agent_spec.py(docstrings name PR #322 per AGENTS.md):test_acpx_wrap_carries_routing_fields— audits the full field set passes through.test_acpx_cached_config_keeps_api_protocol— the cachedacpx:runtime key exposes the underlyingapi_protocol.CI gate: ruff format, ruff check, ty check, full pytest (1312 passed) all green.
Note
Medium Risk
Moderate risk because it changes how
acpx/agent configs are materialized/cached inAGENTS, which affects provider endpoint selection and runtime behavior for wrapped agents; scope is small and covered by targeted regression tests.Overview
Fixes
acpx-wrapped agent configs so they inherit routing-critical fields from the underlyingAgentConfigwhen_acpx_wrapbuilds the wrapped entry._acpx_wrapnow carries throughapi_protocolanddefault_model(in addition to existing pass-through fields), preventing cachedacpx:entries from losing endpoint/protocol hints used during provider resolution. Adds regression tests asserting the wrapped config and the cachedacpx:runtime key preserve these fields and other non-overridden attributes.Reviewed by Cursor Bugbot for commit 77ab385. Bugbot is set up for automated code reviews on this repo. Configure here.