Skip to content

stage-351: net-positive ready batch — perf CLI scan cache #2149 + thinking-tag leading-only #2213 + MCP tools pagination #2210 + per-target update summaries #2207 + sweep animation tune #2212 + agent-mode cron badge #2206 - #2214

Merged
nesquena-hermes merged 25 commits into
masterfrom
stage-351
May 14, 2026

Conversation

@nesquena-hermes

Copy link
Copy Markdown
Collaborator

stage-351 — net-positive ready batch (v0.51.58)

Per Nathan's "next round of PRs requiring a little work but otherwise net positive — anything that's less than medium risk would also be included alongside up to medium risk" directive. This batch mixes 5 clean PRs (low/very-low-risk net-positive) with 1 medium-risk rebase (#2149).

Composition (6 PRs)

PR Author LOC Surface Stage work
#2210 Jordan-SkyLF 319 static/panels.js + style.css + i18n.js — bounded MCP tools list with toolbar/search/pagination None (CI green, screenshots in docs/pr-media/2210/)
#2213 franksong2702 84 api/streaming.py + static/ui.js — _strip_thinking_markup() leading-only (fixes #2152) None (CI green)
#2212 dobby-d-elf 5 static/style.css — tune Activity sweep animation (follow-up to PR #2203 shipped yesterday) None (CI green)
#2207 Jordan-SkyLF 876 api/updates.py + routes.py + config.py + static/{ui,boot,panels,i18n}.js + index.html — per-target update summaries with separate WebUI/Agent What's-new links + opt-in LLM summary (fixes #1579) None (CI green)
#2206 vcavichini 9 static/panels.js + style.css — 🤖 badge for agent-mode cron jobs + provider/model in detail view First-time contributor — approved CI workflow run. CI green.
#2149 starship-s 464 api/routes.py + models.py — cache CLI session scans for fast /api/session loads Resolved 2-block conflict in api/routes.py (see below). 29/29 targeted tests pass after resolution.

Stage-351 maintainer fix — #2149 conflict resolution

Two conflict blocks in api/routes.py:

Block 1 (line 1669-1716): Master grew a new helper _messages_include_tool_metadata() (unrelated function — detects whether returned messages contain tool metadata). pr-2149 added a new helper _session_requires_cli_metadata_lookup() (broader replacement for master's _needs_cli_session_metadata() gate).

Resolution: kept both functions — they're unrelated and both needed.

Block 2 (line 3287-3291): Master uses _needs_cli_session_metadata(); pr-2149 renamed it to _session_requires_cli_metadata_lookup() AND broadened the predicate. Master's gate returns True only for is_cli_session OR is-messaging-record. pr-2149's gate is strictly more inclusive — also covers read_only=True, session_source in {messaging, external_agent}, and the source_tag/raw_source/source/source_label/platform markers.

Resolution: adopted pr-2149's broader renamed gate. Removed the now-orphaned _needs_cli_session_metadata() definition from the master side (only consumer migrated to the new name; checked the rest of the repo — no other callers).

Verification rationale: pr-2149's gate is a strict superset of master's gate, so any session that previously took the slow CLI-metadata path still does, plus a few legacy shapes (sidecars with read_only=False from before that field existed) now correctly trigger the slow path when they need it. The performance win comes only on ordinary WebUI-native sessions, which neither gate accepted.

Opus reviewer verified by grep that read_only=True is exclusively set on Session records in CLI/import paths (api/models.py:1528 Claude Code import, api/routes.py:9451 CLI import payload). No legitimate WebUI-native session has read_only=True. Safe.

Verification

  • Targeted pytest: 134/134 pass across all touched-surface suites (test_session_cli_scan_fast_path + 9 others)
  • Full pytest (background, exit 0)
  • 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
  • Opus advisor: SHIP all 6. Verified the three highest-impact questions:
    1. perf(sessions): cache CLI session scans #2149 broadened gate — no legitimate non-CLI session shape has read_only=True → no false-slow-path
    2. Preserve literal thinking tags in assistant messages #2213 leading-only regex — ^\s* with no MULTILINE correctly distinguishes whitespace-prefix (strip) from text-prefix (keep)
    3. feat: add per-target update summaries #2207 opt-in LLM summary — no diff sent (only ≤24 commit subjects/target), cached by SHA-pair, graceful degrade to deterministic fallback on missing provider, default OFF
  • Two non-blocking follow-ups to file: _summary_cache unbounded dict (small cardinality in practice) + pre-existing re.MULTILINE "the user is asking" pattern at api/streaming.py:698

Stats

26 files changed, 1763 insertions(+), 208 deletions(-)

Closes

Refs PR #2203 (#2212 is a CSS-only follow-up tune to its Activity sweep animation).

starship-s and others added 25 commits May 12, 2026 11:24
Identify cron jobs with mode=agent (no_agent=false) in the cron list
by displaying a robot emoji badge next to the job name.
Preserve literal thinking tags in assistant messages (franksong2702, fixes #2152)
Fix MCP tools list overflow with pagination/search (Jordan-SkyLF)
Tune Activity sweep animation (dobby-d-elf, follow-up to #2203)
feat: add per-target update summaries with separate WebUI/Agent What's-new links (Jordan-SkyLF, fixes #1579)
feat: show 🤖 badge and provider/model for agent-mode cron jobs (vcavichini)
perf(sessions): cache CLI session scans (starship-s)

Conflict resolution on api/routes.py:
  (1) Master grew a new helper '_messages_include_tool_metadata()' that
      pr-2149 doesn't have. Kept it (unrelated function — detects whether
      returned messages contain tool metadata, used elsewhere).
  (2) pr-2149 renames the CLI-metadata gate from '_needs_cli_session_metadata'
      to '_session_requires_cli_metadata_lookup' AND broadens it to cover
      legacy-imported sidecars with 'read_only=False' but persisted 'is_cli_session'
      or session_source markers. The new gate is strictly more inclusive than
      the master version — covers (a) is_cli_session, (b) read_only=True,
      (c) session_source in {messaging, external_agent}, AND (d) source_tag,
      raw_source, source, source_label, platform markers. All sessions that
      previously took the slow path still do, plus a few more legacy shapes
      that needed CLI metadata for correct display.
  (3) Removed the obsolete '_needs_cli_session_metadata()' definition from
      master (only consumer migrated to the new name).

29/29 tests pass across test_session_cli_scan_fast_path (new), claude_code
session import, session_index, and session_lineage_full_transcript.
@nesquena-hermes
nesquena-hermes merged commit d8798ab into master May 14, 2026
3 checks passed
@nesquena-hermes
nesquena-hermes deleted the stage-351 branch May 14, 2026 00:21
SysAdminDoc pushed a commit to SysAdminDoc/hermes-webui that referenced this pull request Jun 26, 2026
stage-351: net-positive ready batch — perf CLI scan cache nesquena#2149 + thinking-tag leading-only nesquena#2213 + MCP tools pagination nesquena#2210 + per-target update summaries nesquena#2207 + sweep animation tune nesquena#2212 + agent-mode cron badge nesquena#2206
bernyforce pushed a commit to bernyforce/hermes-webui that referenced this pull request Jul 29, 2026
stage-351: net-positive ready batch — perf CLI scan cache nesquena#2149 + thinking-tag leading-only nesquena#2213 + MCP tools pagination nesquena#2210 + per-target update summaries nesquena#2207 + sweep animation tune nesquena#2212 + agent-mode cron badge nesquena#2206
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.

Qwen3.6 <think> </think> blocks bug(update banner): What’s new link can open a 404 GitHub compare page

4 participants