Merged origin/main (9 commits) and fixed review findings:
- Macroscope (CI failure): ReviewMergeError dropped the underlying
failure by stringifying it into `detail`. It now carries an optional
`cause` and uses a static detail, matching the sibling mapper in
summarizeThread.
- Cursor (medium, real bug): diffStats used only the latest checkpoint,
but CheckpointReactor diffs previous→current, so each checkpoint's
files are that turn's delta. Now sums every ready checkpoint, deduping
the file count by path. Regression test added.
- Cursor (medium): SidebarV2 remounting published an empty PR-state map
and wiped the mirrored cache, making merged-PR threads look unsettled.
publishSweepChangeRequestStates now merges instead of replacing.
- Macroscope (medium): the buckets memo read live shells via
readThreadShell but only depended on items, so cards could stay in a
stale bucket. It now depends on thread shells too.
- Cursor (low): sweep candidate selection used a raw wall clock while
SidebarV2 quantizes to the minute, disagreeing near the merged-PR idle
boundary. Both now use the same minute-quantized clock.
- Cursor (low): threads with a queued turn start are classified as
in-flight rather than needing attention.
Co-Authored-By: Claude Fable 5 <[email protected]>
Four features from real-data testing feedback:
- The sidebar button now opens a launch modal (scope + model + cost
summary) instead of navigating. Starting closes the modal and shows
a "running in background" toast; completion raises a toast with an
actionable-count summary and a "View results" link. The sweep was
already navigation-proof; now the UX matches.
- Reviews investigate deeper: when a thread's branch has a PR, the
server fetches state, review decision, CI rollup, mergeability, and
the last five comments via `gh pr view`, feeds them into the review
prompt, and returns a prStatus with a computed mergeReady flag
(open + clean merge + CI not failing + not blocked on review).
Lookups degrade to "no PR context" on any failure.
- New "Merge ready" bucket at the top of the results grid with
per-card "Merge & settle" and a section-level "Merge all (N)".
- Merging runs through a SEQUENTIAL queue: each PR is re-validated
against live GitHub state before merging (an earlier queue entry may
have just changed the base), merged PRs settle their thread
immediately, and a conflict marks the card and hands the rebase to
the thread's own agent via a turn message — the queue continues past
it. review.mergePullRequest returns conflict/already-closed/not-ready
as outcomes rather than errors so the queue can branch on them.
Co-Authored-By: Claude Fable 5 <[email protected]>
The screenshot from real-data testing showed nextStep rambling into
status recaps ("The requested comparison and hosted write-up are
complete, and..."). The prompt now demands a verb-first command of at
most 10 words with explicit GOOD/BAD examples, and normalizeThreadReview
backstops drift by truncating to the first sentence, hard-capped at 80
chars. Attention-bucket cards fall back to the summary when an older
server omits nextStep, so they always say what's being waited on.
Co-Authored-By: Claude Fable 5 <[email protected]>
Real-data feedback round two:
- Results render as a responsive grid (1/2/3 columns) instead of a
full-width list.
- While the sweep runs, the page shows only a progress count
("Reviewing your work — 7 of 18"); results reveal all at once when
every thread is done, so triage happens in one pass over a stable
layout instead of chasing cards as they pop in.
- The model now returns a one-sentence imperative nextStep ("Review
and merge PR #4415.") which becomes the card body — a direct answer
to "what should I do here". Summaries are capped at one sentence and
demoted to an info-icon tooltip.
Co-Authored-By: Claude Fable 5 <[email protected]>
Real-data feedback: uniform gray cards grouped by project buried the
actionable items. The results view is now organized by what the user
should do, ordered easiest-to-clear first:
1. Ready to settle (one-click, emerald accent)
2. Title fixes (sky)
3. Needs your attention (amber — awaiting review/input)
4. In flight / review-failed / still-reviewing tails
Cards are denser, carry a per-bucket accent stripe and a single
primary action, and gain a metadata row: project favicon + name,
branch, thread age, and diff size. Diff stats (+adds/−dels/files) come
from the thread's latest ready checkpoint, returned by the review RPC
as a new optional diffStats field — no extra client requests. Within
each bucket, smallest diff sorts first to build clearing momentum.
Co-Authored-By: Claude Fable 5 <[email protected]>
- Group sweep cards and resolve project titles by scoped
(environmentId, projectId) key — bare project ids can collide across
connected environments.
- Withdraw a settle recommendation from the card when the apply-time
canSettle guard refuses it, instead of leaving a CTA the guard will
keep rejecting.
- Document why summarizeThread's two projection reads are ordered
transcript-then-shell: reading the activity view last catches
sessions that start mid-read, and the reverse skew only affects
summary staleness — settles are re-validated at apply time and by
the decider, so no consistency window can settle live work.
Co-Authored-By: Claude Fable 5 <[email protected]>
The provider CLI spawn reads local context files (AGENTS.md, CLAUDE.md)
from its cwd, so silently falling back to process.cwd() when a thread
has no worktree and its project shell is missing would mix the server's
own directory contents into an external LLM prompt. Return a typed
TextGenerationError instead — the sweep UI already renders it as a
retry-able error card.
Co-Authored-By: Claude Fable 5 <[email protected]>
- macroscope: guard apply-title/apply-settle completions with the runId
captured before the RPC so a Re-run mid-flight never stamps applied
state onto the new run's cards; applyAll re-reads items from the
store each step so mid-apply dismissals are respected, and bails out
entirely when the run changes.
- cursor: the server's activity re-check now also treats a queued turn
start (user message no session has adopted yet) as active, mirroring
the decider's thread.settle guard; sweep candidate ordering uses
NaN-safe toSortableTimestamp instead of raw Date.parse.
Co-Authored-By: Claude Fable 5 <[email protected]>
Adds a sidebar-v2 button that reviews every unsettled thread across all
connected environments: an LLM summarizes each thread, suggests a
corrected title when the current one is misleading, and recommends
settling threads whose work has concluded. Results stream into a new
/review-sweep page with per-item Apply buttons and Apply All — nothing
applies without a click.
- contracts: ReviewThreadSummaryInput/Result, review.summarizeThread WS
RPC, reviewSweep capability flag (old servers are skipped)
- server: generateThreadReview TextGeneration op across all five
providers, conservative prompt with transcript capping, and
ReviewService.summarizeThread reading the projection
- client-runtime: summarizeThread RPC command atom
- web: reviewSweepStore runner (concurrency 3, runId-guarded, survives
navigation), /review-sweep view, SidebarV2 entry button
Settle recommendations are blocked for active threads at four layers:
prompt rules, normalizeThreadReview, a server-side projection re-check
(never trusts the client's canSettleNow), and a client canSettle
re-check at apply time.
Co-Authored-By: Claude Fable 5 <[email protected]>