Repository navigation
Conversation
One request for the daemon to move a thread's browser to another engine, answered with the browser's state there and the pages that didn't load (#2013). Co-Authored-By: spade <bot@acehq.dev>
Each client used to save the engine, close and reopen the browser itself, so two devices switching one thread at once could close a browser the other was restoring or load its pages twice (#2013). BrowserService.moveEngine now runs the whole move, queued per thread; a queued move finds the browser already on its engine and leaves it. A failed open writes the previous engine back and reopens the pages. ADR 0193 records the contract. Co-Authored-By: spade <bot@acehq.dev>
The socket's browser bridge gets a port that reads the thread's browser.backend and writes its thread layer, refused for an agent's device as a settings write is (ADR 0190). Co-Authored-By: spade <bot@acehq.dev>
@ace/client's moveBrowserEngine is now one browser.engine.move request; the fake daemon answers it with the daemon's own move. Closes #2013 Co-Authored-By: spade <bot@acehq.dev>
The move wrote the thread's engine, then closed the browser and cleared its saved tabs, so a daemon stopping before the reopen came back on the new engine with no tabs (Codex review of #2340). The move now closes the browser as a shutdown does, its tabs kept in the tab store, and reopens it on the new engine through a one-off override with those tabs restored (ids, private and shown tabs as they were). The setting is written only after that. A failed open reopens the tabs on the engine the browser was on; a restart mid-move reopens them where the setting still points. Tests cover several tabs restored with the shown and private ones, a restart mid-move, and a move queued behind one that failed. Co-Authored-By: spade <bot@acehq.dev>
Phones and desktops update at different times. A daemon that answers browser.engine.move with unsupported now gets the old client-side steps, kept in browser-engine-here.ts; callers say whether they see a browser open so the fallback only keeps the choice when none is. Co-Authored-By: spade <bot@acehq.dev>
ADR 0194 (renumbered from 0193, taken on main and by #2324) now says the setting is written after the reopen, what a restart mid-move does, and that clients fall back to their own steps for older daemons. Co-Authored-By: spade <bot@acehq.dev>
…wned-engine-move Co-Authored-By: spade <bot@acehq.dev>
A move now brings back every tab as a restart restores them, so a tab whose address can't load stays a tab instead of being skipped, and the shown tab stays shown. The menu helper closes a menu the last pick left open, since the move now answers in one round trip. Co-Authored-By: spade <bot@acehq.dev>
This branch has not been deployed
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.
Problem
Moving a thread's browser to another engine ran in each client: save the engine, snapshot the tabs, close, reopen, load the pages. Two devices switching the same thread at once could close a browser the other was restoring, or load its pages twice.
Change
The daemon owns the move (ADR 0194). A client sends one
browser.engine.moverequest (threadId,workspaceId,engine), and the reply isBrowserEngineMoved: the browser's state on the new engine, plus any tabs that didn't come back.packages/browser/src/engine-move.ts). A queued move finds the browser already on its engine and only keeps the setting, so both devices see success.BrowserService.rehostcloses the browser the way a shutdown does, with its tabs kept in the tab store. It then reopens on the new engine through a one-off override and restores the tabs with the same ids. Private tabs stay private and the shown tab stays shown.browser.backendis written only after that reopen succeeds. A daemon that stops mid-move has written nothing, so its next open brings the tabs back on the old engine.apps/daemon/src/browser-engine-setting.tsand asks the same refusal as a settings write (ADR 0190).@ace/client. If the daemon answersunsupported(a daemon older than this change), the client runs its old steps instead (packages/client/src/browser-engine-here.ts).moveEngine.Tests
packages/browser/src/engine-move.process.test.ts, and through the daemon socket with real settings inapps/daemon/src/browser-engine-move.server.process.test.ts.unsupported, the client makes the move itself:packages/client/src/browser-engine-here.test.ts. These are main's old client tests, run through the publicmoveBrowserEngine.engine-switch.test.tsxand the iPhonebrowser-engine.test.tspass against the fake daemon.fmt:check,lint,typecheckandcheck:sizepass.Mutations checked
Departures
rehostcode that a successful move uses.test:changedalso hit failures that fail the same way on a cleanorigin/main:ace-account,account-machines,machine-account-source,list-motion,cutover,fleet,transfers(iOS bridge),service-home-identityandfingerprint. Others timed out under load and passed when run alone.Closes #2013
Model: Claude Opus 5.5