Skip to content

Inbox: the reply's target follows the last agent to write until the person types or picks - #3840

Merged
backnotprop merged 6 commits into
mainfrom
feat/inbox-reply-target-follows
Nov 23, 2026
Merged

backnotprop merged 6 commits into
mainfrom
feat/inbox-reply-target-follows

Conversation

@backnotprop

@backnotprop backnotprop commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

What

In an Inbox thread with more than one agent, the reply's target now follows the newest agent message while the reply is empty and nobody has picked. On a computer the target is the chip at the start of the reply box; on a phone it is the agent control in the box's row. Before, the target was fixed when the box opened.

  • Follows: the newest agent message's session, also when that session has ended, as the default always did. The chip then says "ended", and Send stops once and opens the list, unchanged from main. An ended agent's thread still takes a message that waits for it. Sessions the Inbox wakes itself (Codex, T3, Qwen, Antigravity) drop off the live list after an hour or an Inbox restart, but they can still take a message.
  • Moves nothing: the person's own messages, the Inbox's notes, a permission prompt, a routine's change line, a sessionless script post. Hand-off and taken-over threads keep the words' own default.
  • Holds: the moment the reply holds anything, the target is fixed on the name that was last painted, and nothing that arrives afterwards moves it. "Anything" means a character (a space too), a file, a comment, an answer picked (one still saving included), dictation under way, or a saved draft.
  • Picks: a pick from the list or the Reply arrow on a message also holds, even after its words are deleted. A pick lasts as long as it did before: until a Send, the box closed with no draft, or another thread.
  • Follows again: after the words are deleted without a pick, after a Discard, and after a Send.
  • One agent: a one-agent thread shows no chip, as before. If a second agent writes into it while the person types, the chip appears on the agent the words were going to.
  • The race: a Send keeps the words on the message the chip's default answered when Send was pressed. A thread read landing while the Send is in flight can no longer send them to a newer writer. This also fixes the same window on main. A retry after a refused Send keeps its target and its idempotency key.

The logic moves out of Thread.tsx into packages/inbox/thread/replyAim.ts. Thread.tsx shrinks by 35 lines, and its ceiling is lowered to match.

Tests

  • packages/inbox/replyFollow.test.tsx (DOM, 21 tests) covers:
    • following while empty, on a computer and on a phone;
    • holding once typing starts;
    • the Send race;
    • a file;
    • a pick;
    • a pick in the list and the Reply arrow;
    • following again after deleting the words and after a Send;
    • a draft;
    • an ended writer followed and marked "ended";
    • the person's own messages and notes skipped;
    • a one-agent thread untouched;
    • a second agent joining while the person types;
    • the closed foot's Send with an answer picked on an ended asker's question (it stops once and posts nothing; then the answer goes to the agent picked);
    • a wake-only session that has left the live list and wrote last;
    • a saved answer and a new message arriving in one thread read;
    • an answer still saving;
    • a refused Send, then another agent writes, then a retry with the same target and key;
    • a thread switch and back;
    • a followed agent that ends while the box is empty;
    • followedSession rules.
  • packages/inbox/replyFollowVoice.test.tsx (DOM, 1 test): dictation holds the target while recording and while transcribing.
  • replyRecipient.test.tsx and endedSession.test.tsx are unchanged from main and pass.
  • Run locally, one file each:
Test file Passed
replyFollow 21/21
replyFollowVoice 1/1
replyRecipient 35/35
endedSession 53/53
multiAgentNames 9/9
phoneComposer 15/15
replyFootPhone 26/26
voiceKeptWords 13/13
heldPick 5/5
tests/inbox-structure 5/5
scripts/dom-test-allowlist 1/1
  • tsc --noEmit is clean for packages/inbox.
  • The Playwright suites run in CI only. The recipient e2e specs were read, and none needs a change.

…erson types or picks

In a thread with more than one agent, an empty reply box now follows the
newest agent message whose session can take a reply, so the chip (and a
phone's control) moves when another agent writes while the thread is open.
The moment the reply holds anything (a character, a file, a comment, an
answer picked, a saved draft) or the person picks a target, it stays put.
Deleting the words without a pick, or a Send, lets it follow again.

An ended agent, the person's own messages, the Inbox's notes, a permission
prompt and a routine's change line move nothing. Hand-off and taken-over
threads keep the words' own default. One-agent threads are unchanged; a
second agent writing into one while the person types shows the chip on the
agent the words were going to.

A Send now keeps the words on the message the chip's default answered at
the press, so a thread read landing while it is on its way cannot send them
to a newer writer.

The choice moves out of Thread.tsx into thread/replyAim.ts.
@backnotprop backnotprop added the ci:e2e Run the full browser suite (Inbox window e2e) on this PR label Nov 21, 2026
…ving pick and on dictation

The chip follows the newest agent writer even when its session ended, as
the default always did: it says "ended" and Send stops once and opens the
list. Skipping ended writers sent answers picked on an ended agent's
question to a live agent the window never named, and replies to a session
the Inbox wakes itself (off the live list after an hour or a restart) to
another agent.

A pick still saving and a take of dictation under way now lock the choice
too. The three tests changed for the old skip are back to main's versions.
New tests: the closed foot's Send with an ended asker's answer, a wake-only
session off the live list, an answer and a new message in one thread read,
a refused Send then retry, a thread switch and back, a followed agent that
ends, a saving pick and dictation.
…et-follows

# Conflicts:
#	tests/inbox-size-ceilings.json
… the choice

A pick that came back with its draft (another thread and back, a reload)
was marked as the draft's and let go once the words were deleted, so the
chip moved to the newest writer. Only a choice the box's own content fixed
lets go when the box empties now; a pick or a draft's choice holds until a
Send or a Discard.

A quote with nothing typed (the Reply arrow on the person's own message)
now counts as content: a newer agent message no longer moves the chip
under a visible quote line.
@backnotprop
backnotprop marked this pull request as ready for review November 23, 2026 03:23
@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 4950c00 into main Nov 23, 2026
38 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