Repository navigation
fix(app): re-land #4747 — reach engine effective permissions without reusing stale per-workspace provider config - #4876
Conversation
…ace's in-place reload Red on dev: the engine pool skips the second workspace's reload as "unchanged" because the first in-place reload marked the whole primary generation current, although only that one directory instance was rebuilt.
…er process An in-place reload disposes ONE directory instance, but the pool recorded its fingerprint on the primary generation. Every other workspace's reload was then skipped as unchanged and kept serving the provider catalog it read before the config change. Before #4747 the renderer reload restarted the embedded server, which rebuilt every instance and hid this.
…rovider-config-after-4747
…ce is server-owned Workspaces created from the app live only in the server registry, so a renderer reload reaches startServerWithoutDesktopWorkspace and restarted the embedded server (and its engine) although it was healthy and already serving that workspace. Reuse it when it is ready with the preferred remote-access mode; only restart when nothing usable is running.
The emptySession world declared /tmp/openwork-empty-session-<ts> but
seed.workspace() adopted the existing first-launch default workspace
instead ("OpenWork Chat" under the dev profile home). On Daytona that
profile lives inside the repo checkout, so the engine merged
/workspace/.opencode/opencode.json ("permission": "allow") over the
workspace's own catch-all and composer-run-mode never saw the workspace
MCP rule take effect.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Warden review summary — ClearNative findings: 0. Blocking policy matches before consolidation: 0. Full finding text remains in Warden's native checks and review threads. This comment retains only native IDs, severity, skill attribution, and safe locations. Analysis run Reported trigger coverage (not proof of complete repository or context coverage): diff-security-review (83312 ms), confidentiality-review (79682 ms), spec-provenance-review (58386 ms), desktop-den-sync-review (56710 ms). Blockers
Advisories
Needs recheck
Observed review-thread metrics
Thread states are read-only collection snapshots. These metrics are neither lifetime totals nor exact resolution times, and this summary is not clearance authority. |
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (e154ecafd15aeeb9ae978a67e818e08cbe28215f). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
|
Passed · 12/12 tests · 18/18 assertions · 8 images Commit |
Re-lands #4747 (reverted by #4870 as
f0a62791b) together with the server fix for the regression #4747 exposed.Root cause
#4747's product change (
desktop-runtime-boot.ts: reuse a healthy embedded server on renderer reload instead ofopenworkServerRestart) is correct; the restart it removed was masking a bug in the engine pool.EnginePool.requestRolloverskips a reload asunchangedwhen the current runtime-config fingerprint equalsprimary.fingerprint, and an in-place reload (idle engine) setprimary.fingerprint = fingerprint. But an in-place reload only disposes one directory instance (/instance/dispose?directory=<workspace>). So afterPOST /workspace/w1/engine/reloadrebuilt w1's instance, the reloads for w2 and w3 were skipped asunchanged, and their instances kept serving the provider catalog they had built beforePATCH /workspace/:id/configwrote the (engine-global) provider. Before #4747 the renderer reload restarted the whole server/engine, rebuilding every instance and hiding this. With #4747, workspace 1 (the one actually reloaded) worked, workspace 2 showed only "OpenCode Zen · 7 models" andModel no longer available / Retry— the signature in gate runs 34529322422 / 34531506976.The hypothesis in the brief (boot hook targeting the previously active workspace) was checked first and is not what happens: the boot path is unchanged from #4747 and correct. The red→green unit test therefore lives in
apps/server/src/engine-pool.test.ts, notapps/app/tests/.What changed
apps/server/src/engine-pool.ts— a generation now records the fingerprint per directory it reloaded in place (reloadedDirectories) instead of overwriting the process fingerprint. The skip guard isprimary.fingerprint === current || reloadedDirectories.get(dir) === current. A real rollover (new process) still marks everything current; repeated no-op syncs for the same directory still skip. Same bug class also affectedmanaged_provider_reload/workspace_bootstrapreloads for the non-first workspace.apps/server/src/engine-pool.test.ts— new test: after an in-place reload of workspace A, workspace B still reloads in place; repeats for both skip; a rollover resets.29b01227f(boot: reuse running server for server-owned workspace),0a0b08e35,e154ecafd(evals: emptySession world created at its tmp path; run-mode error detail).git diff 9a60a4b59 -- <those 3 files>is empty.Proof (sha
e154ecafd15aeeb9ae978a67e818e08cbe28215f, Daytona lane,OPENWORK_EVAL_REFexported)bun --conditions=development test src/engine-pool.test.ts -t "does not skip the other workspaces"— red on dev ({ action: "skipped", reason: "unchanged" }for the second workspace), green after: engine-pool suite 29 pass / 0 fail.pnpm --dir apps/server typecheckexit 0;pnpm --dir apps/app typecheckexit 0.pnpm evals:e2e active-session-workspace-storm --daytonaate154ecafd: passed, passed (2 sequential green runs: sandboxes…-235328-45204,…-000217-90634). One earlier run at the same sha failed at a different assertion (bodyHasMarkerread immediately afteropenExactSessionRoutefor workspace 1, line 624 — after all three workspaces had already selected the mock model and reached live tools); same spec is recorded flaking once ata7cf63527in Revert "fix(server): make workspace permission changes reach the engine's effective permissions (composer-run-mode)" (#4747) #4870 and is green on dev in run 34542680782. Not touched.pnpm evals:e2e active-session-workspace-storm --daytonaataa1441f2b(pre-revert dev + this fix): passed — confirms the fix on the tree where the regression reproduced.pnpm evals:e2e composer-run-mode --daytonaate154ecafd: passed (fix(server): make workspace permission changes reach the engine's effective permissions (composer-run-mode) #4747's intent preserved).apps/server/src/cloud-provider-sync-drain-defer.test.tsfails withfailed to set Den session: 403identically onorigin/devwith this patch removed — pre-existing, unrelated.Noticed, not touched
first-run-localis red at this sha with the same signature as the post-revert dev run 34542686302 on858414c41(no fix(server): make workspace permission changes reach the engine's effective permissions (composer-run-mode) #4747): first prompt showsCancelledError,Timed out after 180000ms seeing text=Your workspace is ready…. Since it fails identically without fix(server): make workspace permission changes reach the engine's effective permissions (composer-run-mode) #4747, it is not caused by fix(server): make workspace permission changes reach the engine's effective permissions (composer-run-mode) #4747 or this re-land; needs a separate investigation.cloud-provider-sync-drain-defer.test.ts403 above.