[codex] fix model cache invalidation on config reload#1311
Conversation
…sorbed CHANGELOG, ROADMAP, TESTING bumped (3936 \u2192 3946). 8 constituent PRs: - nesquena#1523 (@franksong2702) branch indicator codepoint fix - nesquena#1519 (@franksong2702) onboarding API-key focus loss fix - nesquena#1518 (@franksong2702) voice-mode toggle-off recognizer stop - nesquena#1516 (@franksong2702) YAML newline CSS rules - nesquena#1517 (@franksong2702) __CACHE_VERSION__ \u2192 __WEBUI_VERSION__ rename - nesquena#1532 (@ai-ag2026) state.db WebUI session recovery - nesquena#1525 (@ai-ag2026) stale stream state proactive cleanup - nesquena#1526 (@ai-ag2026) max_tokens forwarding + OpenRouter quota classifier Opus MUST-FIX absorbed: sw.js conflict-marker cleanup + regression guard. Opus SHOULD-FIX deferred to follow-up nesquena#1533 (race in _clear_stale_stream_state). 2 closed as duplicates: nesquena#1528 (identical to nesquena#1517), nesquena#1529 (superseded by nesquena#1516). 1 maintainer-review label: nesquena#1531 (Asunfly stowaway change in force-push). 5 stay on hold: nesquena#1418 nesquena#1464 nesquena#1404 nesquena#1353 nesquena#1311.
|
Reconciled this against current Findings:
Verification from the fresh branch:
Recommendation: close this conflicting PR in favor of the already-merged cache work plus #1752 for the remaining custom-provider routing slice. |
Closing — superseded on masterThanks @lost9999 — closing per @Michaelyklam's reconciliation comment from May 06. The cache-invalidation slice from this PR is already on master: The branch here was draft + DIRTY for several weeks while the master-side cleanup absorbed the same fix shape. Rather than ask you to rebase a draft against the now-superseded code, closing this out so the queue stays clean. Appreciate getting it on our radar early — the canonical fix on master is structurally similar to your approach. If you spot a residual cache-invalidation gap that the master-side |
CHANGELOG, ROADMAP, TESTING refresh for v0.51.31 stage release covering 12 contributor PRs: Added (2 PRs): - #1956 JKJameson — persistent composer draft (server-side, cross-client) - #1957 hermes-gimmethebeans — configurable session TTL via env + settings Fixed (10 PRs): - #1939 ai-ag2026 — theme-color + sw cache regression coverage - #1941 ai-ag2026 — preserve chat scroll across final render - #1945 franksong2702 — localize session jump controls (#1938) - #1947 happy5318 — show same model from different custom providers (Co-authored-by hacker1e7 for #1874 close) - #1949 Sanjays2402 — close #1937 endless-scroll vs Start-jump race with generation-token + mutex (Co-authored-by franksong2702 + Michaelyklam) - #1950 franksong2702 — mute stale stopped gateway heartbeat (#1944) - #1951 amlyczz — gate goal hook on goal-related turns (#1932) (Co-authored-by franksong2702 for #1946 close) - #1953 lucky-yonug — skip provider peel for custom host:port slugs - #1960 Michaelyklam — translate hidden-files workspace label (#1841) - #1961 sbe27 — respect image_input_mode (#1959) Closed in favor of canonical: #1942, #1962, #1946, #1874, #1311. Stage-326 hotfixes (per Opus advisor): - CRITICAL #1951 PENDING_GOAL_CONTINUATION race fix (removed finally discard that race-erased the marker before consumer could read it) - #1956 composer-draft input validation (50 KB text / 50 file clamp + type coercion to prevent unbounded session-JSON bloat) - #1957 SESSION_TTL constant preserved as named fallback (existing regression tests pin it; #1957 originally deleted it) Tests: 5006 → 5028 (+51 net new) — 0 regressions, 142.61s runtime.
Summary
Fix
/api/modelsreturning stale model metadata afterconfig.yamlchanges outside the WebUI default-model endpoint.Root Cause
get_available_models()detects aconfig.yamlmtime change and callsreload_config(), but the first mtime check happens before the fast-path cache logic. Afterreload_config()updates_cfg_mtime, the later cache invalidation path no longer sees a config change, so the 24h in-memory_available_models_cachecan keep serving olddefault_modeland model groups.Changes
config.yamledit so it catches stale in-memory cache reuse.Validation
HERMES_HOME=/home/lost9999/.hermes HERMES_WEBUI_STATE_DIR=/home/lost9999/.hermes/webui /home/lost9999/.hermes/hermes-agent/venv/bin/python -m pytest tests/test_ttl_cache.py -qRefs #1240.