Skip to content

Keep the review after a send and never hand a prompt to a shell pane - #1321

Merged
h0x91b merged 1 commit into
mainfrom
fix/dev3-review-send-silent-drop
Aug 10, 2026
Merged

Keep the review after a send and never hand a prompt to a shell pane#1321
h0x91b merged 1 commit into
mainfrom
fix/dev3-review-send-silent-drop

Conversation

@h0x91b

@h0x91b h0x91b commented Aug 10, 2026

Copy link
Copy Markdown
Owner

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. sendAgentMessageNow discards the AgentPromptDelivery the backend returns and answers only { spilledPath }, so the renderer could not tell delivered from unconfirmed and wiped inlineComments on every resolve (the auto-clear from #1236). Even a tmux delivered verdict 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 stamps sentAt and keeps the text. Sent comments grey out, leave the export payload and disable Copy/Send; clearing stays the explicit, confirmed Reset 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. resolveAgentPromptTargetPane fell 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 reports delivered for any pane, so the send looked clean and the review then deleted itself. The pre-existing test ignores a recorded pane that is live but not a registered agent pane asserted 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)

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.
@h0x91b
h0x91b enabled auto-merge (squash) August 10, 2026 12:16
@h0x91b
h0x91b merged commit b481c0e into main Aug 10, 2026
11 checks passed
@h0x91b
h0x91b deleted the fix/dev3-review-send-silent-drop branch August 10, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant