Repository navigation
Decision mode on a linked computer's thread - #4066
Merged
Merged
Conversation
Decide these N, the dialog and every answer in it work on a thread whose agent is on a linked computer, through the forward and the outbox as the thread's own answers do. GET /api/inbox/decisions?machines=1 adds each linked computer's decisions (mark "decisions"; an older computer is never asked; one away keeps what it last gave). A Can't do it's reason is kept as that computer's comment draft (door routes GET/POST threads/:id/comment-draft, machine tokens only). While that computer is away a pick, a mark and Send are held and delivered once, in order; Send carries the held answers and its chip says it will send when that computer is back. Held-pick settlement was written twice (the thread's cards and decision mode, the second never settling). It is one module now, heldPicks.ts.
- A held Can't do it keeps its reason until the mark lands there; refused there, the card opens again with its reason and the dialog says why. - A reason for a linked computer's thread is this Inbox's own draft (one file per computer, thread and key), never sent there or held in the outbox; the comment-draft door routes are gone. - A held Send refused there turns its chip to Not sent with Try again, which sends with a new key and counts its answers as unsent again. - The merged read answers from what each computer last gave and reads it again behind; a stalled body never holds it. - A Send while away goes from the thread when its reply box holds words. - Waiting for <computer> is a status line, not an alert. - App.tsx: the dialog's onAway moved to app/decideTuck.ts.
… reason's field open by itself
…ox-decision-mode-linked
Conflicts resolved: the linked marks list keeps main's linked-reads and reply-drafts and adds decisions; api.ts imports both main's linkedReads helpers and rememberDecisionMachines; the docs keep both sides' words; the mobile contract is main's, regenerated with scripts/mobile/all.ts; the size ceilings are main's, with Thread.tsx lowered to its merged size.
…mputers Step 5 failed on two heads with only "Laptop's switch is still on". It now waits for Laptop's line to Studio after the restart in step 4, then checks in order: the pressed window, that computer's saved switch and flip stamp, the other computer's take of the flip, and the other computer's window. A failure now names the side that broke.
…ox-decision-mode-linked # Conflicts: # packages/inbox/decisions/DecisionMode.tsx
…end's key; a held reply is refused with a held pick it relies on Send read the outbox as it was when the dialog opened, so Try again on a held Send that was refused or cancelled replayed its settled key for good. It reads the outbox as it is now. A held reply now relies on the held picks and marks waiting for that machine on the decisions it names. When one of them surely never applied there, the reply is refused with that one's answer and never sent, so it cannot land on an answer made on that machine meanwhile.
…ox-decision-mode-linked # Conflicts: # tests/inbox-size-ceilings.json
…it on screen A pick by a click moves the queue on 350 ms later. That move was never called off, so an Undo, or the card chosen again from All, inside that moment was followed by the move to the next question. The move is now called off when the person moves first (Undo, another card, an action item's card open again).
…efore the window listened shows A window reads its settings at load and opens its event stream only after the first list read lands. A capability switch turned in between (another window, an agent, or a linked computer's flip taken here) is told only to the streams open then, and no frame replays it, so that window's Settings kept the old state until a reload. This is what the two-computer spec's step 5 hit: Laptop's new Settings window kept Decision mode on.
…ox-decision-mode-linked
backnotprop
marked this pull request as ready for review
November 28, 2026 08:37
This was referenced Nov 28, 2026
backnotprop
added a commit
to bendrucker/plannotator
that referenced
this pull request
Nov 28, 2026
…panel swipes and the HTML viewer's lost highlights ui 0.67.0 and core 0.25.35 went to npm on 2026-11-28 with package files that match the v0.29.6 tag (c21f65e), so this pair carries what merged after v0.29.6, up to v0.29.7. core 0.25.36 is additive: the linked mark "decisions" and InboxDecision.machine (backnotprop#4066), DraftFileUploader.previewUrl (backnotprop#4165), and holdingsOf no longer counting a question Mark read closed (backnotprop#4160). No exports subpath changes; nothing removed. ui 0.68.0 is a minor: Escape while an input method composes only ends the composition, and shortcuts skip such keys; holdsImeEscape is new (backnotprop#3689, backnotprop#4162). HtmlViewer treats a collapsed live Range as lost (backnotprop#4152). Compact panels: OverlayScrollArea scrollMemory, SidebarContainer closing and scrollPositions, ActionMenu compactEdgeSwipe, four new hooks and the panel rules in theme.css (backnotprop#2861). useLaunchAnnouncement waits for ready (backnotprop#4067). ui uses nothing new from core; its exact pin follows so a host gets one core. Publish core first. README and HANDOFF name the new pair, and HANDOFF adds what the published 0.25.35 / 0.67.0 already held beyond their notes (backnotprop#4114, backnotprop#4151). bun.lock is bun install's own output: the two package version lines, and six app workspace version lines (0.29.5 to 0.29.7) the release bumps left behind.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This push (fixes after an independent review, 2026-11-28)
packages/inbox/decisions/DecisionMode.tsx: main'sinboxApi.thread(first.thread.id, sendReadMs())(Inbox: a Send always ends when its connection dies without a word #4158) is kept inside this branch's try/catch (the away path), and main'ssendReadMsimport sits beside this branch's imports. No size ceiling moved.sendGroupis auseCallbackover[props.refresh], and App's refresh is stable, so Send read the outbox as it was when the dialog opened. It never saw the settled entry, kept the old key, and the outbox answers a settled key with how it ended ("Cancelled", "Not delivered") every time. Send now reads the current outbox (propsRef.current.outbox, DecisionMode.tsx:570). No other closure in the dialog read a prop that goes stale.packages/server/inbox-outbox.ts, rule 22 ininbox-machines.md) records on a held reply the held picks and marks it relies on: those waiting for that machine on a decision it names (reliedOn, kept asafter). When one of them surely never applied there, the reply isrefusedwith that one's answer and never sent. The window then shows the Send's existing refused state with Try again, and Try again sends under a new key from the thread as it now is. The words come from the pick's own refusal ("Not delivered: …"); no new words.afterlives only in this Inbox's outbox file and is never sent on, so no mark or capability gate is needed. This is the Inbox (Bun only), so there is no Pi twin.INBOX_LINKED_MARKS(decisions) corrected: a Can't do it's reason stays the window's own Inbox's comment draft, with no door route.packages/inbox/decisionHeldRetry.test.tsx(DOM, new file: the dialog's other Send tests start an Inbox): a held Send refused, and one cancelled, then Try again posts a new key. It fails without the fix (the same key is replayed).packages/server/inbox-outbox.test.ts, "a held reply goes only on top of the held picks and marks it carries": a refused held pick takes the reply that names its question with it (kept across a restart, never sent, refused with the pick's answer), and later writes still go in order; a delivered pick lets the reply go; a pick on another message named withmessage_id; an action item's held mark taken back. Three of the four fail without the change.packages/server/inbox-decisions-linked.test.ts(CI only, two real Inboxes): the collision end to end. Laptop's own window picks B while Studio still holds the older revision, Laptop stops, and Studio picks A (held) and sends (held). With Laptop back, both are refused, no reply reaches Laptop, and the question is still B and not sent there. Try again under a new key is delivered. (B is picked just before Laptop stops, not while it is away: Laptop's store sees the same order either way, and the test cannot reach a stopped Inbox's window.)tsc --noEmitpasses for packages/core, server and inbox.inbox-decisions-linked.test.ts,decisionMode.test.tsx,inbox-decisions.test.ts, and every e2e spec. That includes the rewritten step 5 ofinbox-decision-mode-linked.spec.ts, which has never run before: the last head conflicted with main, so GitHub ran no checks on it.Known, not fixed
FAR_REASON_KEYskip incomment-drafts.ts), and stay after an unlink, when reading them gives 404.trusted()treats the two sides differently, so two timed opposite flips can stay different for good.Earlier push (merge of main, 2026-11-27)
packages/core/inbox-types.ts: the linked marks list keeps main'slinked-readsandreply-draftsand addsdecisionslast. Both sides' comment lines are kept.packages/inbox/api.ts: one import line. Main'slinkedReadsimport and this branch'srememberDecisionMachinesare both kept. 2119 lines, at its ceiling, the same as main.tests/inbox-size-ceilings.json: main's values, with Thread.tsx lowered from 5705 to 5694, its size after the merge. No ceiling was raised.docs/agent-guides/inbox-messages.md: the Decision mode paragraph keeps this branch's "one set" sentence and main's newkeepWatchedsentences.docs/agent-guides/server-and-storage.md: main's two reply-draft rows. The comment-draft row is main's, plus this branch'smachinesentence.apps/mobile/contract/generated/swift/Wire.swift,apps/mobile/contract/parity/ledger.json: main's copies, regenerated withbun scripts/mobile/all.ts.scripts/mobile/check.tssays the contract is in step.bun.lock: main's, from the merge. Not edited by hand.inboxApi.replywith its own idempotency key, on main and here alike. Inbox: a Send survives another tab's save of the same answers #4109'ssendOverSameAnswersbelongs to the reply box (useSendReply), and decision mode does not use it on main either.tsc --noEmitpasses for packages/core, shared, server and inbox.inbox-decisions-linked.test.ts,decisionMode.test.tsx,inbox-decisions.test.ts(each starts an Inbox) and every e2e spec.inbox-decision-mode-linked.spec.tsstep 5 fails ("Decision mode is one switch for both"). After Decision mode is turned off in Studio's Settings, Laptop's switch still shows on after 20 s (:343). Steps 1 to 4 pass. The same step failed the same way on 984b94e before this merge, so it is not a flake and the merge did not cause it. The cause is not found. The same flip passes for Checklist ininbox-routines-machines.spec.ts. One difference is that this spec stops and restarts Laptop (steps 3 and 4) before the flip. Until this is fixed, "turning it off on one computer turns it off on both" is not proven for Decision mode.GET decisions.Decision mode on a thread whose agent is on a linked computer: "Decide these N", the dialog and every answer in it work there as they do here. Before this, the button never showed for such a thread, because
GET /api/inbox/decisionslisted only this Inbox's decisions.What a person sees
decisionsmark) is never asked. Its threads show no "Decide these N", and nothing says so.How
GET /api/inbox/decisions?machines=1(packages/server/inbox-decisions-merged.ts) reads each linked computer that lists the newdecisionsmark through its door (GET decisions, machine tokens only, 2 s).404(decision mode off there) gives none.rememberDecisionMachines), so their reads and writes go there.DOOR_WRITES). The only new door route isGET decisions(machineOnly). The reason is a comment draft on the window's own Inbox (machineon the comment-draft route,decision-reason:keys only;inbox-comment-drafts.ts), on no door.machine_offline, so the dialog sends from the thread as it holds it, with the picks and marks still held laid over it (decisions/farThread.ts). The reply then carries every answer the person sees, at the revision each held pick makes there.components/Thread.tsxanddecisions/saves.tseach settled held picks, and decision mode's copy never settled one. A refused held pick stayed drawn as saved, and its raised revision stayed for good. Both now usepackages/inbox/heldPicks.ts.Tests
packages/server/inbox-decisions-linked.test.ts(CI; two real Inboxes linked both ways): each merged read lists the other's decisions withmachine, and a read withoutmachines=1lists only its own.packages/server/inbox-decisions-merged.test.ts: an older computer is never asked. One that is away or slow keeps its last list. One with decision mode off gives none. The merge keeps the order, skips held threads and duplicates, applies the project filter, and drops malformed entries.packages/inbox/decisionFarThread.test.ts: a Send while away carries the held picks at the revision they make there, the held marks, and the latest of two picks. An un-pick or a mark taken back is not sent. A thread of this Inbox, or another failure, never sends from the held model.packages/inbox/decisionSaves.test.ts: a held pick settles. Delivered, it is drawn from the thread again. Refused, it is unpicked, the person is told why, and its revision is given back. Held picks are listed in order for the Send.packages/inbox/decisionReasonDrafts.test.ts: a far thread's reason is read and written on this Inbox, named by that computer, never sent there.tests/e2e/inbox-decision-mode-linked.spec.ts(two compiled Inboxes, Studio and Laptop, linked by the CLI): "Decide these N" both ways, the dialog's writes on Laptop, Laptop asleep then back, and Decision mode flipped across the two windows' Settings. It saves whole-window shots to.local/proof/decision-mode-linked/.e2e: inbox-decision-mode-linked.spec.ts inbox-decision-mode.spec.ts inbox-machines.spec.ts
Not in this PR
commentPictures.tsx). The door routes added here would let it.