Keep the review after a send and never hand a prompt to a shell pane - #1321
Merged
Conversation
Sending a review erased it while the agent received nothing. Two causes. A resolved sendAgentMessageNow was treated as proof of delivery: it drops the AgentPromptDelivery the backend returns, so the renderer wiped inlineComments on every resolve. Even a tmux 'delivered' verdict only means the keystrokes were accepted, not that the agent read them. Every send path now stamps sentAt and keeps the text; clearing stays the confirmed Reset review. resolveAgentPromptTargetPane fell through to the session's active pane whenever a task had two or more live agent panes and no recorded focus, so a hand-off could be typed into a focused shell split and still report success. The active pane now wins only when it is itself an agent pane, otherwise the first live agent pane does, and both fallbacks log the pane they picked.
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.
Follow-up to #1319. A reviewer pressed "Send to agent" on a diff review: the agent received nothing and the whole review was erased. Intermittent — the next attempt worked. Two independent defects sat on the same path.
1. A resolved RPC was treated as proof of delivery.
sendAgentMessageNowdiscards theAgentPromptDeliverythe backend returns and answers only{ spilledPath }, so the renderer could not telldeliveredfromunconfirmedand wipedinlineCommentson every resolve (the auto-clear from #1236). Even a tmuxdeliveredverdict only means the keystrokes were accepted — the agent's TUI can still drop a paste, which is exactly the intermittent shape of the report.Every send path — per-comment, the composer's
Send now, and the batch — now stampssentAtand keeps the text. Sent comments grey out, leave the export payload and disableCopy/Send; clearing stays the explicit, confirmedReset review. This deliberately reverses #1236's auto-clear: an unprovable delivery may not delete the user's writing.2. A hand-off could be typed into a plain shell.
resolveAgentPromptTargetPanefell through to the session's active pane whenever a task had two or more live agent panes and no recorded last-focused agent. If the user was looking at a shell or dev-server split, the review went there — and tmux reportsdeliveredfor any pane, so the send looked clean and the review then deleted itself. The pre-existing testignores a recorded pane that is live but not a registered agent paneasserted this exact routing; it is now inverted.The active pane wins only when it is itself an agent pane; otherwise the first live agent pane does. The legacy "no agent registry at all" fallback stays, and both fallbacks log the pane they picked so the next report is diagnosable.
Rationale and rejected alternatives:
decisions/2026/08/10/never-destroy-a-review-on-send.md.Suggested by @diverru (Alexander Kiselyov)