fix(tests): resolve 6 CI failures from stale env var reads and name collision - #4214
Closed
teknium1 wants to merge 1 commit into
Closed
fix(tests): resolve 6 CI failures from stale env var reads and name collision#4214teknium1 wants to merge 1 commit into
teknium1 wants to merge 1 commit into
Conversation
…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.
Contributor
Author
|
Superseded — credential pools PR (#2647) fixed 4 of the 6 failures. Opening a smaller PR with just the remaining 2 fixes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_urlsname collision inbrowser_tool.py— The function usedglobal _allow_private_urlsand then assigned_allow_private_urls = False, replacing itself in the module namespace with a boolean. After the first call, subsequent calls hitTypeError: 'bool' object is not callable. Renamed the cache variable to_cached_allow_private_urls. This is a real bug that could affect any user withbrowser.allow_private_urlsconfig.Test fixes (5 stale tests)
All 5 tests relied on env vars that were removed in the March 2026 config refactor:
test_custom_endpoint_prefers_openai_keyOPENAI_BASE_URL_get_model_configwith config dicttest_custom_endpoint_auto_provider_prefers_openai_keyOPENAI_BASE_URL_get_model_configwith config dicttest_custom_endpoint_when_no_nousOPENAI_BASE_URL_resolve_custom_runtimedirectlytest_vision_auto_falls_back_to_custom_endpointOPENAI_BASE_URL_resolve_custom_runtimedirectlytest_gateway_run_agent_codex_path_handles_internal_401_refreshHERMES_MODEL_resolve_gateway_modelTesting