fix(wrapper): resolve built-in MCP defaults from the configured command, not the section name - #82
Open
Lafnaps wants to merge 1 commit into
Open
fix(wrapper): resolve built-in MCP defaults from the configured command, not the section name#82Lafnaps wants to merge 1 commit into
Lafnaps wants to merge 1 commit into
Conversation
…nd, not the section name
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.
Define a second instance of a known CLI under its own section — the setup multi-instance support invites:
and the wrapper injects no MCP config at all.
_resolve_mcp_inject()looks up_BUILTIN_DEFAULTS[agent]by the config section name, soclaude2misses the table. The agent launches fine, but without the agentchattr MCP server: no chat tools, never answers a mention, and nothing anywhere says why. Same story for codex/gemini/kimi/kilo under custom section names.The fix keys the defaults off what the section actually launches: take the basename of
command, strip.exe/.cmd/.bat, lowercase, and require an exact match against the defaults table. Deliberately no prefix or substring matching —command = "claude-compatible"or a wrapper script resolves to nothing rather than to the wrong provider. Explicitmcp_injectin the section still wins outright, and per-sectionmcp_*keys still overlay the resolved defaults, as before.This got more relevant with 0e8928e:
[agents.antigravity]launchingagyis exactly a section whose name differs from its executable (it works because it ships explicitmcp_*config; second instances defined by users don't get that treatment).Six new tests in
tests/test_identity_contract.py: a named claude section gets the claude flag defaults end-to-end through_build_provider_launch(writes the--mcp-configfile with bearer auth); a full-pathC:\Tools\codex.exeresolves the codex proxy defaults; a bareclaude.exeresolves; explicitmcp_injectbeats command-derived defaults; partialmcp_*keys merge over them; unknownclaude-compatibleresolves to{}.python -m pytest -q tests/test_identity_contract.py→ 24 passed. Full suite: 87 passed (81 on current main).