feat(sessions): by-id fetch (/:id + ?ids=) + Tasks stops full-list polling (v0.294.0) - #539
Merged
Merged
Conversation
…lling (v0.294.0) Sessions-pagination Phase 1 (plan: docs/sessions-pagination-plan.md). The console had no single-session read — every by-id lookup came from the full ~950-row list the 1.5s poll ships, so the poll can't be slimmed without breaking lookups. Adds: - GET /api/sessions/:id and GET /api/sessions?ids=a,b,c — same derived-row shape as the list (clipped task, blocked/alive/labels), viewer-scoped via listSessions' canViewRow (unseeable id → 404 / omitted, no existence leak), matched by id regardless of archived_at (so a notification-open resolves an archived run). listSessions gained an optional `ids` filter. - The Tasks board now fetches only the sessions its visible tasks reference (lastSessionId, for liveOf) via sessionsByIds, instead of re-pulling all ~950 rows on its 5s timer. The global 1.5s poll still ships the full list until Phase 2 (a cheap summary feed). Verified against a live instawp snapshot (950 rows): batch/single/404/empty/archived-by-id all correct, task clipped ≤241, plain list unaffected; and viewer-scoping holds — a plain member sees 0 of 950 and gets 404/[] for an unowned id. Typecheck + web build + test:governance (29/29) green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Aug 3, 2026
Merged
vikasprogrammer
added a commit
that referenced
this pull request
Aug 3, 2026
…rtualize now, paginate later) (#544) Adds a "Console performance" section to TODO.md tracking the shipped console-perf arc (Phases 1+2, #539/#542) and the Phase 3 decision: do client row virtualization first (3a, low-risk render fix), defer server-side pagination (3b) until a tenant's session count clears ~3-5k. Updates docs/sessions-pagination-plan.md Status to match. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sessions-pagination Phase 1. Plan:
docs/sessions-pagination-plan.md(added here).Why
GET /api/sessionsreturns all ~950 sessions and the console had no single-session read — every by-id lookup (notification→open,SessionFacts, the Tasks board'slastSessionId → isLive) came from the full list the 1.5 s poll ships. That's the blocker to ever slimming the poll (Phase 2). This lands the missing by-id surface + removes the first duplicate full fetch.Change
GET /api/sessions/:idandGET /api/sessions?ids=a,b,c— same derived-row shape as the list (clippedtask,blocked/alive/labels). ReuselistSessions'canViewRowscoping (an id the caller can't see → 404 / omitted — no existence leak), and match by id regardless ofarchived_atso a notification-open resolves an archived run.listSessionsgained an optionalidsfilter.sessionsByIds) instead of re-pulling all ~950 rows on its 5 s timer.The global 1.5 s poll still ships the full list — that's Phase 2 (a cheap
/api/sessions/summary). This phase is purely additive + the Tasks fetch swap.Verification (live instawp snapshot, 950 rows)
?ids=/ single/:id/ unknown→404 / empty→[]/ archived-by-id / plain-list-unaffected / task clipped ≤241 — 9/9.[]for an unowned session id — no leak.npm run test:governance(29/29) green.Next
Phase 2 (the actual perf win — poll stops shipping ~950 rows) and Phase 3 (list-view server pagination). See the plan doc.
🤖 Generated with Claude Code