diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3559e1266d..8390c285f4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -156,6 +156,7 @@ jobs: packages/inbox/endedSession.test.tsx packages/inbox/compose.test.tsx packages/inbox/composeThread.test.tsx + packages/inbox/sendNow.test.tsx packages/inbox/pasteFiles.test.tsx packages/inbox/markRead.test.tsx packages/inbox/ack.test.tsx diff --git a/AGENTS.md b/AGENTS.md index c0dae259d8..4b83c88df6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1039,7 +1039,7 @@ A poll answered `superseded: true` (another client polled the server after us) waits 10-15 s before polling again, instead of taking the server back at once and starting a busy loop with the other client. -**The Plannotator Inbox (`plannotator_inbox` and the reply wake, `inbox.ts`).** Where `PLANNOTATOR_INBOX_TOOL` / `inboxTool` allows it at the first `session.start` (on by default here), `register.ts` reads the Inbox's tool list once (`discoverInboxTools`: `tools/list` on its `/mcp`; a stopped Inbox is described by the list it last answered with, kept in `$.store` as `inboxTools`; with neither, the list bundled with the mod, `INBOX_DEFAULT_TOOLS` in `inbox-default-tools.ts`, generated from a real Inbox by `bun run scripts/sync-mod-inbox-tools.ts` and pinned to one by `inbox-default-tools.test.ts`) and registers `plannotator_inbox` (`inboxAgentTool`), a SEPARATE tool, never actions on `plannotator`. So Claude Code has the tool before this computer ever ran the Inbox: the first call starts it. With no `inbox/inbox.json` the link stays silent: no HTTP request and no file (no lease, no claims folder) until a call starts the Inbox, and the wake polls from the next tick after. With the tool, `inbox/inbox.json` present at the first `session.start` (an Inbox has run here) and `inboxReminder` on (default), a `prompt.context` hook adds the `plannotatorInbox` block (`withInboxReminder`, the line naming the tool's registered full name) to the conversation's first message, once per conversation (see `inboxReminder` under Config-only settings). The session's `PlannotatorMod` owns an `InboxLink` (one per session id, so `/clear` and an in-process resume follow the new id: the old link is disposed at `session.end` and the next hook makes one for the new id). A call (`tool.call`, answered by the mod) re-reads the registry, checks health against its `serverSession`, starts a stopped Inbox with `plannotator inbox --background` (a one-shot that detaches the Inbox into its own session and waits for it; never a browser tab), and proxies to `/mcp` with `project_path` = `$.session.cwd()` (or the agent's optional `project_path`, resolved against it by `INBOX_PROJECT_DIR_SCRIPT` and refused before the Inbox is reached when it is not an existing folder) and `agent_session` = the host's real session id; `wait_for_reply` is held to 25 s through the tool (`$.http.fetch` gives up at 30 s). The wake: a 1 s `$.clock.every` tick long-polls `/api/inbox/bridge/poll` (20 s) with a 5 to 60 s backoff that never gives up; a reply waits in the mod until the session has been idle for two ticks (a pending `$.prompt.submit` cannot be withdrawn, so a prompt the person typed, or a `/clear`, queued during a turn goes first), is checked once more with the Inbox (an agent may have read it meanwhile), claimed once across processes (`INBOX_CLAIM_SCRIPT`: mkdir of `claude-code-mod//inbox/claims/`), submitted (`inboxWakeText`), and acknowledged (`delivered`, retried until the Inbox answers). A prompt typed into the reply's own turn takes it over as Claude Code folds it in; the mod never aborts it and never delivers the reply again. Two processes on one session: the session's inbox lease (`claude-code-mod//inbox/watcher.json`, the rules of the review watcher lease: the person's last process wins, 20 s stale) picks the one that polls and delivers, and the claim makes a lease race harmless; a claimant writes `alive` while its turn waits, and a reply whose claimant stopped for 60 s without `delivered` is reported once with a toast (the only toast the connection raises); one marked `delivered` whose acknowledgement was lost is acknowledged by the other process. Nothing touches the system prompt; the tool list is fixed per process. Version skew: an Inbox without the bridge route (404) just leaves the poll backing off; an action the running Inbox lost answers "update Plannotator"; a `plannotator` without the `inbox` subcommand answers that the binary has no Inbox. +**The Plannotator Inbox (`plannotator_inbox` and the reply wake, `inbox.ts`).** Where `PLANNOTATOR_INBOX_TOOL` / `inboxTool` allows it at the first `session.start` (on by default here), `register.ts` reads the Inbox's tool list once (`discoverInboxTools`: `tools/list` on its `/mcp`; a stopped Inbox is described by the list it last answered with, kept in `$.store` as `inboxTools`; with neither, the list bundled with the mod, `INBOX_DEFAULT_TOOLS` in `inbox-default-tools.ts`, generated from a real Inbox by `bun run scripts/sync-mod-inbox-tools.ts` and pinned to one by `inbox-default-tools.test.ts`) and registers `plannotator_inbox` (`inboxAgentTool`), a SEPARATE tool, never actions on `plannotator`. So Claude Code has the tool before this computer ever ran the Inbox: the first call starts it. With no `inbox/inbox.json` the link stays silent: no HTTP request and no file (no lease, no claims folder) until a call starts the Inbox, and the wake polls from the next tick after. With the tool, `inbox/inbox.json` present at the first `session.start` (an Inbox has run here) and `inboxReminder` on (default), a `prompt.context` hook adds the `plannotatorInbox` block (`withInboxReminder`, the line naming the tool's registered full name) to the conversation's first message, once per conversation (see `inboxReminder` under Config-only settings). The session's `PlannotatorMod` owns an `InboxLink` (one per session id, so `/clear` and an in-process resume follow the new id: the old link is disposed at `session.end` and the next hook makes one for the new id). A call (`tool.call`, answered by the mod) re-reads the registry, checks health against its `serverSession`, starts a stopped Inbox with `plannotator inbox --background` (a one-shot that detaches the Inbox into its own session and waits for it; never a browser tab), and proxies to `/mcp` with `project_path` = `$.session.cwd()` (or the agent's optional `project_path`, resolved against it by `INBOX_PROJECT_DIR_SCRIPT` and refused before the Inbox is reached when it is not an existing folder) and `agent_session` = the host's real session id; `wait_for_reply` is held to 25 s through the tool (`$.http.fetch` gives up at 30 s). The wake: a 1 s `$.clock.every` tick long-polls `/api/inbox/bridge/poll` (20 s) with a 5 to 60 s backoff that never gives up; a reply waits in the mod (unless the person pressed Send now: see "Questions and Send"; the mod then puts it into the running turn with `$.session.append`) until the session has been idle for two ticks (a pending `$.prompt.submit` cannot be withdrawn, so a prompt the person typed, or a `/clear`, queued during a turn goes first), is checked once more with the Inbox (an agent may have read it meanwhile), claimed once across processes (`INBOX_CLAIM_SCRIPT`: mkdir of `claude-code-mod//inbox/claims/`), submitted (`inboxWakeText`), and acknowledged (`delivered`, retried until the Inbox answers). A prompt typed into the reply's own turn takes it over as Claude Code folds it in; the mod never aborts it and never delivers the reply again. Two processes on one session: the session's inbox lease (`claude-code-mod//inbox/watcher.json`, the rules of the review watcher lease: the person's last process wins, 20 s stale) picks the one that polls and delivers, and the claim makes a lease race harmless; a claimant writes `alive` while its turn waits, and a reply whose claimant stopped for 60 s without `delivered` is reported once with a toast (the only toast the connection raises); one marked `delivered` whose acknowledgement was lost is acknowledged by the other process. Nothing touches the system prompt; the tool list is fixed per process. Version skew: an Inbox without the bridge route (404) just leaves the poll backing off; an action the running Inbox lost answers "update Plannotator"; a `plannotator` without the `inbox` subcommand answers that the binary has no Inbox. **Tests.** Bun: `apps/hook/hooks/mod/*.test.ts` (controller flows over an in-memory `Host`, delivery, shell words, and `bridge.test.ts` against the REAL @@ -2132,7 +2132,7 @@ Sorting and the rest: - the "Guided review" mark when the thread carries one - the time - A Sent row reads "Saved for . It sees it when it checks." Quiet is folded. + A Sent row reads "Queued for ; it gets this as its next turn." when the reply goes to a session whose connection wakes it (the row's additive `sent.wakes`), else "Saved for . It sees it when it next reads this thread." (`sentRowLine`, `packages/inbox/deliveryLine.ts`). Quiet is folded. - The look of a row (design record "inbox-polish", approved 2026-10-15, not in this repo; `inbox.css`, `components/InboxList.tsx`): - Hover and the selected row are a pill 3 px inside the row (its `::before`, radius 8, no border; variant A): hover muted 45%, selected `--ib-sel` (primary 10% light, 15% dark; 14% / 19% hovered). The separators run unbroken under it. The Decisions page's rows (`.ib-drow`) use the same rule. - The thread chip is left out when the subject already starts with the thread's name (`chipName`: compared by `inboxThreadNameKey`, and only where the subject ends there or goes on with a space, or with `:`, `-`, `–` or `—` and a space, so `v2` stays beside "v2.1 release" and `auth` beside "auth-service down"), on the wide, two-line and phone rows. @@ -2199,7 +2199,8 @@ Sorting and the rest: - The reply box with its "N picks" and "N annotations" chips. Mod+Enter sends. Its chip row wraps inside the box (`.ib-rfoot`): a chip never shrinks or breaks its label, and the skip chip's sentence wraps inside itself only where the box is narrower than it (a phone). Before this, in the 440 px thread beside a file, "3 annotations" broke over lines and spilled out of the box. `tests/e2e/inbox-attachments.spec.ts` checks the chips stay inside the box at 440 px, 1440, 810, 900, 390 and 320. The no-wrap applies to the chips only, never to the "N annotations ride this reply" list (`.ib-annpop`), whose quotes and comments wrap; where that list would run past the window's right edge it lines up with the reply box's right edge (`--ib-annpop-shift`, set by `AnnotationsChip`); the same e2e checks both at every width. - A Send is `POST /api/inbox/messages/:id/reply` with an idempotency key per target message, kept for a retry. The store writes one person reply in this order: its first line (`Answered N questions.`, `Skipped N questions.` or `Answered N questions, skipped M.`, counted by the answers section's own rule, so it never disagrees with "x of y answered"), the person's words, `formatQuestionAnswersSection`, then the annotations' feedback. A reply that sends no answer and no skip (words, annotations, or both) has no first line and no answers section: the person's words, then the still-open line (`inboxStillOpenLine` in `packages/core/inbox-questions.ts`, called by `composeInboxReplyBody`; approval "inbox-words-only-reply", 2026-10-13), then the feedback. The line is "No questions answered yet; all N are still open. Don't re-ask them; the person will answer in the Inbox." (N: every question the replied-to message's session asked in this thread that is still open, or picked and not sent, so words that go to the session's later plain update still count the questions it asked before; another session's questions are never counted, and a message with no session counts only its own; for one: "No question answered yet; it is still open. Don't re-ask it; …"; when an earlier reply already answered some: "No new answers in this reply; N questions are still open. …"); there is none when nothing is left open. `INBOX_STILL_OPEN_LINE` matches it, and the folded line's `replyWords` cuts the reply there, so a snippet shows only the person's words. This holds for every caller, a body with no `skip_unanswered` (the phone door, an older window) included. The wake text is unchanged and carries this body. Plan review's export (`formatQuestionAnswersSection`, `packages/core/question-block.ts`) is untouched. - The sent questions are marked before the reply line lands. When the reply line never lands, they read as picked again, so a retry never reads "already sent" with nothing sent. -- After a Send, the reply shows "Saved for …" until an agent reads it or a connection delivers it, then "Delivered to , 10:52 AM". +- After a Send, the line under the person's last reply or message says where it is (`deliveryLine`, `packages/inbox/deliveryLine.ts`; the owner's request 2026-10-16, "it should say this message is queued up … and then maybe an option just to send it immediately"). For a session whose connection wakes it (a reply to a message with `wakes`, or a message with `to`), the window reads that session's connection every 3 s (`GET /api/inbox/threads/:id/sessions?asker=`, the additive `asker.connection` = `{ busy, idle_since, send_now }` while it polls, null when it does not): "Queued · Claude Code is working; it gets this when its turn ends." with **Send now** (`data-send-now`, only while `send_now`), "Sending to Claude Code…" while idle, "Queued for Claude Code; it gets this as its next turn." when the connection does not say (or an older Inbox), "… when its session is back." when it does not poll, "Sending to Claude Code now…" once Send now was pressed (`deliver_now_at`). A reply to an agent that only reads the thread (MCP, OpenCode 1) reads "Saved for . It sees it when it next reads this thread." Then "Delivered to , 10:52 AM", unchanged. The ended-session and Not delivered lines are unchanged. +- **Send now** (`POST /api/inbox/messages/:id/send-now`, window guards; door 7.58): the store writes `deliver_now_at` on the message (`requestDeliverNow`; a second press writes nothing; `already_delivered`, `not_addressed`), after the server checked the recipient's connection polls now and said it can deliver into a running turn (`send_now_unavailable` otherwise; `recipientOf` names the session). The bridge command carries `now: true` only on a poll that says `send_now` (so a connection that cannot steer never skips its idle wait), and a held poll answers at once. Once a reply carries `now`, the connection delivers the waiting replies at once, OLDEST FIRST (an urgent reply never overtakes an older one to the same session): the Claude Code mod as a user row in the running turn (`$.session.append`, the one way a plugin puts words into a running turn: `$.prompt.submit` never folds into one); Pi as `sendUserMessage(..., { deliverAs: "steer" })`, delivered when Pi starts it (`message_start`); OpenCode 2 as `session.prompt({ delivery: "steer" })`, delivered only on `session.inbox.delivered` for that row id (a `session.inbox.delivery.changed` to `queue` for it counts too: OpenCode will deliver it); when the run ends first and the row is not delivered within `STEER_IDLE_GRACE_MS` (3 s after the end event), it is sent again as a queued turn ending with `inboxRepeatLine`. There is no cap while the run goes on (a tool call may take minutes, and OpenCode promotes the row at the run's next step): a steer still waiting is looked at every `STEER_WATCH_MS` (2 s), a run with no event for `RUNNING_CROSS_CHECK_MS` (20 s) is checked with `session.wait` (idle: the grace starts), and after the event stream ends the row waits until `session.wait` says idle, then counts as delivered when `session.context` holds it (by its id, or a user message with its text), else the queued turn goes. OpenCode cannot withdraw the steer row and promotes it with that turn (#1734, live on 2.0.22), so the plugin's `context` and `generate` hooks drop the later of the two copies from every model request (`dropInboxDuplicates`, the way they drop the session-URL notice; pairs kept for the plugin's life, at most 200); a later copy that is its message's whole content is never removed (the request would end on an assistant message: a wasted turn or a provider error) but replaced by `inboxRepeatPointer`, the same text in every request so the prompt prefix stays stable; idle, as a turn at once. Pi: Esc during the run puts a steer that has not started into the editor (Pi's `restoreQueuedMessagesToEditor`); when the steer's watchdog then finds the session idle without it, the extension takes the reply's exact text back out of the editor (`editorWithout`, the person's own words and other queued messages kept; an edited copy is left alone) and the reply waits for idle and arrives as a follow-up, so it is never sent twice. Pi and OpenCode never steer into this session's own Ask question either: their wake target's `canSteer` is false while it runs (Pi: `isAskActive`; OpenCode 2: `isAskTurnActive`, a per-session mark the session bridge holds while its Ask turn is in progress), so the poll and the wake's `state` events (`InboxWake` now carries `send_now` on them, as the mod does) stop offering Send now and a pressed reply waits for idle. The mod: the decision is taken right before the append, after every await of the delivery (fresh check, lease, claim), from `steerableTurn` = the running MAIN turn that is not this session's own Ask question (so an Inbox reply never streams into the Ask AI panel; while the Ask question runs or waits queued, Send now waits for idle); a turn that ended by then means a turn instead; after the append, a turn that ended or changed means one short pointer turn at once (`inboxSentNowFollowUpText`), else the row is tied to that turn id and a turn that ends with no model request after it gets the pointer (several per turn). A refused append (or a failed steer on Pi or OpenCode) posts `send_now_failed`: the server clears `deliver_now_at` (`clearDeliverNow`), the line reads queued again, and the reply waits for idle. A connection says it can with the poll field `send_now: true` (`INBOX_SEND_NOW_POLL_FIELD`): the mod on an engine at least `SESSION_APPEND_MIN_ENGINE` (2.1.301, the first build whose published API documents `$.session.append`; decided from `$.session.version()`, because `claude plugin validate` refuses reading `$.session.append` as a value) until an engine refuses a row; Pi where the wake target has `steer`; OpenCode 2 while its event stream runs (`canSteer`, how a steer's delivery is seen). OpenCode 1 and older connections never, so Send now is never offered there. Nothing is ever aborted. Claim-once holds: the same claim folder and lease as a normal delivery; the mod refreshes `alive` for the claim it is submitting under, so another process never reports a reply this one is still delivering; a claim it won but cannot use at once (its own Ask question took the turn, a turn started right after the claim, or the append was refused) it gives back (`INBOX_RELEASE_SCRIPT`: the claim folder removed while still its own and neither delivered nor reported), and a process that lost that claim takes the reply back as pending when the folder is gone, so the process the person works in delivers it even when the lease moves while the turn runs. The mod's `send_now` (poll and `state` events) is true only while a reply could go in now, so while this session's own Ask question holds it Send now is not offered and a pressed one reads "Queued", not "Sending … now". The line under the reply also reads "Queued" for a message sent without the wake mark (the stdio shim run inside Claude Code) while its session's connection polls. Tests: `packages/server/inbox-send-now.test.ts` (routes, guards, the poll, `send_now_failed`, agent-link's steer and order), `apps/hook/hooks/mod/inbox.test.ts` 12 to 17 (the mod against a real Inbox: into the turn, the pointer turn, the turn ending before or during the append, the Ask question running or queued, oldest first), `apps/hook/hooks/mod/send-now-engine.test.ts` (the version gate), `apps/hook/tests/register.test.ts` (the engine harness: the row through `$.session.append`; an older engine never offers it), `apps/opencode-plugin/inbox-v2-wake.test.ts` (the steer confirmed by its delivery, and the fallback; a tool call longer than the old 60 s cap with no fallback; the event stream ending mid-run, then the row found in the context or the fallback once idle; the pointer for a whole-message copy), `apps/opencode-plugin/opencode-session-bridge.test.ts` (the Ask turn mark), `apps/pi-extension/inbox-send-now.test.ts` (the steer, delivered on `message_start`; no Send now during an Ask; `editorWithout`), `apps/hook/hooks/mod/inbox.test.ts` 16b (a claim it cannot use given back) and 16c (two processes: the lease moves while the claimant's turn runs, and the other process delivers once), `packages/inbox/deliveryLine.test.ts`, the DOM test `packages/inbox/sendNow.test.tsx`, `tests/e2e/inbox-send-now.spec.ts` (compiled binary; light, dark and a phone). - No tool answers, approves or sends for the person. - **Paste to attach** (the owner, 2026-10-16: "When I'm writing a new message or even a reply, I need to be able to paste in images"). A paste in compose (anywhere in the dialog) or in the reply box (`.ib-rbox`'s `onPaste`) that carries files attaches them through compose's upload path, tiles and progress (`useComposeFiles().paste`, `packages/inbox/compose/ComposeFiles.tsx`; the rules in `packages/inbox/compose/paste.ts`). A clipboard image with a name nobody chose (`image.png`, `Pasted Graphic 2.png`, `blob`, none) is renamed `pasted-image-YYYY-MM-DD-HHMM.` in local time (`pasted-file-…` for anything else), `-2`, `-3` when the name is taken in this message; a real name (a file copied in the file manager) is kept. Text is never taken from the browser, because dictation apps (Hex) write the clipboard, post a synthetic paste and restore the old clipboard about 500 ms later: everything reads `event.clipboardData` synchronously inside the event, never `navigator.clipboard`; a paste of text alone is left to the native path (no `preventDefault`; on Chromium 155-156 on macOS the plain-text insertion below inserts it); a paste of files beside text (an image copied from a page brings HTML, a file from Finder its name) attaches the files and still lets the browser insert the text (`clipboardHasText`); only files with no text is prevented. Text with an unnamed picture is text: a cell copied in Excel, Numbers or Pages carries a picture of itself, which Chromium hands over as `image.png`, so when the clipboard has non-empty `text/plain` only files with a real name attach (`isGenericPasteName`; a screenshot and Chrome's "Copy image" carry no plain text and attach, a Finder copy keeps its name). Each attach by paste is said politely ("Attached "): the thread's live region for the reply box, the dialog's own (`[data-compose-paste-live]`) for compose, since the window's region sits outside the modal dialog. Local previews' object URLs are freed on remove, reset and unmount. No paperclip, drop zone or shortcut in the reply box (the owner asked for paste only). - The reply box's files are tiles inside the box above its chips (`[data-reply-files]`, `.ib-rfiles`; each at least 200 px wide in a row, the whole box when that is narrower: they fit a 320 px phone, and a tile's × takes a 44 px hit area on a phone). They live with the box: Cancel, Escape, a Send and another thread forget them (uploads in flight are aborted; `useComposeFiles().reset`); there are no reply drafts. Send waits while one uploads ("Wait for the files to finish uploading."). The ids ride the reply that carries the words (the last target, with the words and annotations), as `uploads`. A Send clears only the files it carried (`useComposeFiles().forget`): one pasted while it was in flight keeps the box open for the next Send. A retry after a failed Send whose words, files or annotations changed takes a new idempotency key for the reply carrying them (`sendContents` in `Thread.tsx`), so a Send that went through but answered an error is never replayed in place of the changed one. The ended-asker note counts only finished uploads, as Send does. @@ -2218,7 +2219,7 @@ Sorting and the rest: - The thread's foot is `[↩ Reply] [👍 Looks good]` side by side (44 px each on a phone); 👍 is hidden while any question in the thread is open or picked (and while picks or annotations wait to be sent), once the person wrote back (the last message, the Inbox's notes read past, is theirs), on an archived thread, and with no agent message. No new key; the toast's `Z` undoes. - `POST /api/inbox/messages/:id/ack` (`{ serverSession?, ack? }`, `ack: false` takes it back; the window's same-origin and `serverSession` guards) → `InboxStore.ackMessage`: an additive `ack: { label: "Looks good", at, read_seq, made_read, settled_seq, settled_at, seen_at }` snapshot line on the agent's message, plus Mark read (`read_seq` = the Mark read it stands on, `made_read` = the 👍 made it). Undo removes the ack and undoes the Mark read only when the 👍 made it. Move back (`/unread`, `E`) on that Mark read withdraws the ack too, so the agent never sees a 👍 on a thread the person moved back. Refused: `422 ack_not_allowed` (a person's message), `409 ack_stale` (not the thread's latest agent message), `409 ack_after_reply` (a person message, not an Inbox note, follows it: the reply is the answer and keeps its Sent / Delivered state), `409 question_open`, `409 thread_resolved`. A second 👍 writes nothing. In a one-message thread the root is the agent message, so `markRead` re-reads the root after withdrawing. - Inside the Undo window (`setAsideDelayMs`, the set-aside note's 10 s) nothing is sent: the toast's Undo (or `Z`) takes it back with nothing written for the agent. After it, `settleAcks` (swept at start too) writes two lines: the ack with `settled_seq`/`settled_at` and `note_id`, then the note it names, a person's message with `ack_of: `, `reply_to` that message and body `inboxAckLine()` ("The person marked your message 👍 Looks good (). No reply needed unless you have a question."; `packages/shared/inbox/connection.ts`, the mod's copy too). The note rides the reply machinery unchanged, so delivery is exactly once by the existing claim, lease and `delivered` event: `pendingReplies` hands it to the session that wrote the message (`isFor`), and the bridge command is a `reply` with `ack_of`, whose wake (`inboxWakeText`) is `Plannotator Inbox: ()` and the ack line alone (an older connection words it as a reply with the line as the person's words). The note is an Inbox note (`isInboxNote` includes `ack_of`): the list's `sent`, `unseen`, the look and "came back" read past it, `readAt` keeps the thread read, and `thread()` (so the window, `read_thread`, search's thread reads and `threadSummary`'s count and `last_at`) leaves it out; the ack on the message says it. Delivered only while the ack still names it (`ackNoteLive`): a 👍 taken back after it settled (the pressed button, Move back) and before delivery is never delivered, and a later 👍 is a new note. At settle `ackMessage`'s conditions are checked again (`ackNotSentReason`): when the agent wrote again after the message inside the window (the 👍 would read as the answer to the newer one) or the person sent a reply after it (their reply is the answer; the 👍 button is hidden by then, so they could not take it back), the ack settles with `not_sent: "replied" | "wrote_again"` and no note, no agent ever sees it (`agentThread`, `markAcksSeen`, `wait_for_reply`), and the line reads "👍 Looks good · not sent: you replied" / "… not sent: wrote again". Agents also see it in `read_thread` (`ack: { label, at }`, `store.agentThread`) and `wait_for_reply` returns `{ status: "acknowledged", acks: [{ message_id, label, at }], cursor }` for an ack on the caller's latest message (replies first; the note line itself never answers as a reply), which records the note's delivery, so the wake never hands it again; a delivery through the wake marks the ack seen, so neither hands it twice. A wait across every thread the caller asked (no thread id, no cursor) skips an ack already seen; a wait on one named thread keeps answering it. A store from before the amendment replays unchanged: its settled acks have no `note_id`, were never sent, and are not sent now. -- The window: the button pressed (`aria-pressed`, success tint; a click takes it back), a line under the message (`AckPill`, `ackPillLine` in `packages/inbox/components/Thread.tsx`, `data-ack-pill`): "👍 Looks good · You,