Repository navigation
Commit 5326550
committed
feat(desktop): run a chat's desktop tools in the background executor
The Sim desktop app now picks up and runs the desktop tool calls of turns bound
to it from Electron main, so work keeps going when the user leaves the chat,
switches workspace, or reloads the window. It speaks the device protocol from
the previous PRs and stays dormant until Sim enables it for the user.
- Identity: a stable install id in userData, registered with the app's own
session on sign-in and session change, retired on sign-out (which also stops
every action and clears the outbox). A 409 mints a new id.
- Pickup: an SSE doorbell plus the reconciling inbox read on connect, on every
ring, on wake and network return, and on Sim's reconcile timer.
- Execution: each call is claimed as soon as it is offered, queued per chat and
surface, and run in that chat's own browser scope, terminals, or granted
folders, from Sim's record of the call. Leases are renewed from claim to
acknowledgement. Covers browser_*, terminal, read_local_file and user-local
read/grep/glob; import_local_files is answered as not run for now.
- Outbox: an encrypted journal (claiming, claimed, started, result) written
before each step. A restart reports a call that never started as not
started, one that did as outcome unknown, and a finished one with its result;
nothing runs twice. Results are retried with backoff until Sim answers.
- Stop: inbox cancels and refused lease renewals stop the action. Terminal runs
get a real cancel: Ctrl-C, then SIGTERM and SIGKILL to the foreground process
group.
- Approvals: a notification for a background chat waiting on the user, opening
the chat at its approval card and closing once decided; it never names the
command.
- preload exposes desktopExecutor.getDevice() so the composer binds turns.
The browser, terminal and local-filesystem result projections move from the web
app into @sim/desktop-bridge so the chat view and the executor build identical
results; the renderer behaviour is unchanged.1 parent a31aaa8 commit 5326550
38 files changed
Lines changed: 4177 additions & 522 deletions
File tree
- .github/workflows
- apps
- desktop
- e2e
- src
- main
- browser-agent
- desktop-executor
- terminal
- preload
- sim/lib
- browser-agent
- mothership/tools/client
- packages/desktop-bridge
- src
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
87 | 89 | | |
88 | 90 | | |
89 | 91 | | |
| |||
0 commit comments