Skip to content

Commit 5326550

Browse files
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

‎.github/workflows/desktop-e2e.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ jobs:
8484
- name: Run Playwright _electron smoke suite
8585
working-directory: apps/desktop
8686
run: bunx playwright test
87+
env:
88+
BACKGROUND_EXECUTOR_REPORT_PATH: test-results/background-executor-report.json
8789

8890
- name: Upload test results
8991
if: failure()

0 commit comments

Comments
 (0)