Repository navigation
fix(app): hide the child checklist when a stopped parent receives a follow-up - #4786
Conversation
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.
…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).
…ad 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.
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.
…d 'origin/e2e/fresh-session-send-gate' into e2e/child-checklist-after-stop
… 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.
…terminal edge" This reverts commit 9e70982.
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.
|
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 (149250 ms), confidentiality-review (84476 ms), spec-provenance-review (113965 ms), desktop-den-sync-review (178850 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 (783fd41fa34d3d4aab0a1dfb412df2c80d15b7c3). 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 |
…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.
Deploying openwork with
|
| Latest commit: |
8763acc
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e26bcc6d.openwork.pages.dev |
| Branch Preview URL: | https://e2e-child-checklist-after-st.openwork.pages.dev |
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (8763acc6dabe494501398da76c327b21046beec7). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
Resync against
|
| Test | Result at 8763acc6d (with #4837 + #4812 present) |
|---|---|
| 4 — a parent answers and stops real child questions, then finishes fresh work without settling an unrelated root question | passed (328 s). All 7 steps green: an unrelated root waits for its own answer, the parent displays only its delegated child's question, reloading the parent restores the same unanswered requests, answering in the parent resumes the original child and then the parent, the parent waits on another foreground child while the unrelated question stays pending, Stop immediately followed by fresh work interrupts the child and completes only the new turn once (the #4837 path + this PR's withdrawal, incl. notSee("Child checklist")), the unrelated root remains answerable without resuming the stopped child or duplicating the follow-up. |
| 1 — switching and creating threads hydrate permissions | passed |
| 3 — a parent task surfaces and resolves its child permission | passed |
| 2 — retry recovery and stopping a permission | failed at spec line 137, step two conversations own separate real approvals: Timed out after 45000ms seeing text=printf OTHER_PERMISSION_WITNESS — byte-identical to the failure recorded in this PR's body before the resync ("#4757's cluster, unchanged by this PR"). Not attributable to #4837: same signature before #4837 existed on this branch. |
Verdict for this PR's claim: Passed on the merged head. File-level: Incomplete (test 2, #4757's cluster).
Delegated-task journey (task-activity-shimmer, ACT-01) at 8763acc6d — OPENWORK_EVAL_REF=8763acc6d… pnpm evals:e2e task-activity-shimmer --daytona → 1 failed, died in provisioning, no assertion reached:
launch remote app-web runtime task-activity-web-25580-64b13465 failed with exit 1:
Error: EACCES: permission denied, mkdir '/private' (at /tmp/task-activity-web-…-launch.mjs:6)
Root cause is in the world, not the product: evals/worlds/task-activity-web.ts (#4812) does realpath(seed.tmpPath("task-activity-web")) on the host and passes that as workspacePath to seed.appWeb; on a macOS host /tmp/… realpaths to /private/tmp/…, and the Linux sandbox's launch module then mkdirs that host path. The registered case's own example is --local. Deterministic, so I did not burn a second sandbox on it. Attribute to #4812's world (harness portability), not to #4837 and not to this PR; a Daytona verdict for ACT-01 from a macOS host needs that world to compute the workspace path the way worlds/chat.ts does for remote surfaces. Not run locally from inside this session (would compete with the hosting app's engine); happy to run pnpm evals:e2e task-activity-shimmer --local --case ACT-01 on request.
Also at 8763acc6d: bun test --isolate tests/opencode-session-native.test.ts tests/queued-drain-admission-wedge.test.ts 56 pass / 0 fail; pnpm --filter @openwork/app typecheck exit 0; git diff --check origin/dev...HEAD clean. All 7 sandboxes from both runs deleted (verified by name).
Teammate PRs compared: #4837, #4812 (and #4825 for the /path? allow-list line). Still stacked on #4723 and #4757 (both open); once they land this PR reduces to opencode-interruption.ts + the test hunk.
…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.
… 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.
Root cause
parent-child-permission-approvaltest 4 fails at spec line 354 (notSee("Child checklist")) after Stop + follow-up, identically on thedevbaseline and on #4723's run; unowned in the 2026-09-09 E2E triage (cluster:parent-child-permission-approvaltest 4). The claim was added in #4649 without runtime proof.OpenCode v1 executes tools through
EffectBridge.run.promise(session/tools.ts), i.e. on a detached fiber. Aborting a session interrupts the prompt loop and marks the tool parterror: Tool execution aborted, but thequestiontool'sQuestion.askkeeps waiting: its request stays inGET /questionuntil it is replied to or rejected, and noquestion.rejectedevent is emitted. Reproduced against the local engine (opencode1.18.25, same code path as the pinned 1.18.18) with the eval mock agent: afterPOST /session/:id/abort,/questionstill listed the request 5 s later while the session was idle;POST /question/:id/rejectthen removed it, kept the session idle, and caused no new agent request.So the parent faithfully kept showing the stopped child's pending question (and its "Child checklist"/"Child outline" buttons). This is a product gap, not intended retention: the child's tool call is already aborted, nothing can consume an answer, and a reload would resurrect the prompt from the engine list. The spec's claim stands unchanged.
What changed
apps/app/src/app/lib/opencode-interruption.ts: afterstopForegroundTreeconfirms every stopped session idle, list pending questions and reject the ones owned by the stopped tree (root + interrupted descendants). Other roots are never touched. Best-effort: a failed withdrawal does not fail Stop (the tree is already stopped). Works through the sharedClienton both engines (question.list/question.reject; the v2 adapter maps reject to form cancel).apps/app/tests/opencode-session-native.test.ts: the tree-stop test now serves a/questionlist with a stopped-tree question and an unrelated root's question, and asserts only the stopped one is rejected, after idle confirmation.An earlier attempt (re-reading pending questions on terminal edges in
session-sync.ts,9e709825e) was proven insufficient on Daytona at that sha (same failure at line 354, because the engine list still contains the orphan) and is reverted ined89128d4.This branch also merges
origin/e2e/delegated-task-shimmer(#4723) andorigin/e2e/fresh-session-send-gate(#4757) unchanged, only so test 4 is reachable; their files are not modified here.Proof
pnpm evals:e2e parent-child-permission-approval --daytonawithOPENWORK_EVAL_REF=783fd41fa34d3d4aab0a1dfb412df2c80d15b7c3(source verified in-sandbox), placement line:783fd41fanotSee(Child checklist)(line 354) andeventually(interruption removes only the stopped child's question)73b1d9397,9e709825e,783fd41fafirst run)see("printf OTHER_PERMISSION_WITNESS")) in every run — #4757's cluster, unchanged by this PRBaseline repro on the merged branch before the fix (
73b1d9397): test 4 failed at line 354 withTarget remained visible, tests 1 and 3 passed.A first run at
783fd41fanever reached Stop: a singlenotSeeCDP call afteruser.reload()stalled for 938 s (normally 3 s) and the 20 min test timeout fired; re-run per the lane's known instability.Unit:
bun test --isolate tests/opencode-session-native.test.ts tests/queued-drain-admission-wedge.test.ts→ 41 pass, 0 fail;pnpm --filter @openwork/app typecheckclean.Overall verdict for this spec file: Incomplete (test 4 Passed; tests 1/2 red for reasons outside this PR, see above). All Daytona sandboxes from these runs were deleted.
Noticed, not touched
Permission.askalso stays pending in/permissionafter abort in v1.18.x. Test 2's Stop step ("native interruption cleanup removes the pending permission", line 150) therefore cannot pass on v1 without an app-side withdrawal too — but its prose says "without a permission reply", so the fix(app): keep a brand-new session sendable while its first snapshot loads #4757 owner should decide (reject-on-Stop vs. re-expressing the claim).bashstep ran without asking (Ran command … Permission work finished.), i.e. thepermission: { bash: "ask" }policy did not take effect in the "other" session — different from the triage's line-138 failure.