Conversation
) A decision POST that failed (the server stopped, or it answered non-2xx) left the page unchanged with no message, so the reviewer believed it was sent. Plan review's approve and deny were worse: a 500 fell through to the Approved / Feedback Sent screen. Every send path now keeps the page and its annotations as they are and shows one persistent toast: Feedback not sent / Approval not sent, why (not running or unreachable, or the status), Retry (the same handler and options again) and Copy feedback (the text the send carried, as the page's own Copy copies it). A successful send dismisses it. Covered: plan approve/deny, annotate and annotate-last feedback and approve, code review send feedback and approve. Client-only; Pi serves the same built HTML.
…#1392) Review findings on the send-failure toast: - Retry could post a second decision beside one in flight (deny, deny, deny on plan review, whose Bun server has no already-decided check, so integrations and the archive ran twice). Each send now brackets itself with sendStarted()/sendSettled(): a send starting takes the toast down, Retry is a no-op while a send is in flight, and the toast goes when the review is decided. Each failure is a new toast id, since a reused id raced sonner's deferred dismissal and the new toast vanished. - The annotate and review servers (Bun and Pi) put code: already_decided on their 409 for a decision after the review was decided. The toast says so and offers no Retry. - Plan review treated any 409 as "The agent revised the plan"; only code: plan_revised is a revision now, so Pi's closed-session refusal gets the already-decided message. - Copy feedback reads the page when clicked, so it copies what Retry would send now. - The toast is 420px on desktop, so the reason fits on two lines.
…ge the viewer CSS)
1 task
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.
Refs #1392 (the feedback-after-disconnect part; the issue's Settings/Obsidian report is separate).
Problem
In
plannotator annotate, with the server process killed and the page still open, Send Feedback failed withERR_CONNECTION_REFUSEDand the page showed nothing, so the reviewer believed it was sent. Plan review was worse: a 500 on approve or deny went straight to the Approved / Feedback Sent screen. Code review set a "Failed to send" string that nothing displayed.What changed
One shared toast,
showSendFailureToast(packages/ui/components/SendFailureToast.tsx, reasons inpackages/ui/utils/sendFailure.ts), on the existing sonner toasts. On a failed decision POST the page and its annotations stay exactly as they were, no sent or closing screen appears, and the toast shows:It stays until dismissed, at the bottom centre (clear of the header and the annotation panel), 420px on desktop. A new failure replaces it, a send starting takes it down, and it goes when the review is decided. No new keyboard shortcuts.
Per app:
packages/editor/App.tsx): send feedback and gate approve. Before, both failed silently.packages/editor/App.tsx): approve and deny. Before, a network error was silent and a 500 showed the Approved / Feedback Sent screen. Only409 code: "plan_revised"now reads as "The agent revised the plan", so Pi's closed-session 409 is no longer mistaken for a revision.packages/review-editor/App.tsx): send feedback and approve. Before, failures were silent.Success behaviour is unchanged.
409 session_mismatchkeeps its reload banner.Server:
code: "already_decided"The annotate and review servers (Bun
packages/server/annotate.tsandreview.ts; Piapps/pi-extension/server/serverAnnotate.tsandserverReview.ts) addcode: "already_decided"to their existing 409 "This review session has already been decided." (another window sent first, or the agent closed it). Pi's plan server already used that code for a closed session. The client shows "This review was already decided, in another window or because its session ended." with Copy feedback and no Retry. The change is additive: the status and theerrortext are unchanged.Drafts
Annotations autosaved before the server stopped come back when the same file is opened again (the e2e proves it). The open page keeps everything in memory, and Copy feedback covers anything added after the server was gone.
Not covered
/api/exit(Close, which sends nothing) and the platform status post after a PR review is posted (fire-and-forget by design). The Bun plan server's/api/approveand/api/denystill have no already-decided guard; the client no longer double-sends, but a server guard would be a separate change.Tests
packages/editor/App.decisionControl.test.tsx,App.planDecisionControl.test.tsxandpackages/review-editor/App.decisionControl.test.tsx. They simulate fetch rejecting and a 500 for annotate, annotate-last, gate approve, plan approve/deny and review send/approve, and they cover:already_decidedrefusal not being read as a revision.The first nine fail on the code before this change.
tests/e2e/annotate-send-failure.spec.ts, against the compiled binary, headless, with a temp HOME andPLANNOTATOR_DATA_DIR,NO_BROWSERandPLANNOTATOR_INBOX_CONNECT=0. Two tests:Screenshots
1440×900, written by the e2e (local paths):
/tmp/feedback-send-fail/shots/annotate-send-failure-light.png/tmp/feedback-send-fail/shots/annotate-send-failure-dark.png/tmp/feedback-send-fail/shots/annotate-send-already-decided-light.pngThe docs paragraph "A decision that does not land" is in
docs/agent-guides/server-and-storage.md.Approved by the owner in the Inbox, 2026-10-27