Skip to content

Take back restores the person's words, not the body the agent reads - #3738

Merged
backnotprop merged 3 commits into
mainfrom
fix/take-back-restores-your-words
Nov 23, 2026
Merged

backnotprop merged 3 commits into
mainfrom
fix/take-back-restores-your-words

Conversation

@backnotprop

@backnotprop backnotprop commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

What was wrong

When a reply that answered no question was taken back while a question was open, the reply box came back with the person's words and an agent-only sentence ("No new answers in this reply; 1 question is still open. Don't re-ask it; the person will answer in the Inbox."). Take back copied the stored body, and that body is written for the agent. If the person sent it again unedited, the agent read the sentence twice.

Fix

packages/server/inbox-take-back.ts now restores the words the thread view shows:

  • The still-open sentence is removed with splitInboxReplyBody, the same function the thread view uses.
  • The skills block the Send added is removed. The $skill / /skill words stay in the text, which is how the composer stores a skill, so the next Send adds the block again.
  • The quote's lead ("Replying to your message from … (msg_…):") is removed only when the draft gets the quote back. If the box already held a draft, the quote is not restored, so the lead stays in the text and the quote is never lost.
  • A first message started from a PR page keeps the PR's details after the words; only the skills block is removed. The thread view shows the details folded, so they are not agent-only, and sent again they make the thread that PR's own thread again.
  • When nothing is left of the words once the store's sentence is removed (for example a reply that was only a file), a draft already in the box comes back as it was, with no blank lines before it.

A live review comment taken back (packages/review-editor/live/model.ts, commentOfMessage) restored message.body too. It now drops the still-open sentence as well. The PR comment that Post builds (threadForgeText) also took the person's replies raw: a reply to an agent message with a question open would have posted the agent-only sentence to the forge. It now posts the person's words only.

What is stored and what agents receive do not change. Take back exists only in the Inbox, which is Bun-only, so there is no Pi twin. The wire does not change.

Tests

  • packages/server/inbox-take-back.test.ts (starts an Inbox, so it runs in CI only):
    • a real question block, then the reply "Later.": the draft is exactly "Later."; sent again, the stored body has the sentence once;
    • a quoting reply comes back with its quote and no lead;
    • a quoting reply taken back while the box held a draft keeps the lead as text;
    • a reply that names a skill comes back without the block;
    • a thread started from a PR page comes back with its details and without the skills block; sent again, linkInboxPulls ties it to the PR again;
    • the owner's case: Q1 answered earlier, Q2 still open, "Later." comes back alone, and the "No new answers in this reply" sentence appears once after a re-send;
    • a reply of only a file, taken back while the box held a draft: the draft is unchanged.
  • packages/review-editor/live/model.test.ts: the comment's text comes back without the sentence, and the forge text has the person's words only. I ran both locally: they fail with main's model.ts and pass with this change.

The reply draft a Take back fills held the stored body: the still-open
sentence the store writes for the agent, the skills block the Send adds,
the quote's lead, and a PR page's details on a thread's first message.
Sent again, the agent read the still-open sentence twice. The draft now
holds the words as the thread view draws them; a quote comes back as the
draft's quote. A live review comment taken back drops the sentence too.
What is stored and what agents receive are unchanged.
…raft

A thread's first message from a PR page comes back with the PR's details
after the words, so sent again it is that PR's thread again. A reply
whose words were only the store's sentence leaves a kept draft as it
was. Tests cover the owner's case (an earlier answer, one question still
open). The live review posts a person's reply to the forge without the
Inbox's sentence for the agent.
@backnotprop backnotprop added the ci:e2e Run the full browser suite (Inbox window e2e) on this PR label Nov 22, 2026
@backnotprop
backnotprop marked this pull request as ready for review November 23, 2026 02:49
@backnotprop backnotprop removed the ci:e2e Run the full browser suite (Inbox window e2e) on this PR label Nov 23, 2026
@backnotprop
backnotprop merged commit 308994c into main Nov 23, 2026
60 of 65 checks passed
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