Skip to content

tui: worktree setup progress for the open thread - #27

Merged
krishhgg merged 7 commits into
masterfrom
t3term/nightly-worktree-setup-card
Oct 13, 2026
Merged

krishhgg merged 7 commits into
masterfrom
t3term/nightly-worktree-setup-card

Conversation

@krishhgg

@krishhgg krishhgg commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

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 w in 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 at 90f6f50 and 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 tested 74d9f68 in 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.

Worktree setup with stages, script output and expanded Details, rendered from captured terminal cells in an isolated fake-server test

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 f570bd2 contracts, WorktreeSetupTracker.ts, worktreeSetup.ts, ChatView.tsx, MessagesTimeline.logic.ts and WorktreeSetupCard.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.

RetriggerConfidence 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.

  • The open thread shows worktree setup progress under its first prompt.
  • The setup card’s Details row stays in place when it opens or closes.

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] --> Open
Loading

Reviews (2) · Last reviewed commit: "tui: a closed thread watch opens no setu..." · Reviewed by Greptile

krishhgg and others added 5 commits October 12, 2026 16:09
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
krishhgg marked this pull request as ready for review October 13, 2026 00:27
Comment thread src/tui/mod.rs
krishhgg and others added 2 commits October 12, 2026 18:22
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>
@krishhgg
krishhgg changed the base branch from t3term/worktree-setup-stream to master October 13, 2026 06:09
@krishhgg
krishhgg merged commit 194943b into master Oct 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant