Skip to content

fix: codex model discovery on Python 3.10 (tomllib fallback)#281

Closed
0xbyt4 wants to merge 1 commit into
NousResearch:mainfrom
0xbyt4:fix/codex-models-python310-compat
Closed

fix: codex model discovery on Python 3.10 (tomllib fallback)#281
0xbyt4 wants to merge 1 commit into
NousResearch:mainfrom
0xbyt4:fix/codex-models-python310-compat

Conversation

@0xbyt4

@0xbyt4 0xbyt4 commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • _read_default_model() in hermes_cli/codex_models.py uses tomllib which is stdlib in Python 3.11+ but unavailable on 3.10
  • Project requires >=3.10, so this silently fails: user's config.toml default model is ignored
  • Added regex fallback for model = "..." parsing when tomllib is not available
  • Fixes test_get_codex_model_ids_prioritizes_default_and_cache on Python 3.10

Test plan

  • pytest tests/test_codex_models.py -v — 2/2 pass on Python 3.10
  • Full suite — no regressions (835 passed)

tomllib is stdlib in 3.11+ but unavailable on 3.10, which is the
project's minimum supported version. _read_default_model() silently
returned None on 3.10, ignoring the user's config.toml default.

Add a regex fallback for `model = "..."` parsing when tomllib is
not available.
@teknium1

teknium1 commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

Closing — Hermes requires Python 3.11+, not 3.10. The pyproject.toml was incorrectly set to >=3.10 which is what prompted this PR. Fixed in commit 9f4542b by correcting it to >=3.11.

Since 3.11 is the minimum, tomllib is always available and no fallback is needed. Thanks for catching the inconsistency though, @nicobako!

@teknium1 teknium1 closed this Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants