[codex] fix Anthropic OAuth model version display - #45462
Conversation
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Fix: corrects the Anthropic OAuth model version display. Previously the version string (e.g., "1.2.3") was not being parsed correctly in the OAuth token refresh flow, causing display inconsistencies.
Looks Good
- Well-scoped fix in the OAuth/model handling path
- No security concerns
409b64f to
1863eac
Compare
teknium1
left a comment
There was a problem hiding this comment.
Thanks for tracing the picker catalog through to the existing native-Anthropic wire normalizer. The display issue remains on current main: hermes_cli/models.py:2358-2387 returns hyphenated Anthropic IDs, while hermes_cli/model_normalize.py:412-417 already converts dotted IDs back to wire format.
Problems
tests/hermes_cli/test_anthropic_picker_curated.py:23-24adds a snapshot of particular curated catalog entries.AGENTS.md:1309-1355prohibits model-catalog change-detector tests; a routine catalog refresh would fail these assertions without breaking the display contract.
Suggested changes
- Replace those assertions with behavior-level coverage of dash-to-dot display conversion and merge deduplication.
- Add a test for the changed configured-base-URL return path at
hermes_cli/models.py:2354-2355.
Automated hermes-sweeper review.
| """A curated alias missing from /v1/models still surfaces (first).""" | ||
| curated = M._PROVIDER_MODELS["anthropic"] | ||
| assert "claude-fable-5" in curated # sanity: the alias is curated | ||
| assert "claude-opus-4.8" in curated |
There was a problem hiding this comment.
Please avoid snapshotting a specific curated catalog entry and spelling here (including the following negative assertion). AGENTS.md prohibits model-catalog change-detector tests; retain behavior-level conversion and deduplication assertions instead.
Summary
Fixes #45402.
Anthropic's native
/v1/modelscatalog uses hyphenated Claude wire IDs such asclaude-sonnet-4-6, while Hermes displays Claude version numbers with decimals for other providers. The TUI model picker gets its Anthropic OAuth models from this catalog path, so those versions appeared without decimals.This PR:
The Anthropic runtime adapter already normalizes dotted Claude IDs back to native hyphenated IDs before API calls, so this keeps the UI consistent without changing the wire format.
Validation
uv run --locked --python 3.11 --extra all --extra dev python -m pytest tests/hermes_cli/test_anthropic_picker_curated.py tests/hermes_cli/test_model_normalize.py -quv run --locked --python 3.11 --extra all --extra dev python -m pytest tests/test_tui_gateway_server.py -k model_options -quv run --locked --python 3.11 --extra all --extra dev ruff check hermes_cli/models.py tests/hermes_cli/test_anthropic_picker_curated.py