Skip to content

fix(tests): resolve 6 CI failures from stale env var reads and name collision - #4214

Closed
teknium1 wants to merge 1 commit into
mainfrom
hermes/hermes-b6eff376
Closed

fix(tests): resolve 6 CI failures from stale env var reads and name collision#4214
teknium1 wants to merge 1 commit into
mainfrom
hermes/hermes-b6eff376

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Fixes 6 pre-existing CI failures that passed locally (real config/keys) but failed in CI (blanked keys, no config.yaml).

Bug fix (production code)

_allow_private_urls name collision in browser_tool.py — The function used global _allow_private_urls and then assigned _allow_private_urls = False, replacing itself in the module namespace with a boolean. After the first call, subsequent calls hit TypeError: 'bool' object is not callable. Renamed the cache variable to _cached_allow_private_urls. This is a real bug that could affect any user with browser.allow_private_urls config.

Test fixes (5 stale tests)

All 5 tests relied on env vars that were removed in the March 2026 config refactor:

Test Stale env var Fix
test_custom_endpoint_prefers_openai_key OPENAI_BASE_URL Mock _get_model_config with config dict
test_custom_endpoint_auto_provider_prefers_openai_key OPENAI_BASE_URL Mock _get_model_config with config dict
test_custom_endpoint_when_no_nous OPENAI_BASE_URL Mock _resolve_custom_runtime directly
test_vision_auto_falls_back_to_custom_endpoint OPENAI_BASE_URL Mock _resolve_custom_runtime directly
test_gateway_run_agent_codex_path_handles_internal_401_refresh HERMES_MODEL Mock _resolve_gateway_model

Testing

  • All 6 previously-failing tests now pass
  • hermes_cli + provider tests: 895 passed
  • tools + agent tests: 2378 passed
  • gateway tests: 1794 passed

…ollision

1. browser_tool.py: Fix _allow_private_urls name collision — the function
   declared `global _allow_private_urls` then assigned a bool to it,
   replacing itself in the module namespace. Subsequent calls hit
   `TypeError: 'bool' object is not callable`. Renamed cache variable to
   `_cached_allow_private_urls`.

2. test_runtime_provider_resolution.py: Two tests relied on OPENAI_BASE_URL
   env var which was removed in the March 2026 config refactor. Updated to
   mock _get_model_config with config dict containing base_url instead.

3. test_provider_parity.py: test_custom_endpoint_when_no_nous relied on
   OPENAI_BASE_URL env var. Updated to mock _resolve_custom_runtime directly.

4. test_auxiliary_client.py: test_vision_auto_falls_back_to_custom_endpoint
   same OPENAI_BASE_URL issue. Updated to mock _resolve_custom_runtime.

5. test_codex_execution_paths.py: Gateway codex test used HERMES_MODEL env
   var (no longer read). Updated to mock _resolve_gateway_model instead.
@teknium1

Copy link
Copy Markdown
Contributor Author

Superseded — credential pools PR (#2647) fixed 4 of the 6 failures. Opening a smaller PR with just the remaining 2 fixes.

@teknium1 teknium1 closed this Mar 31, 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.

1 participant