fix(adapter): map persona-friendly slugs (claude-code, anthropic) to registry names #10
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/dispatch-alias-map-followup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Phase 4 verification of #9 surfaced an edge case: persona env files use friendlier slugs than the registry's canonical names, and the slug-detection path in
_resolve_model_and_provider_from_envonly matched verbatim.With MODEL_PROVIDER=claude-code (lead persona env) the slug check fell through, the YAML had no explicit provider, and the model-prefix matcher saw MODEL=MiniMax-M2.7 and routed the lead to MiniMax — even though CLAUDE_CODE_OAUTH_TOKEN was set and obviously meant to be used.
Fix
New
_PROVIDER_SLUG_ALIASESmap applied before the slug-vs-legacy detection:claude-code→anthropic-oauth(Claude Code subscription path)anthropic→anthropic-api(direct Anthropic API key path)Tests
test_persona_env_lead_with_minimax_model_routes_via_oauth— locks in the alias-map behavior so a future contributor can't silently re-introduce the lead-mis-routed-to-MiniMax bug.test_anthropic_alias_resolves_to_anthropic_api— covers the second alias path.test_persona_env_lead_claude_code_resolves_correctly— updated to assert the new (correct) behavior:provider == "anthropic-oauth", not None.Full adapter suite: 78/78 pass.