Review Sweep

One-click agentic review of all unsettled work — Sidebar v2 · t3code · branch t3code/sidebar-work-overview

Approved: per-item apply + Apply All Scope: all environments Ephemeral per run

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.

T3 Code
new “Review unsettled work” button
Fix composer glass fallbacks
Working · 12m
Thread loading flash fix
Done
New thread
Approval needed
iOS git progress overlay polish
Failed
— Settled —
Keep warm thread un-settled
Sidebar auto-settle window
Context strip alignment
t3code · 4 threads
New thread Recommend settle

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.

Title New threadBump auto-settle default to 5 days Apply title
Settle PR merged and idle for 2 days — work concluded. Settle thread
Thread loading flash fix Keep active

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.

Title Current title is accurate — no change suggested.
Fix composer glass fallbacks In flight — no action

Currently running: replacing backdrop-filter fallbacks in the composer shell. Session active for 12 minutes; settle intentionally not offered.

t3-mobile · 2 threads
Investigate Metro cache issue Recommend settle

Root-caused a stale Metro transform cache; workaround documented and adopted. Superseded by the dev-client reuse work in a newer thread.

Settle Superseded by newer thread — no remaining action here. Settled ✓
Pairing flow retry logic Review failed

Text generation provider unavailable on this environment.

Errorclaude CLI not authenticatedRetry

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

1 · Click sweep buttonSidebarV2 header icon → startSweep() + navigate to /review-sweep
2 · Select threads (client)All environments: archivedAt === null, has threadSettlement capability, !effectiveSettled(...)
3 · Fan out RPCsPromise pool, concurrency 3 → review.summarizeThread({ threadId, canSettleNow }) per thread
4 · Server reviewsReads transcript via ProjectionSnapshotQuery, new generateThreadReview one-shot LLM op (same infra as auto-titles)
5 · Apply on clickExisting commands: thread.meta.update (title), thread.settle — with apply-time canSettle re-check
Key reuse: the TextGeneration 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

FieldTypeMeaning
summarystring1–2 sentences: what was asked, where it landed
suggestedTitlestring | nullnull = current title still accurate
recommendSettlebooleanOnly when work clearly concluded; forced false when canSettleNow is false (running / pending input / approvals)
settleReasonstring | nullShown next to the Settle button

Implementation steps

1 · Contracts packages/contracts

  • review.ts: input/result schemas + ReviewThreadNotFoundError
  • rpc.ts: WS_METHODS.reviewSummarizeThread + RPC in WsRpcGroup
  • environment.ts: new reviewSweep capability 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, follows generateThreadTitle)

3 · Server — handler

  • review/ReviewService.ts: summarizeThread — transcript via getThreadDetailById, model from textGenerationModelSelection
  • ws.ts: scope map + handler next to reviewGetDiffPreview

4 · client-runtime

  • state/review.ts: summarizeThread via createEnvironmentRpcCommand; mutations reuse existing settle / updateMetadata atoms

5 · Web — store + runner apps/web

  • reviewSweepStore.ts: Zustand, non-persisted — run survives navigation
  • hooks/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

Risks

Provider availability — an environment’s textGenerationModelSelection may point at an unauthenticated provider. Absorbed by per-item error + Retry.
Cost/latency — one LLM CLI spawn per thread. Concurrency 3, soft cap ~50 threads/run with a notice.
Version skew — old servers lack the RPC; the reviewSweep capability flag filters them out cleanly.

Verification