Skip to content

fix(gateway): skip inactive honcho cache-bust reads#33535

Closed
BROCCOLO1D wants to merge 3 commits into
NousResearch:mainfrom
BROCCOLO1D:fix/33382-honcho-cache-busting
Closed

fix(gateway): skip inactive honcho cache-bust reads#33535
BROCCOLO1D wants to merge 3 commits into
NousResearch:mainfrom
BROCCOLO1D:fix/33382-honcho-cache-busting

Conversation

@BROCCOLO1D

Copy link
Copy Markdown
Contributor

Summary

  • Skip Honcho cache-busting config reads on gateway messages unless memory.provider is honcho.
  • Memoize Honcho cache-busting fields by honcho.json mtime for active Honcho gateways.

Refs #33382

Why

  • _extract_cache_busting_config() runs on the gateway message hot path before agent dispatch.
  • The Honcho identity fields are only relevant when Honcho is the active memory provider, but the existing path parsed honcho.json for every provider.

Changes

  • gateway/run.py: adds memory.provider to cache-busting keys, gates Honcho config parsing to the active Honcho provider, and caches extracted Honcho signature fields by (path, st_mtime_ns).
  • tests/gateway/test_agent_cache.py: covers non-Honcho skip behavior and mtime-based memoization while keeping existing agent config signature tests intact.

Validation

  • python -m pytest tests/gateway/test_agent_cache.py::TestExtractCacheBustingConfig tests/gateway/test_agent_cache.py::TestAgentConfigSignatureUserId -o 'addopts=' -q
  • python -m pytest tests/gateway/test_agent_cache.py -o 'addopts=' -q
  • python -m ruff check gateway/run.py tests/gateway/test_agent_cache.py

Scope

Note: #33440 touches the same Honcho cache-signature block but addresses manager-scoped field coverage rather than the inactive-provider skip/memoization path here.

@alt-glitch alt-glitch added type/perf Performance improvement or optimization P3 Low — cosmetic, nice to have comp/gateway Gateway runner, session dispatch, delivery comp/plugins Plugin system and bundled plugins labels May 28, 2026
@BROCCOLO1D BROCCOLO1D force-pushed the fix/33382-honcho-cache-busting branch from deb70c2 to d6b7064 Compare May 29, 2026 05:43
erosika added a commit to erosika/hermes-agent that referenced this pull request May 29, 2026
Adopted from NousResearch#33535 (BROCCOLO1D): the per-message Honcho cache-busting
gate reads memory.provider to decide whether to parse honcho.json, but the
provider value itself was not a busting key. A user switching memory.provider
mid-gateway (e.g. honcho -> mem0) would not necessarily rebuild the cached
agent on that change alone. Add ("memory", "provider") to the busting key
set and cover the provider-switch signature change with a test.

Co-authored-by: BROCCOLO1D <279959838+BROCCOLO1D@users.noreply.github.com>
@erosika

erosika commented May 29, 2026

Copy link
Copy Markdown
Contributor

Thanks for catching this — the memory.provider cache-busting gap was a real one. Adopted that key into #33954 with co-authored credit so it lands with the rest of the self-hosted Honcho work. The skip-when-inactive + mtime-memoization logic converged independently there. Appreciate the contribution.

@BROCCOLO1D

Copy link
Copy Markdown
Contributor Author

Closing this to avoid duplicating #33954 now that the cache-busting key was adopted there with co-authored credit. Thanks for folding it into the broader Honcho cleanup.

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

Labels

comp/gateway Gateway runner, session dispatch, delivery comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have type/perf Performance improvement or optimization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants