Repository navigation
fix(dashboard): retire a gone spawn approval everywhere - #20987
Conversation
Separate approval actionability from process liveness. Withdraw a gone decision immediately, then settle its unique run id from authoritative inventory without making unresolved work appear idle. Share the state across composer, activity, counts and Reload. Preserve retryable failures and report liveness failures, prevent retired markers from returning after launch, and cover reconnect and cross-surface races. Co-authored-by: Bolin Chen <bolichen@amazon.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Design Review (Opus 5.5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS The phantom-card sweep for every card stops checking Watch
Suggestions
[DESIGN-REVIEWED] 1a7bf1e Description read[DESCRIPTION-READ] cabb6a92c97777090eff58cc016378caed30f32248bec622f24708e81d4bb3da That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The activity card adds its own 30 s Not justified as shipped
What this change shipsInventory (9 items) — 7 justifiedIntent: when a spawn approval is gone, remove its Approve/Reject buttons everywhere without claiming the sub-agent never ran — a FIX (#20985).
[FIRST-PRINCIPLES-REVIEWED] 1a7bf1e Description read[DESCRIPTION-READ] 111fe4678145c705a84374cb498cf743278a876f3d589c297b5ad084e0428bf2 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS The gone-approval refusal names no task, so beside live approvals it reads as being about them. "No record" and repeated liveness notices leave the reader unsure what happened. Watch
Suggestions
[UX-REVIEWED] 1a7bf1e Description read[DESCRIPTION-READ] a0bf346ee177bcdfb480e378c95069551bf6e6eedecf67f3d84f7a2022fa029b That sha256 names everything this verdict read: the PR description, plus the 17 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ human override acceptedHuman judgment by @iamwhatever overrides the GPT 6.1 finding for [GPT-OVERRIDE] 1a7bf1e This comment is updated in place on each push. The model was not re-run because an authorized human decision supersedes it. False positive or not applicable? A repository writer can comment: |
9447986 to
442900f
Compare
The progress bar's liveness-failed flag was cleared only by its own 30s poll succeeding. A spawn frame or the activity card's re-read can settle the last gone approval first, so the flag outlived the cards it described and the next refusal showed "Couldn't check whether it started" before any read for that card had failed. Reset it whenever the unresolved count reaches zero. Restore the fake clock in the liveness re-read test through onTestFinished instead of a finally. That section awaits waitFor, and a test that times out never reaches its finally, so every later test in the file would run on the fake clock. Per maintainer review: the refused request now reports itself once, on the surface that sent it (the composer or the pressed card), not also on the progress bar and the other card. A retired card reads "No record" instead of "Never started": an absent inventory row can also be a run the gateway no longer retains. On the composer the failed liveness read after a refusal gets a notice of its own: it used to overwrite the shared approval notice a microtask after the refusal was shown, which left no surface reporting the refusal at all. Match the progress bar's phantom sweep against live rows by run id, as the gone-approval branch already does. Its dashboard-parent filter marked a cron-born or nested run failed on the poll after it was settled to running, and "Dismiss done" would then cancel it. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Leon <leon.lai.yc@gmail.com>
442900f to
1a7bf1e
Compare
|
Disposition for the GPT 6.1 finding on |
|
/ai-review override gpt 1a7bf1e: The flagged silent catch is main's own poll catch from #8743, kept byte-for-byte and not changed by this PR. #8743 made it silent on purpose: the poll only removes phantom cards and the user asked for nothing. First Principles blocked the earlier version that reported it, as reversing #8743. The PR's new gone-approval path does report via ErrorNotice. |
Human judgment recorded@iamwhatever marked the gpt AI finding as false positive, not applicable, or explicitly accepted for
This decision applies only to this commit. A new push requires a new judgment. |
mbriones98
left a comment
There was a problem hiding this comment.
Checks green and readiness passed at 1a7bf1e; no behavior change.
Problem / Motivation
Goal: Withdraw a stale or terminal spawn-approval decision on every dashboard surface without falsely declaring that the sub-agent never ran.
A terminal refusal for a spawn approval (
404 not found or expired) closes the decision, but it does not prove that no process launched: another browser can approve the same id first. Onmainonly the activity panel's refusal text was fixed (#13813). The composer banner, progress bar, sidebar counts, command center, Reload gate and tip suppression still either keep a pending zombie or read the chat as idle while a sub-agent may be running.Why it matters
Approval actionability and process liveness are different authorities. Every surface must agree during the cross-tab race and after the spawn manager answers; otherwise users see dead Approve/Reject buttons or a chat that looks idle mid-run.
Not a goal
What changed (motivation → approach → change)
This replaces #13881 by @leonlaiyc (with @bolichen97), re-homed onto current
main. Both original commits and their authorship are kept.markSubagentApprovalGone).GET /api/spawnanswers (reconcileGoneSubagent→reconcileSubagentApprovalGone). The record is matched by run id, so nested, cron- and channel-born runs work. A still-awaiting_approvalrow stays unresolved; a launched row becomes running/tool; a finished row adopts itsoutcome; an absent row retires the card.isActiveSubagent,isSpawnApprovalGone,isSpawnApprovalRetired,selectSlotSubagentsActive). A retired card shows no run usage, is not tallied as stopped, and "Dismiss done" clears it locally without a DELETE.catchfrom fix(chat): route error states through ErrorNotice (batch chat-2) #8743 unchanged. The liveness check for a gone (404) approval is its own handler on the same read: it runs only while a gone card waits, raises "Couldn't check whether it started. Retrying…" when the read is refused, and clears it when one answers.Re-homing onto
main(the fork was ~1226 commits behind):website/src/pages/ChatPage.tsx: main moved the active-slot state, including tip suppression, intowebsite/src/pages/chat/page/activeSlotState.ts. The PR's switch of tip suppression toselectSlotSubagentsActivenow lives there.website/src/store/chatSlice.tsandchatSlice.publicSurface.test.ts: union of main's new exports and this PR's.retry_failed_errorkept; the two new liveness keys added after it.docs/system-specs/modules/subagent.md: main's tool-call timeline paragraph kept; this PR's paragraph follows it.temp-screenshots/; this PR attaches freshly captured frames instead and commits none.Backwards compatibility
Compatible: the added gone/retired markers are optional fields; existing live/terminal states keep their behaviour, and fresh approval/spawn events supersede the scoped gone verdict.
Removes nothing: the change adds state and predicates; no key, route, record or public export is removed or renamed.
Tests
SubagentProgressBar.parkedApproval: "stays silent when the failed poll had no gone approval to settle (fix(chat): route error states through ErrorNotice (batch chat-2) #8743)" pins the generic poll's silence; the gone-card liveness tests pin the reported path.subagentActivity,chatSlice.ownership,chatSlice.publicSurface,ChatSliceCoverage,chatSlice.activity,ActivityViewerCoverage,ChatInput.approval,SessionActionsMenu.errorHandoff,SubagentProgressBar.parkedApproval,SubagentRunCard,UseWebSocketCoverage,commandCenterModel.tsc -p tsconfig.app.jsonclean; ESLint on touched files clean;src/i18nsuite 1018 passed;i18n:check,lint:i18nandcheck_feature_map.pypass againstorigin/main.Manual verification
website/scripts/capture-spawn-approval-gone.mjsmounts the real ChatInput, SubagentProgressBar and ActivityViewer on one store (website/capture/spawn-approval-gone.tsx) and asserts each frame's state before the shot. Re-run on this branch's head: all 14 frames (7 scenarios × dark/light) passed their assertions, including the refusal sentence on exactly one surface and a retired card reading "No record".Screenshots / video
Dark
Light
Related Issues
Fixes #20985
Replaces #13881 — original work by @leonlaiyc, with @bolichen97. Follow-up to #13813 / #11180.
Pattern harvest
Not generalizable: the defect is one specific conflation (a decision refusal read as process termination) across this one sub-agent state model; the fix is a shared predicate set, not a pattern a lint rule can catch.
Checklist
Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.