Repository navigation
tui: worktree setup progress for the open thread - #27
Merged
Merged
Conversation
The open thread subscribes to its worktree setup while it has a worktree or its run is preparing one, holds the latest snapshot, and draws it under the first prompt as the nightly desktop's card. w and a click on the Details row open the branch, base, path and setup command. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Unit tests cover parsing, the card's rows and the subscription's sequence rules. App tests drive the offline TUI through each lifecycle, a thread switch, a refusal, Details by key and click, the pin, the anchor and the tick. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The README said a thread stops asking once its setup subscription ends. The client's watcher subscribes again after a stream ends without an error or the socket drops, and stops only on an error Exit, which the TUI treats as a refusal for every thread. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Adds Sol's verification of 621e8ac as docs/worktree-setup-verification.md, with seven rendered tmux captures and the six-capture slideshow, copied byte for byte from the approved media. The README's Worktree setup section links the Details capture and the page. Corrects two README claims. w and the status line's offer follow any drawn row of a card with a Details row, even after that row scrolls off, and only a click needs the row on screen. A card kept through a refusal, a reconnect, null or a closed watch doesn't arm the once-a-second tick, but any frame drawn in a new second lays a running setup's card out again with the current time, so "without a moving clock" was wrong. No source, test, CI or settings change. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
krishhgg
marked this pull request as ready for review
October 13, 2026 00:27
After the open thread's watch fails, a shell snapshot or thread update still finds the thread's worktree, or the preparing run the closed watch last saw, and opens another setup subscription. Its running setup then arms the once-a-second tick for a thread whose runs can't change. The first test covers both cases with shell snapshots and updates, and fails until follow_setup skips a closed thread. The second checks that a watch still connecting or reconnecting follows the setup as before, and that another thread, and this one opened again, subscribe. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
follow_setup returned to the thread's worktree or preparing run after the watch failed, so the next shell update opened another setup subscription for a thread whose runs the TUI no longer hears about. It now returns early for a closed watch. Watch::close stays reversible, so a healthy thread that loses and regains its worktree still subscribes again, as do watches that are connecting or reconnecting and a thread opened again. Co-Authored-By: Claude Opus 5.5 (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.
Shows the selected thread's worktree setup under its first prompt, with stage status and elapsed time, checkout progress, the last four script-output lines, and expandable branch, base, path and command details. Press
win the transcript or click Details. A script still running after the agent starts has a compact row whose Details opens the stages.Stacked on #26. Merge order is #23, #24, #25, #26, then #27. Only the user merges.
Sol verified formatting, strict Clippy and all 376 tests at
74d9f68. The new regression fails on the old implementation at90f6f50and passes with the fix. The connecting, reconnecting and reopening control passes on both. CI passes on macOS and Linux, and Greptile has resolved its sole finding.Verification and seven captures · 18-second capture slideshow
The gallery records source
621e8ac. The later fix changes subscription eligibility only. Sol also tested74d9f68in the real TUI against the isolated fake server: closed worktree and preparing-run watches stayed closed through later shell updates, retained cards caused no idle output between samples, and switching away and back opened one fresh setup watch.What I noticed
#26 supplied the progress stream, but the TUI showed no setup card or failure output.
How I confirmed it
Compared the pinned nightly
f570bd2contracts,WorktreeSetupTracker.ts,worktreeSetup.ts,ChatView.tsx,MessagesTimeline.logic.tsandWorktreeSetupCard.tsx. Sol checked lifecycle changes, Details controls, thread switches, sequence resets, reconnects, refusals, Unicode, control text and resize/draft preservation down to 10×5.Options
Reuse #26's read-only subscription and keep one bounded setup per open thread. Place the card in the transcript, with an inline expandable row for a background script. Compare progress sequences within a subscription epoch because null and a server restart can reset them. Keep normal eligibility changes reversible; skip permanently closed thread watches.
What review changed
Sol corrected README claims about offscreen Details controls and elapsed labels on other redraws. Claude added the inspected captures and verification record. Greptile found that a shell update could reopen setup watching after the thread watch failed. Claude added a closed-thread guard and two offline tests in separate commits. Sol confirmed failure before the fix, all 376 tests afterward, and both failure cases in the built TUI. Greptile resolved the finding.
Known limits
Preparation actions and terminal access remain for later PRs. This finishes progress display only. The card has its own title row, Details opens below its control, and follow-up retirement waits for the prompt in T3's projection. Small windows clip content. Any setup stream error disables further setup subscriptions until restart. A closed thread needs a fresh thread watch; selecting the already-open thread only focuses the composer, so switch away and back. Verification uses synthetic data and rendered terminal cells; the video is a static capture slideshow. No real setup or performance measurement ran.

Confidence Score: 5/5
The PR appears safe to merge; the previous finding is fixed and no new actionable issues remain.Summary
Adds a read-only worktree setup card under the open thread’s first prompt.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD Open[Open thread with worktree or preparing run] --> Watch[Watch setup progress] Watch --> Card[Show setup card under first prompt] Card --> Details[Expand details with w or click] Failed[Thread watch fails] --> Close[Close setup watch] Close --> Guard[Ignore later requests to reopen setup watching] New[Open another thread] --> OpenReviews (2) · Last reviewed commit: "tui: a closed thread watch opens no setu..." · Reviewed by Greptile