Repository navigation
fix(server): ship opencode-chrome-devtools as a bundled local plugin so engine bootstrap never depends on npm - #4423
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 4 Skipped Deployments
|
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (75c7a26f95ba7bd1557d2c80073761597052d32b). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (50d43d3cf5cd49c4a7e9f2273d86e85b4ebf752a). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
Test evidence — reloading-a-session-with-a-persisted-composer-draft-keeps-the-renderer-stable — ✅ passed✅ passed · 0 expectations passed · 0 failed · 0 pending [world] desktop(daytona) · workspace(/tmp/openwork-empty-session-1788543123517) · session("New task") Test run created 2026-09-04T17:32:03.482Z · Source: |
* chore: delete dead code, unused deps and orphaned assets Remove code that nothing reaches, verified against origin/dev with knip (new knip.jsonc) plus manual reference checks, including hidden dirs. Typecheck passes for app, server, desktop, den-api, den-web, landing, gateway and telemetry; the app builds; app boot and desktop tests pass. App (apps/app): - React-port leftovers and orphaned modules: actions store/provider, global sync and SDK providers, unused settings, connections and session modules, test-only helpers and their scripts. - Dead exports: unused utils, Advanced sections, migration deferral helpers, compactSession, the deprecated signUpEmail stub. - The unregistered OpenAI image settings state and the never-read microsandboxCreateSandbox flag. - The menu-overlay renderer (native context menus replaced it in #4650), unused i18n keys and 192 unused grain-art images. - Deps: @ai-sdk/react, @radix-ui/colors, @radix-ui/react-use-controllable-state, remark-breaks, remark-gfm. Desktop (apps/desktop) and types: - 16 renderer-unreachable IPC handlers and their types and re-exports (some wrote files), plus 7 unused browser and microphone channels. - menu-overlay preload, unused dev icons, electron-devtools-installer. Server (apps/server): - Unused exports, @types/minimatch, @openwork/headless-threads and the opencode-chrome-devtools devDep with its module declaration (the bundled openwork-chrome-devtools plugin replaced it in #4423). Den: - Orphaned landing components, the den-api plugin-system barrel and desktop-policy-role-assignments re-export, a test-only cache hook, test helpers and evidence scripts left without tests, and unused deps (grammy, drizzle-orm in gateway, zod in telemetry). Repo: - apps/ui-demo, Tauri migration scripts, the broken dev-web-local and dev-den-local scripts, the den-controller stub and DEN_CONTROLLER_PORT, one-off scripts, HANDOFF.md, committed tsbuildinfo files and tracked evals/results output, the Remote MCP Apps docs. - Add knip.jsonc and make scripts/find-unused.sh a thin knip wrapper that uses pnpm. Signed-off-by: Benjamin Shafii <[email protected]> * chore(app): keep only the artifact helpers production uses lib/artifacts.ts keeps ArtifactType, getArtifactType and useOpenArtifactPath; the rest had no production caller and its tests were already removed. Signed-off-by: Benjamin Shafii <[email protected]> --------- Signed-off-by: Benjamin Shafii <[email protected]>
Problem
openwork-server's runtime config listed one npm plugin,"opencode-chrome-devtools"(apps/server/src/openwork-runtime-config.ts:81); the other six are local files. On any fresh profile (first install, new eval desktop) the bundled OpenCode engine installs that package during bootstrap through its in-process npm installer (Arborist on the embedded Bun 1.3.14 — no child process, writespackage-lock.json). That install intermittently hangs forever: dozens of idle keep-alive sockets to the registry, no timeout, no error. Bootstrap never returns, every/session*proxy call 502s after 5s, and the app shows "OpenCode unavailable — the engine did not answer after 4 attempts".Minimal repro with no OpenWork code, on macOS and Linux, on opencode 1.18.18 and 1.18.27:
This is what has been keeping the Daytona desktop E2E lane red today (#4397 added an eval-host "engine cache warm gate" to pre-seed the cache; that fixes evals but not users).
Change
Bundle the plugin like the other six:
apps/server/package.json: exact dev dep[email protected](build-time only —bun buildinlines it, so it is not a runtime dep and does not need mirroring intoapps/desktop/package.json; theserver-dependency-mirrorratchet stays green); addedsrc/opencode-plugins/openwork-chrome-devtools.tsto thebun buildlist (ws is inlined; no bare imports remain in the output).apps/server/src/opencode-plugins/openwork-chrome-devtools.ts:export { server } from "opencode-chrome-devtools";— exactly one exported function so OpenCode registers the tools once. Minimal.d.tsfor the untyped package.openwork-extensions-plugin-path.ts:openworkChromeDevtoolsPluginPath(); runtime config uses it in place of the npm specifier.server/dist/opencode-plugins→resources/opencode-plugins(electron-builder.base.yml:17), so the new file ships automatically.evals/(the warm gate stays and becomes redundant), and no change to the app's Library detection (it keys off MCP servers, not the plugin array).Verification
Engine-boundary proof, fresh profile, no registry access on PATH (
env -i PATH=/usr/bin:/bin):openwork-runtime-config.test.tsnow asserts the plugin list contains no bareopencode-chrome-devtoolsspecifier and does contain the localopenwork-chrome-devtools.(ts|js)path.E2E lane: running an existing desktop journey on Daytona against this branch to show nothing regressed; result to follow in a comment.
Related: #4392 (composer stays editable) was blocked on this.