Skip to content

v0.51.2 — 3-PR follow-up + sidebar scroll hotfix#1682

Merged
nesquena-hermes merged 11 commits into
masterfrom
stage-299
May 5, 2026
Merged

v0.51.2 — 3-PR follow-up + sidebar scroll hotfix#1682
nesquena-hermes merged 11 commits into
masterfrom
stage-299

Conversation

@nesquena-hermes
Copy link
Copy Markdown
Collaborator

v0.51.2 — 3-PR follow-up batch + #1669 scroll hotfix

P0 fix included: PR #1669 (sidebar virtualization in v0.51.0) introduced a regression where lists ≤80 sessions reset scrollTop to 0 on every scroll event. Live-confirmed broken on production v0.51.1 today; fix verified working on stage-299. 3 regression tests pin the fix.

Constituent PRs

These 3 were deferred from v0.51.1 yesterday because their branches predated the v0.51.0 Kanban v1 merge, producing multi-region conflicts in panels.js + style.css. All conflicts resolved surgically this release; both #1664 and #1662 rebased branches force-pushed back to contributor's fork preserving Co-authored-by attribution.

Pre-release verification

  • Pytest: 4429 → 4457 passing (+28). Full sequential pass, 0 regressions, 113s.
  • JS syntax: 6 modified .js files all parse clean.
  • Python syntax: 9 modified .py files all compile clean.
  • QA harness: 20 pytest + 11 browser API checks + /health probe — ALL CHECKS PASSED.
  • Browser walkthrough: 56-session sidebar scroll holds at 500 across 600ms+ (was broken on v0.51.1). Logs tab renders 4 test log lines with correct severity classes. LLM Wiki card renders with proper "Unavailable" state. _isCliSession correct across 6 input cases. Path traversal ?file=../../etc/passwd returns HTTP 400.
  • Independent review: Opus advisor verdict SHIP. 6/6 verification questions clean. 0 MUST-FIX, 2 SHOULD-FIX absorbed in-release (bounded WIKI_PATH walk + URL scheme guard for docs_url).

Opus-applied fixes (absorbed in stage-299)

  • api/routes.py_LLM_WIKI_MAX_FILES = 10000 cap on rglob iteration + _LLM_WIKI_FORBIDDEN_ROOTS blocklist (/, /etc, /usr, /var, /opt, /sys, /proc)
  • static/panels.js — URL-scheme guard for docs_url (/^https?:\/\//i.test(rawDocsUrl)) before interpolation into <a href=>

Surgical conflict resolution highlights

Closes the gap from v0.51.1 deferrals.

Michaelyklam and others added 11 commits May 5, 2026 01:48
…1669 follow-up

PR #1669 added DOM virtualization to renderSessionListFromCache() with two issues
for lists below the virtualization threshold (≤80 rows):

1. The unconditional scroll listener triggered renderSessionListFromCache() on
   every rAF, rebuilding the entire list DOM on every scroll event.
2. After each rebuild, scrollTop was only restored when virtualWindow.virtualized
   was true (i.e. total > 80). For lists ≤ 80 rows, scrollTop dropped to 0 on
   every scroll event, producing a 'scroll keeps jumping back' feel.

Fix:
- Always restore scrollTop after re-render when listScrollTopBeforeRender > 0
  (regardless of virtualized flag).
- Short-circuit _scheduleSessionVirtualizedRender when total <=
  SESSION_VIRTUAL_THRESHOLD_ROWS (saves wasteful rebuild on small lists).

Live verified on a 56-session sidebar: scrollTop holds across animation frames.
3 regression tests pin the fix shape.
Per Opus advisor on stage-299:

1. Bounded WIKI_PATH walk + forbidden-root guard (api/routes.py)
   - _LLM_WIKI_MAX_FILES = 10000 caps rglob iteration (prevents hangs on
     symlink loops or pathologically-large trees)
   - _LLM_WIKI_FORBIDDEN_ROOTS blocklist refuses '/' '/etc' '/usr' '/var'
     '/opt' '/sys' '/proc' even if WIKI_PATH is misconfigured to point
     at them
   - Self-DoS prevention: /api/wiki/status fires on every Insights tab
     open via Promise.all, and unbounded rglob would block the endpoint

2. URL-scheme guard for docs_url interpolation (static/panels.js)
   - rawDocsUrl is regex-validated against /^https?:\/\//i before being
     interpolated into the <a href=> attribute
   - esc() HTML-escapes but doesn't validate URL scheme; docs_url is
     server-controlled today but the contributor scaffolded it for
     potential config-driven use, so future-proof against javascript:
     scheme XSS

6 regression tests in tests/test_stage299_opus_fixes.py pin both fixes.
CHANGELOG.md: full v0.51.2 entry covering 3 PRs + sidebar scroll hotfix
ROADMAP.md: bump version + test count to 4457
TESTING.md: bump version + test count to 4457

Independent review: Opus advisor on stage-299 diff (1336 LOC).
6/6 verification questions verified clean. Verdict: SHIP.
0 MUST-FIX, 2 SHOULD-FIX absorbed in-release (bounded WIKI walk +
URL scheme guard).
@nesquena-hermes nesquena-hermes merged commit fcc8328 into master May 5, 2026
3 checks passed
@nesquena-hermes nesquena-hermes deleted the stage-299 branch May 5, 2026 02:22
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.

feat(logs): Logs tab — view agent/errors/gateway logs from the UI Feature request: LLM Wiki status panel with on/off toggle

3 participants