KB / Memory / tech-oma-bare-claude-gateway-rewrite
OMA env-fallback Claude uses anyrouter/free on AnyRouter
Bare claude-* rewrites to anthropic/claude-*; AnyRouter env-fallback sonnet sends anyrouter/free on both OpenAI and Anthropic wire paths (not dotted BYOK 4.6)
On the OpenAI-compatible / AnyRouter env-fallback path, OMA rewrites bare claude-* model handles to anthropic/claude-* (hyphens kept). Prefixed ids and non-Claude handles are unchanged.
AnyRouter aliases hyphenated anthropic/claude-sonnet-4-6 onto dotted BYOK-only anthropic/claude-sonnet-4.6, which 404s model_unavailable. Env-fallback therefore sends the live non-BYOK catalog id anyrouter/free for those sonnet handles.
wireModelIdFor remaps both openai.chat(...) and anthropic(...) when baseURL is AnyRouter (#455 covered OpenAI only; #457 closed the Anthropic /messages hole where SessionDO with ANTHROPIC_API_KEY still POSTed bare sonnet and would strip a mapped anyrouter/free to free). OpenRouter and direct Anthropic stay unchanged. After #457, spans and [provider.fetch] 4xx logs report the HTTP wire model (LanguageModel.modelId / request_model=), not only the agent handle.
Why: Hyphen rewrite alone still hit BYOK-only dotted aliases; OpenAI-only remap left the default ant /messages path broken on live.
How to apply: Prefer bare claude-sonnet-4-6 (seeded General) or anyrouter/free on gateway fallback. Recert a new General session after agent-worker deploy: span.model_request_start.model and request_model= must be anyrouter/free, and AnyRouter must not 404 dotted 4.6.
Shipped in duyet/oma #439 + #453 + #455 + #457. Hub: project-open-managed-agents.
Sources