Skip to content

fix(test): isolate codex provider tests from local env#1037

Closed
0xbyt4 wants to merge 2 commits into
NousResearch:mainfrom
0xbyt4:fix/codex-test-env-leak
Closed

fix(test): isolate codex provider tests from local env#1037
0xbyt4 wants to merge 2 commits into
NousResearch:mainfrom
0xbyt4:fix/codex-test-env-leak

Conversation

@0xbyt4

@0xbyt4 0xbyt4 commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Codex provider resolution tests fail locally when real API keys are present (e.g. OPENAI_API_KEY in ~/.hermes/.env)
  • test_codex_provider_uses_config_model: get_codex_model_ids() hits live API which returns gpt-5.2 (no -codex suffix) as first model, breaking "codex" in shell.model assertion
  • test_codex_provider_replaces_incompatible_default_model: local CLI_CONFIG leaks user-configured model, making _model_is_default false

Changes

  • Mock get_codex_model_ids in test_codex_provider_uses_config_model to prevent live API call
  • Clear CLI_CONFIG["model"] in test_codex_provider_replaces_incompatible_default_model to isolate from user config

Test plan

  • pytest tests/test_cli_provider_resolution.py — 8/8 passed (was 1 failed before fix)
  • Full suite: 3437 passed, 0 failed

teknium1 added a commit that referenced this pull request Mar 14, 2026
Salvaged PR #1037 onto current main with contributor commits preserved.
@teknium1

Copy link
Copy Markdown
Contributor

Merged via PR #1335. Your substantive test-isolation commits were cherry-picked onto current main with authorship preserved. Thanks for the contribution.

@teknium1 teknium1 closed this Mar 14, 2026
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
…ec1096a3

Salvaged PR NousResearch#1037 onto current main with contributor commits preserved.
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…ec1096a3

Salvaged PR NousResearch#1037 onto current main with contributor commits preserved.
olympus-terminal pushed a commit to olympus-terminal/hermes-agent that referenced this pull request May 16, 2026
…ec1096a3

Salvaged PR NousResearch#1037 onto current main with contributor commits preserved.
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
…ec1096a3

Salvaged PR NousResearch#1037 onto current main with contributor commits preserved.
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