Repository navigation
test(evals): pre-warm the OpenCode plugin cache per Daytona sandbox - #4415
benjaminshafii wants to merge 4 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 4 Skipped Deployments
|
…nd seed each Electron profile Every e2e desktop profile started with an empty engine cache, so the first workspace bootstrap npm-installed @opencode-ai/plugin and opencode-chrome-devtools inside the engine. In the sandbox that self-install often wedged with idle TLS connections to the registry, the app reported OpenCode unavailable, and every app-driving spec died at seedSessions. Install those packages once per sandbox with npm into the three directories the engine checks, then copy the warm tree into each fresh profile so bootstrap takes 0.2s instead of minutes.
33ad385 to
a58d108
Compare
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (a58d10806c6ae1075ebe861f0e97c6e6431c3870). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
…that exact path Address the Warden finding: never trust a pre-existing shared cache dir in a reused sandbox. Each provision installs into a fresh /tmp/openwork-engine-warm-* tree with --ignore-scripts and hands that exact path to the Daytona host, which is the only source spawnElectron seeds from.
Test evidence — narrow-session-panes-stay-selectable-synchronized-and-inside-the-viewport — ✅ passed✅ passed · 3 expectations passed · 0 failed · 0 pending verdict passed · 0 user observations · 0 probes · steps 0/0 ℹ️ ASSERTION — 1. Narrow split focus stays synchronized and the tab widget remains reachable{"selected":"split","tabStops":1,"inactiveStops":0,"controlsResolve":true,"labelledByActiveTab":true,"minimumTarget":44,"switcherInsideViewport":true,"panelInsideViewport":true,"documentWidth":390,"viewportWidth":390}
ℹ️ ASSERTION — 2. Existing session focus actions reveal the requested narrow pane without losing the other chat draftsession.open revealed ses_f93ea53bafferk1gg5VlhraY4Q; returning to ses_f93ea5d5affetA9FIhdgt2ZWI5 preserved the draft.
ℹ️ ASSERTION — 3. The in-flow tools pane stays inside the viewport and closing it returns to chat{"panelInsideViewport":true,"chatHidden":true,"splitHidden":true,"documentWidth":390,"viewportWidth":390}
Test run created 2026-09-04T10:58:00.450Z · Source: |
) Right-click any session row (or its ⋯ menu) → New split, or Cmd+K → New split, creates a fresh empty session in that workspace and opens it as the secondary split pane without moving the primary pane or route. One shared task creator with openAs "primary" | "split". Also carries the e2e harness fix from #4415 (superseded): every Daytona provision now pre-installs @opencode-ai/plugin and a pinned opencode-chrome-devtools into a fresh per-provision tree (npm --ignore-scripts) and seeds each Electron profile from that exact path, so the engine bootstraps in 0.2s instead of wedging on a cold in-engine npm install. Adds a trusted user.rightClick spec primitive. Verified on Daytona: evals/specs/new-split-session.e2e.test.ts passed on 69caa0f.
Problem
Every app-driving e2e spec on
devhas been failing atseedSessions(session.create_task→ "Action is disabled" / "did not return a session ID"), on Daytona and locally. The app showed "OpenCode unavailable — the engine did not answer after 4 attempts."Root cause (measured live in a sandbox): each spec gets a fresh Electron profile with an empty engine cache, so the engine's first workspace bootstrap npm-installs
@opencode-ai/plugin@<engine version>into two config dirs andopencode-chrome-devtools@latestinto its package cache. Inside the sandbox that self-install frequently wedges — 60 idle TLS connections toregistry.npmjs.org, no timeout, log silent — so bootstrap never completes. npm itself is fine from the sandbox (40 parallel fetches in 1.1s). With those three directories already populated, bootstrap takes 0.2s.Fix (harness only)
provision.ts: new engine cache warm gate after the first-boot gate. Reads the sidecar version, writes the threepackage.jsons (base64-shipped — the exec transport strips"), runsnpm installinto each, and stores the tree at/workspace/.openwork-daytona/engine-cache/openwork-dev-data. Non-fatal on failure (specs start cold, with a logged warning). ~10s.daytona.tsspawnElectron: after creating a fresh profile,cp -athe warm tree into<userData>/openwork-dev-data(guarded: never clobbers a caller-owned profile that already has one).engine-cache.Verification
OPENWORK_EVAL_DAYTONAlane, unchanged specevals/specs/responsive-session-layout.e2e.test.ts:Also proven downstream: with this branch as base,
new-split-session.e2e.test.ts(#4397) went from red-at-seed to green on the same lane.Unit:
node --test evals/packages/hosts/test/{provision,daytona-host}.test.ts→ 29 pass.Two harness footguns found along the way (not fixed here)
pnpm evals:e2eon the Daytona lane checks outOPENWORK_EVAL_REFordevinside the sandbox — never the current branch. A feature branch's local Daytona "verdict" silently tests dev's app unless you setOPENWORK_EVAL_REF. The run-tests skill doesn't mention it.canCreateTaskneeds a model; the Daytona lane needsOPENWORK_EVAL_MODEL=big-pickle(CI sets it; the skill doesn't say so).