Repository navigation
fix(studio): give a stale plan ask its own error code - #2311
Merged
Merged
Conversation
The plan-ask route returned stale_run_control, the same code as a stale permission ask or run, so clients could not tell them apart. It now returns stale_plan_ask (still 409). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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
approved these changes
Oct 15, 2026
peppescg
left a comment
Contributor
There was a problem hiding this comment.
Thanks Daniel. A small change with a clear reason, and the e2e mock tells plan runs and ordinary runs apart instead of rewriting the code everywhere. LGTM.
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
The plan-ask route returned
stale_run_control, the same code as a stale permission ask or run, so clients could not tell them apart. It now returnsstale_plan_ask(still 409).Part of #2303 ("Tiny follow-up fixes"); it does not close it. This is PR 1 of 14 in a stack of draft PRs, reviewed and merged in order.
What changed
stalePlanAsk()inapps/server/src/routes/chat.tsreturnsstale_plan_ask.failed_preconditionmapping as stale (the only genericfailed_preconditionon this path is a live run owning its plan continuation). It passes before and after; the route test is the regression guard.Behavior changes
POST .../plan-asks/{askId}on a stale or consumed ask returnscode: "stale_plan_ask". Steer, cancel and permission paths are unchanged. Studio's own web code does not branch on the plan code (it was only checked for steer and cancel).API compatibility
This is the Studio BFF
/api/v1contract, not the daemon wire API. The wire-API rule is scoped by path (contracts/proto,internal/adapter/server,engine/*,sdk/typescript/srcand others) and none of those change, so it is not triggered. The change is additive on an open string:codeisz.string(), so the OpenAPI document and generated types are byte-identical. The only observable change is for an external BFF client that matchedstale_run_controlon the plan route.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). With the route code reverted, the plan route test fails.Not included
Any change to permission or run codes, and the daemon wire API.
Fully or partially written by an AI agent.
🤖 Generated with Claude Code