claude-agent-service/tests
Viktor Barzin 7baa66d994 openai-compat: pass --model from request through to claude -p
Replaces the MODEL_TO_AGENT dict (which only mapped model -> agent and
ignored the model itself) with a SUPPORTED_MODELS allowlist + per-request
--model CLI flag. Callers can now pick Haiku/Sonnet/Opus per request to
control cost; unknown model IDs 400 with the supported list; missing
model defaults to claude-sonnet-4-6 (mid-tier).

The --model CLI flag overrides whatever model: is in the agent's
frontmatter, so recruiter-triage's `model: sonnet` no longer pins
every request to Sonnet.

Verified with claude CLI 2.1.153 that the bare-form IDs
(claude-haiku-4-5, claude-sonnet-4-6, claude-opus-4-7) are accepted
without date suffixes — confirmed via modelUsage keys in the JSON
output.

Six new tests cover: default routing, haiku/sonnet/opus pass-through,
unsupported-model 400 shape, and the response.model echo.
2026-06-01 19:33:54 +00:00
..
__init__.py Initial extraction from monorepo 2026-05-07 17:07:12 +00:00
conftest.py Initial extraction from monorepo 2026-05-07 17:07:12 +00:00
test_main.py Initial extraction from monorepo 2026-05-07 17:07:12 +00:00
test_openai_compat.py openai-compat: pass --model from request through to claude -p 2026-06-01 19:33:54 +00:00