Skip to content

feat: start sessions on any machine from the start page - #180

Merged
sanchitrk merged 2 commits into
canaryfrom
claude/machines-selector-home-composer-fe11ec
Nov 26, 2026
Merged

sanchitrk merged 2 commits into
canaryfrom
claude/machines-selector-home-composer-fe11ec

Conversation

@sanchitrk

@sanchitrk sanchitrk commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

The start page now has a machine and project row above the composer, so a session can start on this computer, a paired machine, or one in the workspace. Everything that new session needs (folders, clones, models, GitHub, project settings) follows the machine picked. Machines are a physical boundary like the project, so they sit above the composer rather than beside the model picker.

Desktop (apps/web)

  • Machine picker: search, This Machine, Recent (machines of the newest sessions), then the workspace's and the paired machines in submenus. A paired machine shows its round trip. One that can't run a session says why (offline, pair again, clock differs, not paired) and opens what fixes it.
  • Add Project browses, creates and clones on the picked machine, lists that machine's recent projects, and offers the native folder dialog only for this computer. It no longer shifts while gh is checked.
  • The sidebar's + and New pick the project's machine and folder, and the chip shows the project's name.
  • Project settings, rename and the model pickers read and write on the project's or session's own machine.
  • Git Changes names the machine instead of "Local". Opening it from a session's menu no longer jumps to another tab that has the same space open, and no longer clears the sidebar's selection while it has focus.
  • A new session opens with its first prompt in place. A caret that waits a second before blinking replaces the blank frame, "Loading messages…" and the "Send a message to start the conversation." flash. The flash came from dropping the prompt's stand-in when the session's row first landed idle.

App server (apps/server, apps/contract, apps/widget)

  • Host, GitHub, models, settings and project calls take an optional machineId and run over the connection Sync holds for that machine. A machine that isn't connected or doesn't answer is named in the error.
  • The Session backend creates a session on the machine asked for and claims it in Sync, so its first prompt, settle and its view reach that machine before its index does.
  • Each health check times a round trip per machine in the background, kept in memory. A check never waits on it.
  • Removing a machine announces its removed sessions and projects in the same transaction, so the sidebar updates at once.

Host (packages/codework)

  • host.browse reports readable: false for a folder it can't read. A refused path carries a reason (missing or file), so the picker offers Create only for a missing folder. The app's mirror accepts a server from before readable.

No new host RPCs: browsing, creating and cloning already existed; they now reach the machine named.

Session view (apps/web)

  • The session composer shows where the session runs: the machine with its status dot (the start page's wording when it can't be reached), then the branch, with a fork icon for a worktree. A folder without git shows no branch.

Sidebar: projects only in a sandbox (apps/server, apps/contract)

  • A sidebar project says whether it has a folder on its machine (onHost). A project that lives only in a sandbox has none. The CLI anchors every session to the folder it ran in, even a sandbox one, and the sidebar used to take that anchor as the project's folder. New thread on such a project now leaves Add Project instead of starting in the CLI's folder, and Add Project's Recent leaves it out. A sandbox session's row shows its sandbox folder.

Harness: git status survives a restart (packages/harness)

  • The daemon host kept each space's last daemon event (git status, skills) in memory only, so after a server restart a client saw no branch or changes until the space mounted again. It now keeps them in a new space_state table, written before each event is published and loaded at start. A client connecting after a restart sees them at once, and a stopped sandbox is never woken to read them. The app's mirror keeps only newer events, so it ends up matching the host.

Testing

  • Host: packages/codework server.test.ts, 42 of 42 passing. A new case covers host.browse on a readable, an unreadable (chmod 000), a missing and a file path, and host.add on a file (server.host-browse.json).

  • App server: health, host, paired, door, schema, sync, threads, tracking, changes and reads suites, 35 of 35 passing. A new case in reads.test.ts creates a session for a paired machine through the Session backend and checks that:

    • it and its first prompt land there and nothing reaches the default machine;
    • its project settings and rename reach that machine;
    • host calls reach the machine named, and an unknown or stopped machine is refused by name;
    • removing the machine announces the session (reads.create.json).

    paired.test.ts now asserts a round trip arrives while online and goes back to null while away. Artifacts leave the timing itself out.

  • Gates: vp run verify passes; typecheck and vp check are clean for web, server, contract and widget.

  • Real stack: the dev Electron app with three OrbStack machines and a VPS (reached over an SSH tunnel, as it sits behind NAT). Each was paired through the Pair dialog and ran a Kimi K3 session through GitHub Copilot that edited and ran code there. The round trip showed 3–7 ms for the VMs and about 100 ms for the VPS. Also checked by hand:

    • with a local Relay and a Clerk test user: workspace machines, including one linked but not paired;
    • a machine going offline and coming back;
    • project settings and rename on a remote project;
    • removing a machine;
    • each desktop fix above, with timings traced in the window.
  • Sandbox-only projects: a new reads.test.ts case runs on a paired machine, for the memory sandbox always and for Daytona when DAYTONA_API_KEY is set (reads.sandbox.memory.json, reads.sandbox.daytona.json). Both fail without the fix and pass with it. Reads suite: 8 of 8.

  • Restart replay: packages/codework daemon.test.ts used to pin "nothing replayed after a restart". On a real clone of codeworksh/69th it now replays the last status (daemon.git.rpc.json). New Daytona and Vercel cases clone 69th inside the sandbox, edit it, restart the server, and check the replay matches the last status (daemon.git.rpc.daytona.json, daemon.git.rpc.vercel.json). The codework suite passes (159 passed, 27 skipped), as do the harness db test and the app server's daemon test.

  • Restart on the real stack: with the desktop app closed, a host clone of 69th plus a 69th clone in Daytona and one in Vercel ran Kimi K3 turns on this computer and on the VPS, each on its own branch. Both servers restarted, then the app opened. All six session rows showed the right machine and branch from the hosts' stored status, with nothing run since.

  • Not run: the OrbStack machine simulation suites (*.machines.live.test.ts), and the live model suites, since no provider or model behavior changed.

Model and harness: Claude Opus 5.5 in Claude Code.

🤖 Generated with Claude Code


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

The start page gets a machine and project row above the composer. A session,
its folder, clones, models, GitHub and project settings all follow the machine
picked: this computer, a paired machine, or one in the workspace.

- app server: host, GitHub, models, settings and project calls take an optional
  machineId and run over the connection Sync holds for that machine; a machine
  that does not answer says so by name.
- sessions: the Session backend creates a session on the machine asked for and
  claims it in Sync, so its first prompt and its view reach it before the index.
- health: each check times a round trip per machine in the background.
- host: host.browse reports an unreadable folder, and a refused path says why
  (missing or a file), so the picker offers Create only for a missing folder.
- removing a machine announces its removed sessions, so views read again.
- desktop fixes: the sidebar's + and New pick the project's machine; Git
  Changes names the machine and no longer jumps tabs or clears the sidebar's
  selection; a new session opens with its prompt in place and a delayed caret
  instead of an empty conversation; Add Project no longer shifts while gh is
  checked.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…it status that survives a restart

Start page and app server:
- Route host calls by machine: a named machine goes over Sync's connection, none over the default
  machine's main connection; a new session is claimed on the machine it was created for.
- Sidebar projects say whether they have a folder on their machine (`onHost`). A project only in a
  sandbox has none, even when the CLI anchored its session to the folder it ran in, so New thread
  leaves Add Project and Recent leaves it out. A sandbox session's row shows its sandbox folder.
- Round trips are timed in the background and shown only for machines that answer.
- Add Project, clones and their toasts follow the machine the start page is on.
- A server removal names its projects, spaces, threads and sessions, so every view reads again.

Session view:
- The composer shows where the session runs: its machine and whether it can be reached, then the
  branch, with a fork for a worktree. The tooltip names the machine once.

Harness:
- The daemon host keeps each space's last daemon event in `space_state` and loads it at start, so a
  client connecting after a restart still sees git status and skills before the space mounts again,
  and a stopped sandbox is never woken to read them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sanchitrk
sanchitrk merged commit db3b140 into canary Nov 26, 2026
2 checks passed
@sanchitrk
sanchitrk deleted the claude/machines-selector-home-composer-fe11ec branch November 26, 2026 16:40
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