Repository navigation
feat: start sessions on any machine from the start page - #180
Merged
Merged
Conversation
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]>
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.
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)
ghis checked.App server (apps/server, apps/contract, apps/widget)
machineIdand run over the connection Sync holds for that machine. A machine that isn't connected or doesn't answer is named in the error.settleand its view reach that machine before its index does.Host (packages/codework)
host.browsereportsreadable: falsefor a folder it can't read. A refused path carries areason(missingorfile), so the picker offers Create only for a missing folder. The app's mirror accepts a server from beforereadable.No new host RPCs: browsing, creating and cloning already existed; they now reach the machine named.
Session view (apps/web)
Sidebar: projects only in a sandbox (apps/server, apps/contract)
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)
space_statetable, 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/codeworkserver.test.ts, 42 of 42 passing. A new case covershost.browseon a readable, an unreadable (chmod 000), a missing and a file path, andhost.addon 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.tscreates a session for a paired machine through the Session backend and checks that:reads.create.json).paired.test.tsnow asserts a round trip arrives while online and goes back tonullwhile away. Artifacts leave the timing itself out.Gates:
vp run verifypasses; typecheck andvp checkare 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:
Sandbox-only projects: a new
reads.test.tscase runs on a paired machine, for the memory sandbox always and for Daytona whenDAYTONA_API_KEYis 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/codeworkdaemon.test.tsused to pin "nothing replayed after a restart". On a real clone ofcodeworksh/69thit now replays the last status (daemon.git.rpc.json). New Daytona and Vercel cases clone69thinside 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
69thplus a69thclone 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-botwith what you need.