Skip to content

fix(desktop): copy agent-computer into the deployment so the server starts - #813

Merged
davidmckayv merged 1 commit into
mainfrom
dustywusty/fix-deployment-agent-computer
Oct 20, 2026
Merged

davidmckayv merged 1 commit into
mainfrom
dustywusty/fix-deployment-agent-computer

Conversation

@dustywusty

Copy link
Copy Markdown
Contributor

What this changes

A new desktop install of v0.2.0 cannot start OpenBot. The server exits at once:

server stopped straight away (exit status: 1).
error: Cannot find module '../../../agent-computer/src/egress' from '<install>/server/src/computer/policy-network.ts'

This PR:

  • adds agent-computer to the folders the desktop app lays out (deployment::ALSO_COPIED);
  • adds everything_the_unpacked_code_imports_is_unpacked_too, which walks the real tree and fails when code the desktop unpacks imports, by a relative path, anything it does not unpack;
  • records the laid-out folders in the deployment stamp. A stamp written by an earlier app ({"version":"v0.2.0"}) no longer matches, so Install lays the same release out again (no version change), and Start sends such an install back to Install with the existing "Finish installing" message instead of running a server that cannot load.

Root cause

  • Where it entered: feat: Bots work as coworkers #673 (67091ed, "Bots work as coworkers", 1 Oct) made server/src/computer/policy-network.ts import ../../../agent-computer/src/egress so the egress rules are shared rather than copied. scripts/start-local-chrome-computer.ts already imported agent-computer/src/browser-runtime.
  • How: the desktop app does not run a checkout. deployment::unpack extracts the release tarball and keeps only the top-level entries in REQUIRED and ALSO_COPIED. agent-computer was never in either list, so the import has nothing to resolve to. It is not a workspace, so bun install did not notice either.
  • Evidence: reproduced on a clean desktop install of v0.2.0 (Apple silicon): <install>/agent-computer is absent and server.log shows the error above. Copying agent-computer/src from the v0.2.0 tag into the install makes bun build server/src/index.ts and worker/src/index.ts resolve every import. Still present on main at 68fd9f6.
  • Why it went undetected: CI and local development run from a full checkout, where every folder exists. Nothing checked that the unpacked subset is closed under its own imports, and nothing re-laid-out an install whose stamp already matched its version, so Repair could not fix it either.
  • How this prevents recurrence: the new test fails on any relative import out of the unpacked folders (it caught both instances above before the fix). The layout in the stamp means any future change to the copied set repairs existing installs on their next Install instead of leaving them broken.

Where it runs

  • New state that outlives a request? None on the server. The desktop deployment stamp gains a layout field (old stamps read it as empty).
  • What happens on the second replica? Not applicable: desktop-only change; the server code is unchanged.
  • Anything serialised? No.
  • Anything fanned out to a browser? No.
  • New listener, port, or schedule? No.

Boundary and audit

  • Every acting call still goes through the gateway: unchanged, no server code touched.
  • New refusals and new failures each write a row: not applicable (desktop install check).
  • Nothing new is trusted from the client: unchanged.

Changelog

  • A line in CHANGELOG.md under Unreleased ("A new desktop install starts its server again").

Proof

  • The new import test failed before the fix, listing server/src/computer/policy-network.ts imports ../../../agent-computer/src/egress and scripts/start-local-chrome-computer.ts imports ../agent-computer/src/browser-runtime; passes after.
  • a_deployment_laid_out_by_an_app_that_copied_less_is_fetched_again and a_deployment_laid_out_by_an_earlier_app_requires_installation_before_start failed before, pass after.
  • cargo fmt --check, cargo clippy --locked --all-targets -- -D warnings, cargo test --locked --lib --bins (541 lib, 149 bin) pass on macOS arm64. Windows and Linux runs are left to CI.

…tarts

Since #673 the server imports its egress rules from
agent-computer/src/egress, and scripts/start-local-chrome-computer.ts
imports agent-computer/src/browser-runtime. The desktop app lays the
deployment out from an allowlist of top-level folders that never
included agent-computer, so every new desktop install of v0.2.0 had a
server that exited at start with "Cannot find module
'../../../agent-computer/src/egress'".

- Copy agent-computer with the rest of the deployment.
- Add a test that walks the real tree and fails when code the desktop
  unpacks imports, by relative path, anything it does not unpack.
- Record the laid-out folders in the deployment stamp. A stamp written
  by an earlier app (version only) no longer matches, so Install lays
  the same release out again, and Start sends such an install back to
  Install instead of running a server that cannot load.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T21:53:23.296996Z 58f74c0 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@davidmckayv
davidmckayv merged commit 2fbeb1b into main Oct 20, 2026
25 checks passed
@davidmckayv
davidmckayv deleted the dustywusty/fix-deployment-agent-computer branch October 20, 2026 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants