Native: move a host session into a Sandbox and open its desktop - #343
Open
kentdebruin wants to merge 1 commit into
Open
kentdebruin wants to merge 1 commit into
kentdebruin wants to merge 1 commit into
Conversation
The web gained two Sandbox session actions the native app did not have: Move to Sandbox in the session ⋯ menu (POST /sandbox/attach, with the server's 428 for unpushed work) and Open desktop on an awake Sandbox (POST /sandbox/desktop, a one-viewer bearer URL, advertised by canDesktop). Models: SessionSandboxStatus.canDesktop, SandboxDesktopLink (web URLs only, description redacted so it cannot leak through a log line), and SandboxMove with the web's eligibility rule, the ready-provider list and an attempt classifier that surfaces the 428 exactly once. OS1API: sandboxAttach, sandboxDesktop, and a confirmRequired error so a 428 keeps its meaning instead of collapsing into a server message. SessionView: a Move to Sandbox submenu with the ready providers, disabled while the agent runs; a confirm, then the server's own sentence as a destructive confirm on 428, then a notice and an optimistic sandbox record on the row. WorktreeInfoView: Open desktop when an awake Sandbox reports canDesktop, minted on the tap and shown in SFSafariViewController; the URL lives only in the sheet's state. Two DEBUG capture hooks (OS1_MOVE_TO_SANDBOX, OS1_SCROLL_TO) let the simulator reach both. Tests cover status and link decoding, eligibility, provider resolution, the 428 mapping and the ask-once confirm flow. Co-authored-by: Kent de Bruin <[email protected]>
Contributor
🤖 OS review · approve · quality 5/5 · risk highSafe to merge. 🔴 Risk high · recovery in days Reviewed |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Native parity for the Sandbox session actions from ef430bc (attach), 94296ed (desktop) and a2db38b (⋯ menu placement). The native app had creation and pause/wake/recreate; it now has the two newer actions.
Before / after
confirmcanDesktopSFSafariViewController, held only as the sheet's state; never persisted or logged (descriptionis redacted)Changes
Models/SessionSandbox.swift:canDesktop,SandboxDesktopLink(web URLs only, redacted description),SandboxMove(web's eligibility rule, ready providers, attempt classifier that surfaces the 428 once).Networking/OS1API.swift:sandboxAttach(sessionId:provider:confirm:),sandboxDesktop(sessionId:),APIError.confirmRequiredvia a testableresponseError(status:body:)so a 428 keeps its meaning.Views/SessionView.swift: the submenu, the two confirm dialogs, the error alert; success posts a notice and puts the returned sandbox record on the row optimistically (SessionViewModel.noteSandboxMove).Views/WorktreeInfoView.swift: Open desktop row + Safari sheet.DEBUG-only capture hooks:OS1_MOVE_TO_SANDBOX=<provider>,OS1_SCROLL_TO=sandbox.OS1Tests/SessionSandboxTests.swift: decoding, bearer-link handling, eligibility, provider resolution, 428 mapping, ask-once flow (11 tests).Verification
OS1andOS1Macbuild on tella-mac-node (Xcode 26.6);OS1Testsselected suites: 66 tests, 0 failures.bun run checkpasses.daytona / preparing / volume; notice "Moving to Daytona. The next message runs there." Session archived afterwards.Simulator screenshots are in the session.
Started by Kent de Bruin in this OS session