Skip to content

fix(gateway): harden cache invalidation and test dependencies - #67785

Closed
KKamJi98 wants to merge 3 commits into
NousResearch:mainfrom
KKamJi98:pr/gateway-quality-fixes
Closed

fix(gateway): harden cache invalidation and test dependencies#67785
KKamJi98 wants to merge 3 commits into
NousResearch:mainfrom
KKamJi98:pr/gateway-quality-fixes

Conversation

@KKamJi98

Copy link
Copy Markdown

Summary

  • invalidate Honcho memoized parse results when file size changes within a coarse mtime tick
  • isolate compression concurrency fixtures from unrelated external feasibility probes
  • make the secure WeCom callback parser available through the dev test dependency contract

Validation

  • cache/metadata: 90 passed
  • compression concurrency: 30 passed
  • WeCom callback + feasibility: 31 passed
  • independent adversarial review: blocking 0
  • ruff and locked dependency checks: pass

No Discord/replay behavior or runtime configuration changes.

KKamJi98 added 3 commits July 20, 2026 09:39
The honcho.json parse memo was keyed on (path, st_mtime_ns) alone.
Kernel file timestamps come from the coarse clock, so an edit landing
in the same tick as the previous write leaves st_mtime_ns unchanged
and the memo serves the stale parse. Reproducible on WSL2 where
back-to-back write_text() calls observably share one mtime_ns, which
is exactly how test_honcho_cache_busting_config_memoized_by_mtime
fails there. Add st_size to the memo key so same-tick rewrites that
change content length still bust the cache.
_build_agent_with_db stubbed the compressor but left the lazy
check_compression_model_feasibility probe live inside
_compress_context. That probe makes a real openrouter.ai HTTP call
with the fake test key plus a full plugin-discovery pass (~15s+ on
WSL2), and its module-global 60s unhealthy-provider cache leaks
across tests, so one thread takes the fast cached path while the
other is still probing. The serialize test's 15s barrier/join
timeouts then expire with neither result recorded (the 'got 0'
failure), and the fork file's refresh test misses its 10s
compression_started wait. Set _compression_feasibility_checked so
the lock-contract tests never leave the process; no timeouts were
changed. Also cuts the two files from ~6min to ~50s locally.
@KKamJi98
KKamJi98 requested a review from a team July 20, 2026 00:40
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/gateway Gateway runner, session dispatch, delivery platform/wecom WeCom / WeChat Work adapter needs-decision Awaiting maintainer decision before any implementation sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades labels Jul 20, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Related to closed #46385 for the Honcho memo-key hunk, but this branch also changes WeCom dependency contracts and compression-test isolation. Please consider splitting the independently reviewable surfaces.

@KKamJi98 KKamJi98 closed this Jul 24, 2026
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 needs-decision Awaiting maintainer decision before any implementation P3 Low — cosmetic, nice to have platform/wecom WeCom / WeChat Work adapter sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants