Skip to content

Routines and capability switches across linked computers - #3988

Merged
backnotprop merged 13 commits into
mainfrom
feat/routines-across-computers
Nov 24, 2026
Merged

backnotprop merged 13 commits into
mainfrom
feat/routines-across-computers

Conversation

@backnotprop

Copy link
Copy Markdown
Owner

What a person sees

  • Routines lists every linked computer's routines with this computer's. A routine on another computer is named after it: "Nightly build · Studio" (on a phone, after its schedule: "Daily at 9:00 AM · Studio").
  • Every action works on it, from here: Run, Stop, on/off, edit (autosave), Delete and Undo, the schedule preview. A far routine that is running says Running here as well.
  • New routine: pick the computer. The editor's "Runs on this computer while the Inbox is running" line becomes a pick while the routine is new and more than one computer has Routines on. It offers that computer's agents and folders.
  • The thread foot: a far routine's thread now shows Edit and Run once now, not "Routine on Mini. Manage it there."
  • Settings → Capabilities shows, under this computer's switches, one group for each linked computer, headed by its name: "Each switch turns the feature on or off on Studio." Below that line are its switches: Board, Checklist, Routines, Code review, Bro mode, Float reply drafts. Chapter diagrams shows only while Code review is on there, and System only while it is on there.
  • A computer that is away: its routines stay listed as last known. A write is held and the usual toast says "Waiting for Studio: this applies when Studio is back." The write applies when Studio is back. A held create is retried until it lands.
  • An older computer (no routines / capabilities mark) lists nothing and shows no error.

Routes added

All the new door routes are machineOnly, so phones and the relay never reach them. They validate the routine id (sch_[A-Za-z0-9_-]{1,80}).

  • GET scheduled, GET scheduled/:id
  • POST scheduled, POST scheduled/preview, POST scheduled/:id
  • POST scheduled/:id/(on|off|run|stop|delete|restore)
  • GET capabilities (new local route GET /api/inbox/capabilities: the capability switches alone)
  • POST capabilities → /api/inbox/settings, which takes only the switch keys. Any other field gets 422, and the answer carries only the switch keys.
  • Local: GET /api/inbox/scheduled?machines=1, the merged read the window uses.

A routine write that comes through the door is taken only for a press in a window on the linked computer: startsAgentThere carries the window's mark, and the routine routes check it as farWindow. A bare call through the forward gets 403 window_only, as it does locally. No existing check is weakened. Outbox kinds: a create and a run are append, the preview is now, and the rest are set.

New visible words

  • · <computer> after a far routine's name
  • "Runs on while the Inbox is running" (only the computer name is new)
  • The pick's accessible name "Computer" and its option "this computer"
  • "another computer" (fallback name)
  • Each Settings group: the computer's name as heading, then "Each switch turns the feature on or off on ."
  • The existing off note now also shows above far routines

Not included, and why

  • Plans is not in a linked computer's switches. It is config-only and hidden here as well.
  • The native iPhone app: the mobile contract check passes, with the new routes recorded in the contract. The routes are machineOnly, so the app does not reach them. The app would need these routes on the phone allowlist and its own Routines and Capabilities screens. The phone-width web Inbox over the tailnet works (see the proof shots).
  • The agent capability action and the changed agent text come in a follow-up PR stacked on this one, so this one stays reviewable.

Tests

  • Local: inbox-scheduled-machines.test.ts, inbox-outbox.test.ts, listFilter.test.ts, the mobile contract tests, and the DOM tests routinesAcross, scheduledThread, scheduledEditor, scheduledActions, routineTabs, routineAutosave, scheduledRows, scheduledTable.
  • CI: inbox-scheduled-linked.test.ts (two real Inboxes: turning on, create, edit and run on B from A; a bare call refused; B asleep, then a held turn-off applied) and the e2e spec.

e2e: inbox-routines-machines.spec.ts. Proof shots in the inbox-window-proof artifact, routines-across-computers/: 01-settings-linked-capabilities, 02-editor-computer-choice, 03-routines-two-computers, 04-far-routine-running, 05-routines-phone.

…y switches

The Routines page lists linked computers' routines with this computer's,
each far row named after its computer, and every action (run, stop, on/off,
edit, delete, restore, preview) goes to the routine's computer through new
machine-only door routes, held in the outbox while it is away. The editor
picks the computer of a new routine and offers that computer's agents and
folders. Settings > Capabilities shows each linked computer's switches.
@backnotprop backnotprop added the ci:e2e Run the full browser suite (Inbox window e2e) on this PR label Nov 24, 2026
…computers

# Conflicts:
#	apps/mobile/contract/generated/swift/Wire.swift
#	apps/mobile/contract/parity/ledger.json
#	packages/core/inbox-types.ts
…subpath

A new core subpath needs a core release before the UI package publishes, so
the UI package smoke test refused it.
…or not at all, away computers and held writes shown as they are

A held Stop ends only the run it was pressed for. Run once now on a linked
computer is sent at the press or not at all, and says so plainly when that
computer is away. The merged read and the far Capabilities read lay the
person's held writes on that computer's last-known rows and switches, from
the outbox, so a reload keeps them; an away computer's routines claim no run
going and no next run, and say since when it has been away.
useScheduledOn skipped its store hook once Routines were on here (value || useScheduled()), so turning them on changed the Inbox's hook order and broke the window. It now calls one hook every render: with Routines on here it only watches the store (no read the window did not make before), off it reads so a linked computer's routines can offer the page.
…es CI checks

Merged main's routine re-reads (#3979: a run under way, a reconnect, the window shown again) into the store with this
branch's linked-computer reads. Resolved by hand: packages/inbox/scheduled/store.ts, packages/core/inbox-types.ts,
packages/server/inbox-machines.ts, packages/server/inbox.ts, tests/e2e/slice-rules.ts, tests/e2e/shard-times.json and
apps/mobile/contract/parity/surface.json; the ledger and Wire.swift taken from main, then the mobile contract regenerated.

- The routines-machines e2e gives each computer the fake claude on its launch PATH and the plugin in its agent home,
  as a sandboxed Inbox needs (as inbox-routine-row-run-ends.spec.ts): without them a Run there never started. The
  fake's turn holds, so the run stays Running.
- The door table test fills a routine's id (sch_1), so the scheduled/:id routes are checked against their own entries.
- The linked test expects the far switches read's own words (held, away, read_at).
- rowRunEnds' stand-in answers the window's read with ?machines=1, as a server does.
- A forward test: Run once now with that computer online goes there at the press, keyed, with the window's mark.
…cked at B's door

Both Inboxes run in one test process and read one config.json (each is its own process on a real computer), so B's
switch turned on read as A's too. A's switch is held off (options.scheduled), and that the turn went to B, not A's own
settings, is checked in B's door command log. The merged read's computers carry read_at.
…ate; pin it lands once

The run that Run now started on B is still going (the fake agent never ends), so B's row says running whether the routine is on or off. The turn off did land; the test waited for the row's state. It now waits for enabled false. The forward test pins that a held turn off is shown off and running while away, and is taken there once, with the window's mark, across a later reconnect.
…computers

# Conflicts:
#	apps/mobile/contract/generated/swift/Wire.swift
#	apps/mobile/contract/parity/ledger.json
…computers

# Conflicts:
#	apps/mobile/contract/parity/ledger.json
#	docs/agent-guides/server-and-storage.md
#	packages/server/inbox-machines.ts
…rst read of a linked computer's routines read again on the next list

main's onLinkedMachines tells a change only, so the Routines store also hears
each merged list (onLinkedMachinesListed) and reads again while nothing was read.
@backnotprop
backnotprop marked this pull request as ready for review November 24, 2026 15:09
@backnotprop
backnotprop merged commit 0fab4e4 into main Nov 24, 2026
61 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:e2e Run the full browser suite (Inbox window e2e) on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant