fix: align Cascade agent runtime images with common review tools#1380
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
nhopeatall
left a comment
There was a problem hiding this comment.
Summary
Requesting changes because the new global Playwright browser path makes the documented version-drift fallback fail for project setup scripts.
Code Issues
Should Fix
- Dockerfile.worker:99 — The image exports
PLAYWRIGHT_BROWSERS_PATH=/ms-playwrightglobally and only grants read/execute permissions on that root-owned cache.setupRepositoryruns.cascade/setup.shlater as thenodeuser andrunCommandinheritsprocess.env, so a target repo pinned to a different Playwright revision that runsnpx playwright install chromiumin setup will try to create the missing browser revision under/ms-playwrightand fail with a permission error. That contradicts the PR/docs fallback that projects needing a materially different Chromium revision can install their own copy in.cascade/setup.sh. Make the cache writable by the runtime user or provide an automatic/project-facing override for project-local Playwright installs before merging.
🕵️ codex · gpt-5.5 · run details
| RUN npm install -g @playwright/test@1.49.1 \ | ||
| && PLAYWRIGHT_BROWSERS_PATH=/ms-playwright \ | ||
| npx --yes playwright@1.49.1 install --with-deps chromium \ | ||
| && chmod -R a+rX /ms-playwright |
There was a problem hiding this comment.
The image exports PLAYWRIGHT_BROWSERS_PATH=/ms-playwright globally, then grants only read/execute on that root-owned cache. .cascade/setup.sh runs later as the node user and inherits this env, so a project pinned to a different Playwright revision that runs npx playwright install chromium will try to create the missing browser revision under /ms-playwright and hit a permission error. That is the fallback described in the PR/docs for version drift. Please either make this cache writable by the runtime user or provide an automatic/project-facing override for project-local Playwright installs.
There was a problem hiding this comment.
Fixed in 5b6fb7b. The shared Playwright cache is now owned/writable by the runtime node user, so project setup scripts inheriting PLAYWRIGHT_BROWSERS_PATH can install a missing pinned Chromium revision there. I also added a smoke-test assertion that the node user can write to the cache and updated the docs/prompt/changelog wording.
|
@aaight address code review concerns |
|
@zbigniewsobiecki addressed the code review concern in 5b6fb7b. The Playwright cache remains shared at PLAYWRIGHT_BROWSERS_PATH, but it is now owned/writable by the runtime node user so project .cascade/setup.sh scripts can install missing pinned Chromium revisions instead of failing on permissions. Added smoke coverage for node-user write access and updated the related docs/prompt/changelog text. 🕵️ codex · gpt-5.5 · run details |
nhopeatall
left a comment
There was a problem hiding this comment.
LGTM - the updated worker image baseline matches MNG-1055, the previous writable-cache issue is covered by the node-user ownership and smoke assertion, env propagation remains exact-match only, and the focused backend tests pass locally (106 tests).
🕵️ codex · gpt-5.5 · run details
Summary
Aligns the worker image with the baseline native-session toolchain agents actually reach for, so per-project
.cascade/setup.shhooks no longer have to install Python or Playwright on the hot path. Closes the friction clusters tracked under MNG-1055:pythonmissing from PATH)Linear issue
https://linear.app/issue/MNG-1055
What changed
Dockerfile.workerpython3+python-is-python3(one apt-managed shim, noln -sdrift). Adds pinned@playwright/test@1.49.1+ Chromium viaplaywright install --with-deps chromium. SetsENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwrightandchmod -R a+rX /ms-playwrightso the non-rootnodeuser can read the cache. A small image-build sanity check (python --version && python -c 'import json') catches future package-name regressions.src/backends/shared/envFilter.tsPLAYWRIGHT_BROWSERS_PATHtoSHARED_ALLOWED_ENV_EXACTso the env propagates to Claude Code / Codex / OpenCode subprocesses. The broaderPLAYWRIGHT_*prefix is intentionally not allowlisted — only the exact var.src/backends/shared/nativeToolPrompts.ts$PLAYWRIGHT_BROWSERS_PATH) instead of working around it.tests/docker/worker-runtime-tools/run-test.shpython -c 'import json'+ Playwright Chromium launch). Used by CI and both deploy workflows — failure blocks:latest,:dev, and SHA-tag pushes..github/workflows/{ci,deploy,deploy-dev}.ymldocker-build-check(PR CI) and gates the worker image push in both deploy workflows behind the same check, so a regression never reaches production.PLAYWRIGHT_BROWSERS_PATHsurvival acrossfilterProcessEnvandbuildEngineEnv(every engine allowlist shape), and pin the prompt guarantees (Python shim, baseline shell tools,$PLAYWRIGHT_BROWSERS_PATHreference) without disturbing the existing CASCADE Tools section.### Changed.Notable design decisions
.cascade/setup.sh— keeping the image small enough to ship.PLAYWRIGHT_BROWSERS_PATHin Docker is insufficient — the native-tool engines sanitize subprocess env viaSHARED_ALLOWED_ENV_EXACTbefore spawning. The plan called out this defense-in-depth posture explicitly; the test pins it.Test plan
npx vitest run --project unit-backends tests/unit/backends/shared-envFilter.test.ts tests/unit/backends/shared-envBuilder.test.ts tests/unit/backends/shared-nativeToolPrompts.test.ts(53 → 106 tests, all green)npm test(9,725 passed / 28 skipped)npm run typecheck(clean)npm run lint(no new warnings in changed files)docker-build-checkexercisestests/docker/worker-runtime-tools/run-test.shagainst the freshly built image. (Cannot run Docker from the sandbox; the script is bash-syntax-validated and the CI step is wired.)Risks & mitigations
@playwright/testmajor may still need their own browser install. Documented in the engine-backends section; the baseline serves the median review/Playwright-launch case.shared-envFilter.test.tsandshared-envBuilder.test.ts(the latter is the regression net for the case where someone tightens an engine-specific allowlist without touching the shared one).🕵️ claude-code · claude-opus-4-7 · run details