Skip to content

fix(website-policy): scope disabled cache fast path - #109068

Open
kriss39 wants to merge 1 commit into
NousResearch:mainfrom
kriss39:fix/website-policy-cache-scope
Open

kriss39 wants to merge 1 commit into
NousResearch:mainfrom
kriss39:fix/website-policy-cache-scope

Conversation

@kriss39

@kriss39 kriss39 commented Sep 12, 2026

Copy link
Copy Markdown

What does this PR do?

This fixes a small cache bug in the website blocklist logic.

load_website_blocklist() already checks that a cached policy belongs to the current profile and is still within the cache TTL. However, check_website_access() had a separate fast path for disabled policies that skipped those checks.

That could cause two problems:

  • In a multiplexed process, a disabled policy cached for one profile could affect another profile.
  • If the blocklist was disabled and then enabled in config.yaml, the old disabled cache could continue to be used even after its TTL expired.

The fix keeps the fast path, but makes it use the same path + TTL validation as the normal cache lookup.

This is related to #58526, which fixed the main cache lookup, but the disabled-policy shortcut was still bypassing that logic.

Changes

  • Added a small helper for validating cached website policies.
  • Reused it in both the normal cache lookup and the disabled-policy fast path.
  • Added regression tests for:
    • switching between profiles with different website policies
    • reloading the policy after the disabled cache expires

Testing

I reproduced both cases against the current main behavior.

Before the fix:

2 failed

With this change:

2 passed

I also ran:

python -m py_compile tools/website_policy.py tests/tools/test_website_policy_cache_scope.py

which passed.

I also searched existing issues and PRs before opening this. #52082 has related website-policy cache tests, but it does not cover the cross-profile disabled-cache case or the expired disabled-cache path fixed here.

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/tools Tool registry, model_tools, toolsets tool/web Web search and extraction area/profiles Multi-profile isolation, HERMES_HOME scoping labels Sep 13, 2026
@kriss39
kriss39 force-pushed the fix/website-policy-cache-scope branch from 4fb53a0 to 519dc5c Compare September 16, 2026 19:24

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/profiles Multi-profile isolation, HERMES_HOME scoping comp/tools Tool registry, model_tools, toolsets P3 Low — cosmetic, nice to have tool/web Web search and extraction type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants