Skip to content

stage-352: 4-PR clean batch — _summary_cache LRU cap #2216 + re.MULTILINE strip fix #2217 + Compact sidebar lineage hide #2219 + CONTRIBUTORS/README refresh #2220 - #2221

Merged
nesquena-hermes merged 9 commits into
masterfrom
stage-352
May 14, 2026
Merged

nesquena-hermes merged 9 commits into
masterfrom
stage-352

Conversation

@nesquena-hermes

Copy link
Copy Markdown
Collaborator

stage-352 — non-hold cleanups + UX fix + docs refresh (v0.51.59)

Per Nathan's directive: "take a look at the four PRs that are not on hold — if all four look good, consider moving them all forward as a release together as per the usual process."

All four non-hold PRs land clean. Three of them ship code that Opus pre-approved during stage-351 review yesterday (#2216, #2217 — Fix A and Fix B for issue #2215). The fourth (#2219) is a sound UX fix gating compressed-session lineage metadata behind Detailed density. The fifth (#2220) refreshes CONTRIBUTORS.md and the README after 14 release tags accumulated since the last refresh.

+159 / -71 across 11 files.

Composition (4 PRs)

PR Author LOC Surface Provenance
#2217 franksong2702 15 api/streaming.py + tests/test_issue607.py Fix B for issue #2215 — drops the stale re.MULTILINE flag from the "the user is asking" strip pattern (Opus flagged it during stage-351 review). PR also rewrites .*$ to [^\n]*(?:\n|$) so the pattern still terminates correctly at a newline without MULTILINE.
#2216 franksong2702 52 api/updates.py + tests/test_update_banner_fixes.py Fix A for issue #2215 — caps _summary_cache with OrderedDict LRU at 16 entries (Opus flagged it; I sketched the exact OrderedDict + move_to_end + popitem(last=False) shape in the issue). Closes #2215.
#2219 franksong2702 24 static/sessions.js + tests/test_session_lineage_collapse.py + 2 PNGs UX fix for issue #2218 — gates 4 lineage helpers behind _sidebarDensity === 'detailed' so Compact density no longer exposes "N prior turns" badges that can lead to "Session not available in web UI" errors when expanded. Visual evidence under docs/pr-media/2218/.
#2220 nesquena-hermes 136 CONTRIBUTORS.md + README.md Pure docs refresh. 130 → 137 contributors. 568 → 646 PR credits. Last refreshed v0.51.44 → now v0.51.58. Seven first-time contributors added (lucasrc, LumenYoung, MrFant, xz-dev, legeantbleu, ayushere, plerohellec).

Verification

  • Targeted pytest: 126/126 pass across all touched-surface suites
  • run-browser-tests.sh: 20/20 QA + 11/11 API checks PASSED in 103s
  • Live UI smoke on 8789 (fresh env, zero JS errors)
  • Phase 5 strict merge-marker check: zero markers
  • Python + JS syntax: clean across all modified files
  • Spot-checks:
  • Opus advisor: "SHIP all four. No SHOULD-FIX." Verified all three direct asks inline:
    1. Hide prior-turn lineage metadata in compact sidebar #2219 lineage gating — _fetchLineageReportForRow has exactly one caller, inside the canExpandLineageSegments-gated handler. No compact paths trigger fetch.
    2. fix: cap _summary_cache with LRU (max 16 entries) #2216 LRU semantic — Overwrite-without-touch is acceptable: the overwrite path is only reachable under a concurrent-write race in which the entry is already at the tail. No fix needed.
    3. docs: refresh CONTRIBUTORS.md and README to v0.51.58 (130→137 contributors, 568→646 PR credits) #2220 contributor numbers — Bucket arithmetic adds up to the claimed +7 net contributors. Cross-checked Two-PR (14 → 19), Single-PR (85 → 84), and Sustained bucket promotions.

Bonus from Opus on #2217: the PR isn't just "drop the re.MULTILINE flag" — it also rewrites .*$ to [^\n]*(?:\n\|$) so the pattern still terminates at a newline without MULTILINE. The two-part change is correct and the new test at tests/test_issue607.py:91-102 validates both the strip (leading wrapper) and the preserve (mid-response) cases.

Stats

11 files changed, 159 insertions(+), 71 deletions(-)

Closes

Refs #2218 (#2219 ships the Compact-density fix; #2218 may stay open for follow-up Detailed-density polish).

Frank Song and others added 9 commits May 14, 2026 09:14
Refs #2215 Fix B: remove the mid-response stripping hazard without losing leading multi-line wrapper cleanup.

The pattern now strips only a leading 'the user is asking' wrapper line and preserves the visible answer that follows. Add regression coverage for both the leading-wrapper and mid-response prose cases.
Refs #2215 Fix A: replace plain dict _summary_cache with OrderedDict-based LRU capped at 16 entries to prevent unbounded memory growth from long-running update summary generations.

Add regression coverage for the bounded LRU behavior: cache hits refresh recency, a new entry at capacity evicts the least-recently used key, and cache size never exceeds the cap.
Last refresh was at v0.51.44 (130 contributors / 568 PR credits). Since then,
14 releases shipped (v0.51.45 through v0.51.58) with 78 attributed PRs from
20 distinct contributors, adding 7 first-time contributors:

- @lucasrc — auth-hardening trilogy (#2191/#2192/#2193) → sustained 3-PR bucket
- @LumenYoung — stale-stream guard + 3 streaming-correctness fixes → sustained 4-PR bucket
- @MrFant — 2 PRs (reasoning_content whitelist, message preservation)
- @xz-dev — 2 PRs (thinking-card state, session-scoped metering)
- @legeantbleu — French (fr) locale (#2142)
- @ayushere — ctl.sh bash 3.2 macOS compat (#2117)
- @plerohellec — single PR

Bucket promotions (existing contributors who moved up):

- @dobby-d-elf: 2 → 6 PRs (jumps from two-PR list into top contributors)
- @samuelgudi: 1 → 2
- @michael-dg: 1 → 2
- @vcavichini: 1 → 2
- @hualong1009: 1 → 2

Top contributor PR-count updates (top 7 changed materially):

| Contributor       | Before | After | Delta | Latest release |
|-------------------|-------:|------:|------:|---------------|
| @franksong2702    |     92 |   117 |   +25 | Unreleased    |
| @Michaelyklam     |     81 |    92 |   +11 | v0.51.57      |
| @bergeouss        |     61 |    62 |    +1 | v0.51.46      |
| @ai-ag2026        |     49 |    55 |    +6 | v0.51.47      |
| @dso2ng           |     21 |    23 |    +2 | v0.51.51      |
| @jasonjcwu        |     13 |    16 |    +3 | v0.51.55      |
| @Jordan-SkyLF     |      6 |    12 |    +6 | Unreleased    |

Header refreshed: 130 → 137 contributors, 568 → 646 PR credits, refresh
tag bumped to v0.51.58. Notable contributions paragraphs in both files
updated with the new work (manual /compress async pair, worktree status +
guarded remove, fork-from-here, opencode-go resolver, the LumenYoung +
lucasrc + dobby-d-elf entries).

Source of truth: CHANGELOG.md attribution lines `**PR #N** by @user` between
the v0.51.44 header and the Unreleased section, plus baseline buckets in
the previous CONTRIBUTORS.md. Cross-bucket sanity check passes (no handle
appears in multiple buckets; 21 + 13 + 19 + 84 = 137 unique handles).
fix: drop re.MULTILINE from 'the user is asking' strip pattern (franksong2702, refs #2215 Fix B)
fix: cap _summary_cache with LRU (max 16 entries) (franksong2702, closes #2215 Fix A — closes #2215)
Hide prior-turn lineage metadata in compact sidebar (franksong2702, closes #2218)
docs: refresh CONTRIBUTORS.md and README to v0.51.58 (nesquena-hermes)
@nesquena-hermes
nesquena-hermes merged commit 3f4e82b into master May 14, 2026
3 checks passed
@nesquena-hermes
nesquena-hermes deleted the stage-352 branch May 14, 2026 02:39
SysAdminDoc pushed a commit to SysAdminDoc/hermes-webui that referenced this pull request Jun 26, 2026
stage-352: 4-PR clean batch — _summary_cache LRU cap nesquena#2216 + re.MULTILINE strip fix nesquena#2217 + Compact sidebar lineage hide nesquena#2219 + CONTRIBUTORS/README refresh nesquena#2220
bernyforce pushed a commit to bernyforce/hermes-webui that referenced this pull request Jul 29, 2026
stage-352: 4-PR clean batch — _summary_cache LRU cap nesquena#2216 + re.MULTILINE strip fix nesquena#2217 + Compact sidebar lineage hide nesquena#2219 + CONTRIBUTORS/README refresh nesquena#2220
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Two cleanup follow-ups from stage-351 Opus review: _summary_cache unbounded + re.MULTILINE on 'the user is asking' strip

1 participant