Skip to content

[codex] fix Anthropic OAuth model version display - #45462

Open
yu-xin-c wants to merge 2 commits into
NousResearch:mainfrom
yu-xin-c:codex/fix-anthropic-oauth-model-decimals
Open

[codex] fix Anthropic OAuth model version display#45462
yu-xin-c wants to merge 2 commits into
NousResearch:mainfrom
yu-xin-c:codex/fix-anthropic-oauth-model-decimals

Conversation

@yu-xin-c

Copy link
Copy Markdown
Contributor

Summary

Fixes #45402.

Anthropic's native /v1/models catalog uses hyphenated Claude wire IDs such as claude-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:

  • updates the curated Anthropic model list to use decimal display IDs where the Claude version has a minor component
  • normalizes live Anthropic model IDs into the same display form before merging them with curated models
  • dedupes live hyphenated IDs against curated decimal IDs so the picker does not show both forms

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 -q
  • uv run --locked --python 3.11 --extra all --extra dev python -m pytest tests/test_tui_gateway_server.py -k model_options -q
  • uv run --locked --python 3.11 --extra all --extra dev ruff check hermes_cli/models.py tests/hermes_cli/test_anthropic_picker_curated.py

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard provider/anthropic Anthropic native Messages API P3 Low — cosmetic, nice to have labels Jun 13, 2026
@yu-xin-c
yu-xin-c marked this pull request as ready for review June 23, 2026 15:16
@yu-xin-c
yu-xin-c force-pushed the codex/fix-anthropic-oauth-model-decimals branch from 409b64f to 1863eac Compare June 24, 2026 17:37

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-24 adds a snapshot of particular curated catalog entries. AGENTS.md:1309-1355 prohibits 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have provider/anthropic Anthropic native Messages API sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Anthropic OAuth provider models have no decimal in version numbers

4 participants