You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(web_fetch): cache TTL resolver logs spurious WARNING on every call when env unset + stale os.environ tests #11246
web_fetch/cache.py_resolve_web_fetch_cache_ttl() reads config.misc.web_fetch_cache_ttl, a str SSOT field defaulting to "" (ssot_config.py:1562). Two issues:
Runtime bug — spurious warning: the guard is if raw is None, which does not catch the empty-string default. So when AUTOBOT_WEB_FETCH_CACHE_TTL is unset (the common case), the resolver hits int("") → ValueError → logs WARNING AUTOBOT_WEB_FETCH_CACHE_TTL='' is not an integer; falling back to 86400s on every call (and at import). Noise in normal operation.
Stale tests:tests/unit/web_fetch/test_cache.pyTestTTLResolver/TestMaxBytesResolver patch os.environ, but the resolvers read config.misc.* (loaded once at import), so the override never takes effect — test_env_override (TTL + MaxBytes) fail even when run in isolation (2 failed, 20 passed); the other cases passed only by accident (config stayed ""/0 → default).
Fix
Resolver: treat empty/None as 'use default' without warning (if raw is None or raw == ""); only a non-empty non-integer value warns.
Tests: patch config.misc.web_fetch_cache_ttl / config.misc.web_fetch_max_bytes (the actual source) instead of os.environ; reframe the MaxBytes 'invalid string' case (impossible for an int field) to the zero-fallback path.
Acceptance
No WARNING when the TTL env var is unset.
test_cache.py genuinely exercises the resolvers via config; full file green.
Closed — merged to Dev_new_gui (PR #11247). Resolver now treats the empty-string (unset) default as 'use default' silently — no more WARNING on every call; only a non-empty non-integer value warns. Tests patch config.misc.web_fetch_cache_ttl/web_fetch_max_bytes (the real source) instead of os.environ. test_cache.py = 22 passed (was 20 passed / 2 failed). black/isort/compile clean; CI green.
Activity
fix(web_fetch): silence spurious cache-TTL warning on unset env + fix…
mrveiss commentedon Jul 8, 2026
Closed — merged to Dev_new_gui (PR #11247). Resolver now treats the empty-string (unset) default as 'use default' silently — no more WARNING on every call; only a non-empty non-integer value warns. Tests patch
config.misc.web_fetch_cache_ttl/web_fetch_max_bytes(the real source) instead ofos.environ.test_cache.py= 22 passed (was 20 passed / 2 failed). black/isort/compile clean; CI green.