Skip to content

Inbox: a held row's state follows a delivery; only the order waits for an action - #1772

Merged
backnotprop merged 1 commit into
mainfrom
fix/inbox-row-reflects-delivery
Oct 8, 2026
Merged

backnotprop merged 1 commit into
mainfrom
fix/inbox-row-reflects-delivery

Conversation

@backnotprop

Copy link
Copy Markdown
Owner

What

Found in the 0.28.8 release smoke: after the person's reply reached the agent, the thread pane said "Delivered to Pi/OpenCode, ". The list row still said "Sent · Saved for . It sees it when it checks." for 15–30 s or longer, until a page reload moved it to Quiet. The server was already listing the thread as Quiet, with checked_at set.

Root cause

App.tsx's refreshList(false) is the background refresh each event-stream record triggers. It kept shown, the held sections, exactly as they were, so the rows' state stayed frozen with them. The delivery and agent-read lines did reach the page through the stream and updated latest, which is why the thread pane was right. The row read only shown, which waited for the next action.

Fix

refreshHeldRows(shown, latest) in packages/inbox/held.ts is pure and runs on every background refresh. Each held row keeps its section and its position, but is replaced by its current copy, unless that copy carries new agent activity (a thread an agent started, or a newer agent message). The rule is the same one heldNotice already used, now factored into hasNewAgentActivity.

The held-order guarantee is unchanged:

  • Rows do not move between sections until an action.
  • New agent activity still waits behind "N new in ", with the old row on screen.

A delivered or read row, or one whose thread was resolved, shows its state as it now is, in place.

Tests

  • packages/inbox/held.test.ts: a delivered Sent row updates in place. The order is unchanged, and a row with a newer agent message keeps its old copy and still counts toward "N new".
  • tests/e2e/inbox.spec.ts: new test. The person picks and Sends, and the row says "Saved for Claude Code". The agent then reads the thread, and the row becomes data-section="quiet" and stops saying "Saved for" with no reload and no action, with the row order unchanged. It fails on main: the row stays sent, which I checked against a binary compiled from main's App.tsx. The restart test now looks for the holding row after the reload, because the named thread is Quiet (folded) by then.

The whole inbox Playwright suite passes locally (bun run test:e2e:inbox, 56 tests).

🤖 Generated with Claude Code

…s for an action

The held list kept each row's whole state until the person acted, so after
the agent had the reply (a wake's delivery, wait_for_reply, read_thread)
the row still said "Sent · Saved for <agent>" until a reload, while the
thread beside it said Delivered. A background refresh now replaces each
held row in place with its current copy, unless that copy carries new
agent activity, which still waits behind "N new". Sections and order stay
as they were.
@backnotprop
backnotprop merged commit 5c1ba57 into main Oct 8, 2026
29 checks passed
@backnotprop
backnotprop deleted the fix/inbox-row-reflects-delivery branch October 8, 2026 00:07
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