Repository navigation
feat(web,mobile): show worktree setup progress instead of "Thinking" - #235
Merged
Merged
Conversation
While a new worktree thread is created and its setup script runs, the chat showed "Working… / Thinking" as if the agent already had the prompt. The durable bootstrap already tracks worktree, setup and agent phases on the execution intent; the UI now uses them. - Web: the working row becomes an expandable "Setting up workspace" checklist (worktree, setup script with Show output, agent start). It collapses to a "Workspace ready" checkmark once the agent takes over, and "Thinking" only appears once the agent turn is running. - Mobile: the floating status pill names the current step and the feed holds back the Thinking row until the agent starts. - Server: publish the execution snapshot when the setup step starts, so clients see "worktree created, setup running" live instead of only at the end of preparation. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: unavailable · PR result: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
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.
Problem
When the first prompt of a new worktree thread is sent, the server creates the worktree and runs the setup script (often a multi-minute install) before the agent receives the prompt. During all of that, the chat showed "Preparing for 40s" plus a "Thinking" row, as if the agent were already working. The only hint of setup was a one-line "New worktree is being prepared" banner. The durable bootstrap already records
worktreePhase/setupPhaseon the execution intent; the UI just didn't use them.Fix
@t3tools/client-runtime/state/workspace-preparation):deriveWorkspacePreparation(intent)turns the intent's bootstrap phases into a worktree → setup → agent checklist, a one-line label, and anagentStartedflag. Returnsnullfor turns that prepare nothing, so ordinary turns are untouched.prepareDurableBootstraprefreshes the execution snapshot when the setup step starts. Before this, step changes inside one preparation pass were never published, so clients could not see "worktree created, setup running" live.The agent still waits for the setup script, as the durable bootstrap already did. No behaviour change there.
Verification
packages/client-runtime/src/state/workspacePreparation.test.ts: 7 cases covering every phase combination.ProviderCommandReactor.test.ts: "publishes the running setup step before the setup script finishes". It fails without the server change (expected ['pending','pending'] to include 'running') and passes with it.MessagesTimeline.test.tsxand thread-bootstrap tests pass. Typecheck passes for client-runtime, server, web and mobile. Fork-marker check passes.🤖 Generated with Claude Code