Repository navigation
refactor(studio): share one plan verdict flow via usePlanVerdictControl - #2324
Merged
kantord merged 1 commit intoOct 15, 2026
Conversation
41 tasks done
This was referenced Oct 14, 2026
kantord
marked this pull request as ready for review
October 15, 2026 08:41
peppescg
approved these changes
Oct 15, 2026
peppescg
left a comment
Contributor
There was a problem hiding this comment.
Thanks Daniel. The shared hook keeps both surfaces' guard and success ordering intact, and the renderHook tests exercise the flow through the fetch boundary rather than snapshotting.
Nit:
apps/web/src/features/chat/use-plan-verdict-control.ts:43:onStartedreceivesresumeFrom, but neither surface reads it; the cursor already travels throughreattachRef. Consider dropping it from the payload, along with theexportonPlanReattach(line 22), which is only used inside the hook.
kantord
force-pushed
the
studio-followups/14-plan-verdict-hook
branch
6 times, most recently
from
October 15, 2026 13:00
2ce9f39 to
70efc91
Compare
kantord
force-pushed
the
studio-followups/14-plan-verdict-hook
branch
from
October 15, 2026 13:26
70efc91 to
3ba0c1c
Compare
…nd side panel usePlanVerdictControl owns the plan verdict POST, the continuation follow, the reattach handed to each surface's watch effect, planUnavailableReason, and the shared messages (now constants in plan-continuation.ts). Each surface supplies only its ledger, active target, and what to do when execution starts. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
kantord
force-pushed
the
studio-followups/14-plan-verdict-hook
branch
from
October 15, 2026 14:01
3ba0c1c to
17a4f1c
Compare
Merged
2 tasks
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.
Summary
One plan verdict flow for the workspace and the side panel, so
planUnavailableReasonand the blocking rule are the same on both surfaces (Escape parity).Part of #2303 ("Tiny follow-up fixes"); it does not close it. This is PR 14 of 14 in a stack of draft PRs, reviewed and merged in order.
What changed
use-plan-verdict-control.tsowns the follow abort,reattachRef,continuationActive,planUnavailableReason,respondToPlan,resetandabort. Each surface passes onlyonStartedplusretract,onUncertain,setControlPending,setErrorandsetNotice.plan-continuation.ts.controlPendinginput (the old blocking rule included it),onUncertain,endContinuation(),sessionIdin theonStartedpayload, and an optionalfollowseam (vi.mockis banned by a lint rule). The watch effects stay where they are and readplan.reattachRef.Behavior changes
The side panel now clears its error when a plan verdict starts (the workspace already did).
Verification
Biome, typecheck, the full Studio test suite and
pnpm generated:checkpass on this branch, run on the assembled stack. The full Playwright suite passes on the stack tip (122 passed, 30 skipped, 0 failed, includingchat-approvalagainst a realmecatedbuild). EightrenderHooktests; seven mutations of the hook were each caught by a test (thesetError(undefined)mutation initially was not, so an assertion was added). Existing behavior-sensitive tests (approval-interactions,plan-review) pass unchanged.Not included
The watch effects and ordinary verdicts, which are not shared between the surfaces.
Fully or partially written by an AI agent.
🤖 Generated with Claude Code