Skip to content

fix: _allow_private_urls name collision + stale OPENAI_BASE_URL test - #4217

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-b6eff376
Mar 31, 2026
Merged

fix: _allow_private_urls name collision + stale OPENAI_BASE_URL test#4217
teknium1 merged 1 commit into
mainfrom
hermes/hermes-b6eff376

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Fixes 2 remaining CI failures after #2647 resolved the other 4.

1. _allow_private_urls name collision (bug in production code)

browser_tool.py line 270 defines def _allow_private_urls() and line 276 declares global _allow_private_urls then assigns _allow_private_urls = False — replacing the function itself with a boolean. After the first call, any subsequent _allow_private_urls() hits TypeError: 'bool' object is not callable.

Fix: renamed cache variable to _cached_allow_private_urls.

2. test_custom_endpoint_when_no_nous stale env var

Test relied on OPENAI_BASE_URL env var which was removed in the March 2026 config refactor. In CI (no config, blanked keys), the auto chain falls through to credential pool api_key providers instead of the custom endpoint. Mock _resolve_custom_runtime directly.

1. browser_tool.py: _allow_private_urls() used 'global _allow_private_urls'
   then assigned a bool to it, replacing the function in the module namespace.
   After first call, subsequent calls hit TypeError: 'bool' object is not
   callable. Renamed cache variable to _cached_allow_private_urls.

2. test_provider_parity.py: test_custom_endpoint_when_no_nous relied on
   OPENAI_BASE_URL env var (removed in config refactor). Mock
   _resolve_custom_runtime directly instead.
@teknium1
teknium1 merged commit 79b2694 into main Mar 31, 2026
2 of 3 checks passed
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
…ousResearch#4217)

1. browser_tool.py: _allow_private_urls() used 'global _allow_private_urls'
   then assigned a bool to it, replacing the function in the module namespace.
   After first call, subsequent calls hit TypeError: 'bool' object is not
   callable. Renamed cache variable to _cached_allow_private_urls.

2. test_provider_parity.py: test_custom_endpoint_when_no_nous relied on
   OPENAI_BASE_URL env var (removed in config refactor). Mock
   _resolve_custom_runtime directly instead.
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…ousResearch#4217)

1. browser_tool.py: _allow_private_urls() used 'global _allow_private_urls'
   then assigned a bool to it, replacing the function in the module namespace.
   After first call, subsequent calls hit TypeError: 'bool' object is not
   callable. Renamed cache variable to _cached_allow_private_urls.

2. test_provider_parity.py: test_custom_endpoint_when_no_nous relied on
   OPENAI_BASE_URL env var (removed in config refactor). Mock
   _resolve_custom_runtime directly instead.
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…ousResearch#4217)

1. browser_tool.py: _allow_private_urls() used 'global _allow_private_urls'
   then assigned a bool to it, replacing the function in the module namespace.
   After first call, subsequent calls hit TypeError: 'bool' object is not
   callable. Renamed cache variable to _cached_allow_private_urls.

2. test_provider_parity.py: test_custom_endpoint_when_no_nous relied on
   OPENAI_BASE_URL env var (removed in config refactor). Mock
   _resolve_custom_runtime directly instead.
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
…ousResearch#4217)

1. browser_tool.py: _allow_private_urls() used 'global _allow_private_urls'
   then assigned a bool to it, replacing the function in the module namespace.
   After first call, subsequent calls hit TypeError: 'bool' object is not
   callable. Renamed cache variable to _cached_allow_private_urls.

2. test_provider_parity.py: test_custom_endpoint_when_no_nous relied on
   OPENAI_BASE_URL env var (removed in config refactor). Mock
   _resolve_custom_runtime directly instead.
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