Review Sweep
One-click agentic review of all unsettled work — Sidebar v2 · t3code · branch t3code/sidebar-work-overview
Why
Sidebar v2 splits threads into active cards and a collapsed settled tail, but keeping that split honest is manual.
Titles go stale as work evolves; finished threads linger unsettled until you notice. This feature adds a one-click sweep:
an LLM reads every unsettled thread across all connected environments, summarizes it, suggests a corrected title
where the current one is misleading, and recommends settling threads whose work has clearly concluded.
Results open in a new full-page /review-sweep view. Nothing applies without a click.
Mock UI — /review-sweep
Results stream in progressively (concurrency 3 per environment). Cards are grouped by project; each card links to its thread.
Work review
t3code · 4 threads
Asked to bump the sidebar auto-settle default from 3 days to 5. Change landed, tests updated, PR #4391 merged. No follow-up work remains.
Fixed the flash of empty state when opening a thread. Fix is in review but the reviewer asked for a regression test that hasn’t been written yet.
Currently running: replacing backdrop-filter fallbacks in the composer shell. Session active for 12 minutes; settle intentionally not offered.
t3-mobile · 2 threads
Root-caused a stale Metro transform cache; workaround documented and adopted. Superseded by the dev-client reuse work in a newer thread.
Text generation provider unavailable on this environment.
Mock only — final view uses the app’s shadcn-style Card/Badge/Button kit inside <SidebarInset>, with glass styling matching the sidebar. Sidebar entry point is the highlighted checklist icon.
How it works
startSweep() + navigate to /review-sweeparchivedAt === null, has threadSettlement capability, !effectiveSettled(...)review.summarizeThread({ threadId, canSettleNow }) per threadProjectionSnapshotQuery, new generateThreadReview one-shot LLM op (same infra as auto-titles)thread.meta.update (title), thread.settle — with apply-time canSettle re-checkTextGeneration one-shot LLM service already powers auto thread titles across all five providers
(Claude / Codex / Cursor / Grok / OpenCode). This feature adds one new op to it and reuses existing settle/rename commands —
no new persisted thread fields, no migrations, no job queue.
RPC contract
| Field | Type | Meaning |
|---|---|---|
summary | string | 1–2 sentences: what was asked, where it landed |
suggestedTitle | string | null | null = current title still accurate |
recommendSettle | boolean | Only when work clearly concluded; forced false when canSettleNow is false (running / pending input / approvals) |
settleReason | string | null | Shown next to the Settle button |
Implementation steps
1 · Contracts packages/contracts
review.ts: input/result schemas +ReviewThreadNotFoundErrorrpc.ts:WS_METHODS.reviewSummarizeThread+ RPC inWsRpcGroupenvironment.ts: newreviewSweepcapability flag (skips old servers)
2 · Server — LLM op apps/server
TextGenerationPrompts.ts:buildThreadReviewPrompt— conservative rules; transcript capped (first user msg + last 20 msgs, ~2k chars each)TextGeneration.ts+ all 5 provider impls:generateThreadReview(~15–20 lines each, followsgenerateThreadTitle)
3 · Server — handler
review/ReviewService.ts:summarizeThread— transcript viagetThreadDetailById, model fromtextGenerationModelSelectionws.ts: scope map + handler next toreviewGetDiffPreview
4 · client-runtime
state/review.ts:summarizeThreadviacreateEnvironmentRpcCommand; mutations reuse existingsettle/updateMetadataatoms
5 · Web — store + runner apps/web
reviewSweepStore.ts: Zustand, non-persisted — run survives navigationhooks/useReviewSweep.ts: selection, promise pool,applyTitle/applySettle/applyAll
6 · Web — route + view
routes/review-sweep.tsx: auth-gated file route (sidebar shell is automatic)components/reviewSweep/ReviewSweepView.tsx: header (progress, Re-run, Apply All) + project-grouped cards
7 · Sidebar entry point
- Checklist icon button in SidebarV2 header (v2-only by design)
Safety rails
- Running / awaiting-input / pending-approval threads are summarized but never get a settle recommendation (client computes
canSettleNow; server enforces it too). - Every settle is re-checked against the live shell at apply time — nothing that became active mid-run gets settled.
- Per-item errors don’t sink the run: failed cards show the error with a Retry button.
Risks
textGenerationModelSelection may point at an unauthenticated provider. Absorbed by per-item error + Retry.reviewSweep capability flag filters them out cleanly.Verification
- Per-package
typecheck(contracts, server, client-runtime, web);vp linton changed files. - Focused tests:
ReviewService.test.ts, prompt-builder tests, touched provider tests. - End-to-end via the
test-t3-appskill: seed finished / running / stale threads, run the sweep, apply one title + one settle + Apply All; confirm the settled thread drops to the sidebar’s settled tail and the running thread offers no settle button.