Skip to content

Let a teammate's shared machine run the Planner of a document whose creator has none - #736

Merged
lavaman131 merged 2 commits into
mainfrom
fix/default-machine-teammate
Oct 28, 2026
Merged

lavaman131 merged 2 commits into
mainfrom
fix/default-machine-teammate

Conversation

@lavaman131

Copy link
Copy Markdown
Collaborator

A document on Default machine ran its Planner only on its creator's machines.
When a teammate without a paired machine created a document, its Planner never
started, even with someone else's machine paired, connected and able to run
Planners in the same repository. Chat stayed on "Planner: none attached".

A machine's owner can now share it with teammates. Shared, it runs the Planner
of a document on Default machine whose creator has no connected machine that
can, as its owner, only in repositories its owner can push to. Sharing is off
unless the owner turns it on.

Routing (apps/server/src/experiments/routes.ts):

  • Default machine keeps the creator's own machine first. With none that can
    run Planners, it takes a teammate's shared one, each owner's favorite first.
  • Before using a shared machine for a repository, Chopin checks with the
    machine's own GitHub token that its owner can push there (documentAccess),
    and keeps the answer for 10 minutes, or 1 minute after a refusal. Opening or
    asking the document checks again once it lapses.
  • A document opened before the shared machine connected, or before it was
    shared, is asked again as the machine connects or is shared.
  • Once the creator connects a machine of their own, the Planner moves there,
    unless it is already attached on the shared machine; then it stays.
  • Turning sharing off stops the Planners the machine runs for teammates and
    tells the connector " stopped sharing with teammates".
  • A document whose creator chose a machine never uses a shared one, and
    builds, runs and investigations still go only to the presser's own machine.
  • The machine button's Planner state names the teammate while it starts:
    "starting" with their login.

Storage: machines.shared (migration 028_machine_sharing, default false), set
by POST /api/connector/machines/:id/shared for the owner only, and by pairing
(a key minted with shared, or approval with shared). Live connections
follow a change at once.

Interface (DESIGN.md patterns, no new tokens):

  • Machines table: a Teammates column with the same switch the Add server page
    uses, named "Share with teammates", changed at once like the star.
    On a phone, the machine's view has "Share with teammates" with what it does.
  • Pairing card: "Let teammates' documents plan on this machine", off.
  • Add a cloud machine: "Plan teammates' documents", off; the key carries it.
  • UsersIcon for the phone row, in the icon catalogue.

Docs: chopin-cli.md, "Share a machine with teammates".

Screenshots

Machines table, studio shared with teammates:

Machines table with the Teammates column, studio switched on

Add a cloud machine, with "Plan teammates' documents":

Add a cloud machine settings with Plan teammates' documents switched on

A machine's view on a phone:

Phone machine view with a Share with teammates row

Assistant-model: Claude Opus 5.5 (fast)
Assistant-workflow: inline
Assistant-verification: bun test unit passed: GIT_CONFIG_GLOBAL=/dev/null bun test (6746 pass, 0 fail), including 7 new shared-machine dispatch tests and a pairing-key test
Assistant-verification: PostgreSQL contract passed: bun test apps/server/src/storage/postgres against postgres:17 (123 pass), including migration 028 and the share contract
Assistant-verification: Chromium E2E passed: bun run e2e e2e/machines.e2e.ts e2e/connector.e2e.ts e2e/planner-picker.e2e.ts (16 pass); the table switch saves and survives a reload, a key minted shared pairs a shared machine, both pairing switches start off
Assistant-verification: typecheck and lint passed: bun run types and bun run ci (design contract renewed for UsersIcon and two shifted owners)
User-preference: A teammate without a machine of their own should get a Planner on a teammate's designated default machine, only when its owner opts in
Co-authored-by: Alex Lavaee lavaman131@github.com

…reator has none

A document on Default machine ran its Planner only on its creator's machines.
When a teammate without a paired machine created a document, its Planner never
started, even with someone else's machine paired, connected and able to run
Planners in the same repository. Chat stayed on "Planner: none attached".

A machine's owner can now share it with teammates. Shared, it runs the Planner
of a document on Default machine whose creator has no connected machine that
can, as its owner, only in repositories its owner can push to. Sharing is off
unless the owner turns it on.

Routing (apps/server/src/experiments/routes.ts):

- Default machine keeps the creator's own machine first. With none that can
  run Planners, it takes a teammate's shared one, each owner's favorite first.
- Before using a shared machine for a repository, Chopin checks with the
  machine's own GitHub token that its owner can push there (documentAccess),
  and keeps the answer for 10 minutes, or 1 minute after a refusal. Opening or
  asking the document checks again once it lapses.
- A document opened before the shared machine connected, or before it was
  shared, is asked again as the machine connects or is shared.
- Once the creator connects a machine of their own, the Planner moves there,
  unless it is already attached on the shared machine; then it stays.
- Turning sharing off stops the Planners the machine runs for teammates and
  tells the connector "<owner> stopped sharing <machine> with teammates".
- A document whose creator chose a machine never uses a shared one, and
  builds, runs and investigations still go only to the presser's own machine.
- The machine button's Planner state names the teammate while it starts:
  "starting" with their login.

Storage: machines.shared (migration 028_machine_sharing, default false), set
by `POST /api/connector/machines/:id/shared` for the owner only, and by pairing
(a key minted with `shared`, or approval with `shared`). Live connections
follow a change at once.

Interface (DESIGN.md patterns, no new tokens):

- Machines table: a Teammates column with the same switch the Add server page
  uses, named "Share <machine> with teammates", changed at once like the star.
  On a phone, the machine's view has "Share with teammates" with what it does.
- Pairing card: "Let teammates' documents plan on this machine", off.
- Add a cloud machine: "Plan teammates' documents", off; the key carries it.
- UsersIcon for the phone row, in the icon catalogue.

Docs: chopin-cli.md, "Share a machine with teammates".

Assistant-model: Claude Opus 5.5 (fast)
Assistant-workflow: inline
Assistant-verification: bun test unit passed: GIT_CONFIG_GLOBAL=/dev/null bun test (6746 pass, 0 fail), including 7 new shared-machine dispatch tests and a pairing-key test
Assistant-verification: PostgreSQL contract passed: bun test apps/server/src/storage/postgres against postgres:17 (123 pass), including migration 028 and the share contract
Assistant-verification: Chromium E2E passed: bun run e2e e2e/machines.e2e.ts e2e/connector.e2e.ts e2e/planner-picker.e2e.ts (16 pass); the table switch saves and survives a reload, a key minted shared pairs a shared machine, both pairing switches start off
Assistant-verification: typecheck and lint passed: bun run types and bun run ci (design contract renewed for UsersIcon and two shifted owners)
User-preference: A teammate without a machine of their own should get a Planner on a teammate's designated default machine, only when its owner opts in
Co-authored-by: Alex Lavaee <lavaman131@github.com>
… Chromium

hubot creates the document and has no machine; mona's machine can run
Planners. hubot's Chat says "Planner: none attached" until mona turns on
studio's Teammates switch on Machines, then "starting on @mona's machine"
and "mona attached" once the backend attaches; hubot's @chopin reaches it,
and turning the switch off stops it.

Assistant-model: Claude Opus 5.5 (fast)
Assistant-workflow: inline
Assistant-verification: Chromium E2E passed: bun run e2e e2e/planner-picker.e2e.ts (5 pass)
Co-authored-by: Alex Lavaee <lavaman131@github.com>
@lavaman131
lavaman131 merged commit e404f8c into main Oct 28, 2026
24 checks passed
@lavaman131
lavaman131 deleted the fix/default-machine-teammate branch October 28, 2026 19:24
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