Repository navigation
fix(server): make workspace permission changes reach the engine's effective permissions (composer-run-mode) - #4747
Conversation
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.
…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 latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
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 (46399 ms), confidentiality-review (12633 ms), spec-provenance-review (37623 ms), desktop-den-sync-review (14553 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 (561b5c03abb30875248afdc1bae554727536ba2b). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
|
Passed · 3/3 tests · 4/4 assertions · 2 images Commit |
… into e2e/permission-ask-and-orphans-after-abort Stacks on #4747: creating the world's declared tmp workspace needs its desktop-runtime-boot fix so user.reload() reuses the running server instead of restarting the engine (which would drop every pending request). Its files are not modified here.
…lared tmp path
Test 2 of parent-child-permission-approval ran bash without asking although the
world wrote permission.bash="ask" to the workspace opencode.json. The world
called seed.workspace() without create, so it adopted the first-launch default
workspace under the dev profile, which on Daytona lives inside the repo
checkout; the engine merges /workspace/.opencode/opencode.json
("permission": "allow") after the workspace file and the agent ruleset ends
as [* allow, bash ask, * allow] (last match wins; permissions/effective reported
shell allow, source engine, workspace file .../home/OpenWork Chat/opencode.jsonc).
Same trap and same remedy as #4747 for emptySession; opt-in so the other
splitPaneQuestions worlds keep their arrangement.
…ed permission requests after Stop (#4798) * fix(app): seed the delegated-task eval with a running parent thread The eval.task_activity.seed hook rendered an in-flight child under a parent whose thread status stayed "ready": it only marked the activity store busy. Since #4635 MessageList reads that as a stopped parent and the unobserved child shows "Waiting for task result" instead of the Working shimmer, so task-activity-shimmer and parent-child-permission-approval lost their [data-subagent-activity="shimmer"] row. A delegating parent is mid-run; mark the eval thread streaming like the chat-loading seed already does. * fix(app): seed a created session's snapshot so its composer can send immediately A freshly created session had no cached snapshot, so deriveSessionRenderModel reported "switching" while the first snapshot round trip ran and the composer disabled Run task. On Daytona that window is ~0.9 s and a click or Enter inside it was silently dropped with the draft intact. Seed the snapshot cache from the create response (stale, so the real fetch still runs as a background refresh). * fix(app): let a send that settled with a server failure recover instead of wedging A prompt_async answered with 5xx/408 is an uncertain admission (#4635), but the hold it created could never end: the acceptance check treated absence as no evidence, Stop refused while the admission was unknown, and the failure body was dropped, so the person saw a paused composer with no explanation. - Keep the settled response body on PromptAdmissionUnknownError and show it as the session error card right away; the hold still prevents any resend. - readPromptAdmission: after the exact-message GET misses, list the idle conversation; when native lists it without the message the POST is settled and did not admit, so the drain receives admission_rejected and halts like any definite failure (explicit retry only, never an automatic resend). - On release the pending row is removed and the submitted composer is kept as an unsent message to restore; on confirmed acceptance the stale failure card is cleared. * test(evals): read an empty Lexical composer as an empty draft Lexical keeps one empty paragraph in an empty editor, which innerText reports as "\n". readComposerState now drops that trailing line break so draftText matches what the person sees; user.see("composer", { text }) already trimmed. * test(evals): open the fresh conversation through the sidebar's New session button The sidebar button was renamed from "New task" to "New session" in #4491 (Sep 5) and the "new" scenario added in #4631 (Sep 8) still targeted the old label, so it could never find the button. Same user action, current label. * test(evals): create the empty-session workspace at its declared tmp path 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. * test(evals): name the server error when a run-mode read is not 200 * fix(app): reuse the running OpenWork server when the selected workspace 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. * fix(app): re-read pending questions when a session reaches a terminal edge An interrupted question tool leaves the engine's pending list through its finalizer without a question.rejected event, so Stop on a delegated child left its question (and option buttons) in the parent view. Reconcile questions alongside permissions on terminal edges, for both engines. * Revert "fix(app): re-read pending questions when a session reaches a terminal edge" This reverts commit 9e70982. * fix(app): withdraw the stopped tree's unanswered questions after Stop OpenCode v1 runs tools on detached fibers: aborting a session marks the question tool part as aborted but leaves its request in GET /question, so a parent that stopped a delegated child kept showing the child's question and its option buttons. After Stop confirms the tree idle, reject the pending questions owned by the stopped sessions; other roots are left untouched. * test(evals): create the permission-stop-recovery workspace at its declared tmp path Test 2 of parent-child-permission-approval ran bash without asking although the world wrote permission.bash="ask" to the workspace opencode.json. The world called seed.workspace() without create, so it adopted the first-launch default workspace under the dev profile, which on Daytona lives inside the repo checkout; the engine merges /workspace/.opencode/opencode.json ("permission": "allow") after the workspace file and the agent ruleset ends as [* allow, bash ask, * allow] (last match wins; permissions/effective reported shell allow, source engine, workspace file .../home/OpenWork Chat/opencode.jsonc). Same trap and same remedy as #4747 for emptySession; opt-in so the other splitPaneQuestions worlds keep their arrangement. * fix(app): withdraw the stopped tree's unanswered permission requests after Stop OpenCode v1 runs tools on detached fibers: aborting a session marks the tool part as aborted but leaves its Permission.ask pending in /permission, exactly as #4786 found for questions. The stopped tree would keep showing Allow once / Deny in every pane and after reload although nothing can consume the answer. After stopForegroundTree confirms every stopped session idle, also list pending permissions and reject the ones owned by the stopped tree; other roots are never touched and each withdrawal kind is best-effort on its own.
…reusing stale per-workspace provider config (#4876) * test(server): reload a second workspace in place after another workspace'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. * fix(server): track in-place engine reloads per directory instead of per 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. * fix(app): reuse the running OpenWork server when the selected workspace 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. * test(evals): name the server error when a run-mode read is not 200 * test(evals): create the empty-session workspace at its declared tmp path 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.
… route-commit wait in world open() (#4810) * fix(app): seed the delegated-task eval with a running parent thread The eval.task_activity.seed hook rendered an in-flight child under a parent whose thread status stayed "ready": it only marked the activity store busy. Since #4635 MessageList reads that as a stopped parent and the unobserved child shows "Waiting for task result" instead of the Working shimmer, so task-activity-shimmer and parent-child-permission-approval lost their [data-subagent-activity="shimmer"] row. A delegating parent is mid-run; mark the eval thread streaming like the chat-loading seed already does. * fix(app): seed a created session's snapshot so its composer can send immediately A freshly created session had no cached snapshot, so deriveSessionRenderModel reported "switching" while the first snapshot round trip ran and the composer disabled Run task. On Daytona that window is ~0.9 s and a click or Enter inside it was silently dropped with the draft intact. Seed the snapshot cache from the create response (stale, so the real fetch still runs as a background refresh). * fix(app): let a send that settled with a server failure recover instead of wedging A prompt_async answered with 5xx/408 is an uncertain admission (#4635), but the hold it created could never end: the acceptance check treated absence as no evidence, Stop refused while the admission was unknown, and the failure body was dropped, so the person saw a paused composer with no explanation. - Keep the settled response body on PromptAdmissionUnknownError and show it as the session error card right away; the hold still prevents any resend. - readPromptAdmission: after the exact-message GET misses, list the idle conversation; when native lists it without the message the POST is settled and did not admit, so the drain receives admission_rejected and halts like any definite failure (explicit retry only, never an automatic resend). - On release the pending row is removed and the submitted composer is kept as an unsent message to restore; on confirmed acceptance the stale failure card is cleared. * test(evals): read an empty Lexical composer as an empty draft Lexical keeps one empty paragraph in an empty editor, which innerText reports as "\n". readComposerState now drops that trailing line break so draftText matches what the person sees; user.see("composer", { text }) already trimmed. * test(evals): open the fresh conversation through the sidebar's New session button The sidebar button was renamed from "New task" to "New session" in #4491 (Sep 5) and the "new" scenario added in #4631 (Sep 8) still targeted the old label, so it could never find the button. Same user action, current label. * test(evals): create the empty-session workspace at its declared tmp path 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. * test(evals): name the server error when a run-mode read is not 200 * fix(app): reuse the running OpenWork server when the selected workspace 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. * test(evals): open the saved-app verification return tab as a person's new tab returnVerification drove the agent browser entry point (browser.openUrl, the IPC behind browser.open_url) with no requesting conversation. Since #4434 the task host refuses that, and it never accepted an about:blank destination. The tab only stands in for the person's own browser so the openwork:// return link can be navigated without OS protocol registration, so create it the way a person opens a new tab and find its CDP target by diffing the page targets. * fix(app): re-read pending questions when a session reaches a terminal edge An interrupted question tool leaves the engine's pending list through its finalizer without a question.rejected event, so Stop on a delegated child left its question (and option buttons) in the parent view. Reconcile questions alongside permissions on terminal edges, for both engines. * Revert "fix(app): re-read pending questions when a session reaches a terminal edge" This reverts commit 9e70982. * fix(app): withdraw the stopped tree's unanswered questions after Stop OpenCode v1 runs tools on detached fibers: aborting a session marks the question tool part as aborted but leaves its request in GET /question, so a parent that stopped a delegated child kept showing the child's question and its option buttons. After Stop confirms the tree idle, reject the pending questions owned by the stopped sessions; other roots are left untouched. * test(evals): temporary Z2 diagnostics around dashboard delete route change * test(evals): saved-apps world.open returns once the destination page root has rendered * test(evals): create the permission-stop-recovery workspace at its declared tmp path Test 2 of parent-child-permission-approval ran bash without asking although the world wrote permission.bash="ask" to the workspace opencode.json. The world called seed.workspace() without create, so it adopted the first-launch default workspace under the dev profile, which on Daytona lives inside the repo checkout; the engine merges /workspace/.opencode/opencode.json ("permission": "allow") after the workspace file and the agent ruleset ends as [* allow, bash ask, * allow] (last match wins; permissions/effective reported shell allow, source engine, workspace file .../home/OpenWork Chat/opencode.jsonc). Same trap and same remedy as #4747 for emptySession; opt-in so the other splitPaneQuestions worlds keep their arrangement. * fix(app): withdraw the stopped tree's unanswered permission requests after Stop OpenCode v1 runs tools on detached fibers: aborting a session marks the tool part as aborted but leaves its Permission.ask pending in /permission, exactly as #4786 found for questions. The stopped tree would keep showing Allow once / Deny in every pane and after reload although nothing can consume the answer. After stopForegroundTree confirms every stopped session idle, also list pending permissions and reject the ones owned by the stopped tree; other roots are never touched and each withdrawal kind is best-effort on its own. * test(evals): remove temporary Z2 diagnostics from saved-app-creation * test(evals): make locate() misses list every candidate of the requested role plus route and page roots A miss used to quote only the first 8 visible buttons in DOM order, which are always the shell rail, so every miss read as "the page has no buttons" (#4794's diagnosis detour). The browser-side report now lists every rendered element of the requested role (buttons/links for role-less targets), the current route/hash, and whether the [data-app-header] / [data-dashboard-page] roots are mounted. The Node side caps the list at 40 and says how many the page really had. Matching is unchanged. * test(evals): run the serialized locate() miss callback against a fake page DOM Proves the browser-side branch the way Chromium will execute it: the report lists every rendered menuitem on a dashboard whose shell rail has nine buttons, names the route and mounted page roots, and a role-less miss lists all nine buttons instead of the first eight.
Fixes Cluster 9 of the 2026-09-09 E2E triage (
composer-run-mode: "workspaceopencode.jsongetspermission:{"*":"ask"}butGET permissions/effectivekeeps reporting themcpprobe asallow / source:"engine"for 60 s").Root cause
Not a server or engine-reload bug. The engine reload fires, completes, and the rebuilt instance reads the new workspace config; the workspace rule is then shadowed by an ancestor
.opencode/opencode.json.emptySession(evals/worlds/desktop.ts) declares/tmp/openwork-empty-session-<ts>but calledseed.workspace()withoutcreate, socreateAndSelectWorkspaceadopted the app's existing workspace instead. Since51c0ab92f(Streamline first launch and complete onboarding before desktop return #4608, Sep 8) first launch auto-creates a default workspace at<dev profile>/openwork-dev-data/home/OpenWork Chat; on Daytona the dev profile lives under/workspace/.openwork-daytona/..., i.e. inside the repo checkout.ConfigPaths.directorieswalks from the instance directory up to the git worktree and merges every.opencode/opencode.jsonit finds after the workspace's ownopencode.json. The engine log from a red run shows exactly that order:.opencode/opencode.json("permission": "allow", since012bd56ae) wins, so the governing agent's catch-all stays* * allow; OpenWork attributes it toenginebecause it matches none of the three layers it knows about. ThePUT permissions/modereload confirmation only checks that a snapshot exists, so it reportsrefresh: "reloaded".origin/dev@c744e2d7bin this session; last green nightlies were the two Sep 8 runs before Streamline first launch and complete onboarding before desktop return #4608 merged). The Sep 6-7 reds of this spec were a different, still-flaky failure (see below).What changed
evals/worlds/desktop.ts—emptySessionpasses{ create: true }so the spec runs against the tmp workspace it declares (same assession-shell,browser-panel,models-analytics). No assertion changed.evals/specs/composer-run-mode.e2e.test.ts— thereadhelper includes the server error body in its status assertion message (diagnostic only).apps/app/src/react-app/shell/desktop-runtime-boot.ts— exposed by (1): workspaces created from the app exist only in the server registry, so after a renderer reload the boot path hitstartServerWithoutDesktopWorkspaceand restarted the embedded server and engine although both were healthy (Drained engine closed. cause=shutdown, then ~5 s ofopencode_unconfigured400s). Before Streamline first launch and complete onboarding before desktop return #4608 this was hidden because an absent desktop workspace-state file triggered recovery fromserver.json. The boot now reuses a ready server whose remote-access mode matches and only restarts when nothing usable is running.Proof (
OPENWORK_EVAL_REFexported, fresh sandbox per run, placementdaytona)origin/dev@c744e2d7b:pnpm evals:e2e composer-run-mode --daytona→ 0 passed / 1 failed (engine applies workspace MCP asktimed out,allow / source:"engine"), 5 of 5 runs.a740eb41b(world fix only): step "Ask before actions … reaches the engine" green; next step failed withpermissions/effective 400 opencode_unconfiguredright afteruser.reload()(server restart described above).561b5c03a(this PR head):pnpm evals:e2e composer-run-mode --daytona→passed:1 failed:0 skipped:0, twice in a row (source verified561b5c03a…). One earlier run at the same sha failed only in the final step (run mode flag disabledafter 5 s, last valuetrue) — the same pre-existing flake as the Sep 7 nightly, see below.pnpm evals:e2e composer-draft-reload --daytonaat561b5c03a(the only otheremptySessionconsumer) →passed:1 failed:0 skipped:0.pnpm --filter @openwork/app exec tsc --noEmitclean.Noticed, not touched
workspace-run-mode-flaga second time in Settings → Advanced sometimes leaves the preferencetrue. The harness clicks at coordinates resolved ~250 ms earlier (waitForLocatedthenclickAt); Advanced has several async sections above the switch. Belongs with Brief B2 (harness click hardening).permissions/effectiveattributes rules from ancestor.opencode/opencode.jsonfiles toengine; a user whose workspace sits inside a repo with such a file sees "Ask before actions" selected while the engine runs everything, andPUT permissions/modestill reportsrefresh: "reloaded". Worth aprojectlayer and a real post-reload check.bootRuntimeForSelectedWorkspaceskips withno-local-workspaceand the renderer starts the server instead..opencode/opencode.json("permission": "allow") leaks into any Daytona eval whose workspace is the first-launch default folder; other specs relying on the default workspace inherit it.