Skip to content

fix(app): surface delegated questions in the parent conversation - #4579

Merged
reachjalil merged 3 commits into
devfrom
fix/delegated-question-handoff
Sep 6, 2026
Merged

reachjalil merged 3 commits into
devfrom
fix/delegated-question-handoff

Conversation

@reachjalil

Copy link
Copy Markdown
Member

Summary

Restore the ability to answer a delegated session's question from its parent conversation, so the child and the waiting parent can continue.

  • Use the parent's existing descendant scope for questions as well as permissions. Unrelated roots remain isolated.
  • Retain incoming child questions even before their transcripts are tracked.
  • Reply using the original request ID and clear the actual owning child's queue and waiting state only after success.
  • Preserve live questions during snapshot refresh and prevent a late list or replay from resurrecting a settled request.
  • Extend the existing parent/child approval journey with real v2 delegation, native question forms, reload, original-request settlement, both sessions completing, and an unrelated pending-question control. No new test files or engine changes.

What regressed

The working cross-session question handoff was introduced in #705. The React cutover in #1470 removed that store path. #1867 restored inline questions but subscribed only to the selected session's question cache. The descendant aggregation later restored for permissions in #4270 never reached questions.

There was a separate recent v2 transport omission in #4388: question listing was empty and native form events/replies were not bridged. #4550 fixed that transport path, but left the parent-only selector intact. A native child form could therefore be pending while the parent displayed no answer control. The parent waits for its child; the child waits for the unseen answer.

These findings are from source/history review and an isolated real-engine journey, not an inspection of any particular user's private session.

Verification — Incomplete overall; targeted v2 handoff Passed

Head: c6fe518c14a069e0f704cece3a48903b243c60e7
Base: 89933074f80ad68fbe3f0fad725ab1f9ff5f19a4

Passed on the final head:

  • OPENWORK_EVAL_REF=c6fe518c14a069e0f704cece3a48903b243c60e7 OPENWORK_EVAL_ENGINE=v2 pnpm evals:e2e parent-child-permission-approval — exit 0; 2 passed, 0 failed, 0 skipped. placement: daytona (daytona CLI authenticated). Fresh desktop and Den resources checked out the exact head and were deleted after the run.
  • bun test --isolate apps/app/tests/session-sync-permissions.test.ts — exit 0; 19 passed, 0 failed. Covers early child events, owner isolation, rejection, stale snapshots, and waiting-state preservation.
  • pnpm --filter @openwork/app typecheck — exit 0.
  • git diff --check origin/dev...HEAD — passed.

Earlier attempts were repaired in the same Daytona lane: local collection first needed the existing world-package dependency links; the new test then needed sidebar navigation instead of a composer-readiness-gated control call, and a visible-title locator for restored session rows. Final runtime assertions pass without weakening question ownership or completion checks.

Incomplete tooling checks: the full pnpm --dir evals run typecheck returned missing dependency/build declarations and errors outside the edited files in the initially partial install. The repository-wide channel ratchet also reported failures in other specs; the chained boundary check consequently did not run. Neither broad check is claimed green or classified as pre-existing without a clean control. They were not expanded into unrelated repairs.

Deferred: v1 runtime matrix, secondary-pane descendant discovery (especially cross-workspace), and stream-disconnect recovery. This PR fixes main-thread handoff; it does not change child-card presentation/navigation, engine permissions, or expose a new reject control. No merge, release, or deployment is included.

@vercel

vercel Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openwork-app Ready Ready Preview Sep 6, 2026 8:04pm UTC
openwork-den Ready Ready Preview Sep 6, 2026 8:04pm UTC
openwork-diagnostics Ready Ready Preview Sep 6, 2026 8:04pm UTC
openwork-landing Ready Ready Preview, v0 Sep 6, 2026 8:04pm UTC

@reachjalil

reachjalil commented Sep 6, 2026 •

Copy link
Copy Markdown
Member Author

Test evidence — a-parent-answers-its-real-child-question-without-settling-an-unrelated-root-ques — ✅ passed

SHA c6fe518 · engine v2

✅ 0/2 screenshots passed · 0 expectations passed · 0 failed · 0 pending

screenshots not attached (gh < 2.99; run brew upgrade gh)

[world] desktop(daytona) · workspace(/tmp/openwork-workspace-spec-1788724673439) · session("New task") · [seed:raw] evalIn() · mock(mcp) · den(daytona) · desktop(as admin) · workspace(/tmp/openwork-delegated-question-handoff-1788724922294) · [seed:raw] evalIn() ×4 · session("Delegated question parent") · session("Unrelated question root")
[user] type(composer, "Help me choose the unrelated task format") · press(Enter) · see(text=Which format should the unrelated task use?, timeoutMs=45000)
[probe] desktopApi(GET /workspace/ws_9fbf9217cadd/opencode2/api/form/request) · eventually(the unrelated root owns a real question request) · desktopApi(GET /workspace/ws_9fbf9217cadd/opencode2/api/session/ses_f87af9c6bffeDF0Lm4m0G6I8Pc)
[user] text=Delegated question parent · click(text=Delegated question parent)
[probe] hash · eventually(the requested root conversation is selected)
[user] notSee(text=Which format should the unrelated task use?) · type(composer, "Delegate choosing the task format, then report the result.") · press(Enter)
[probe] desktopApi(GET /workspace/ws_9fbf9217cadd/opencode2/api/form/request) ×3 · eventually(the real subagent asks its question) · desktopApi(GET /workspace/ws_9fbf9217cadd/opencode2/api/session/ses_f87af76e5ffek6zU8vc0UIclK5) · desktopApi(GET /workspace/ws_9fbf9217cadd/opencode2/api/session/ses_f87afa193ffeTSbTEz5zBGZR3D) · desktopApi(GET /workspace/ws_9fbf9217cadd/opencode2/api/session/ses_f87af9c6bffeDF0Lm4m0G6I8Pc)
[user] see(text=Which format should the child task use?, timeoutMs=30000) · notSee(text=Which format should the unrelated task use?) · notSee(label=/^Unrelated outline/)
[probe] hash · desktopApi(GET /workspace/ws_9fbf9217cadd/opencode2/api/session/ses_f87af76e5ffek6zU8vc0UIclK5/context)
[user] reload · see(text=Which format should the child task use?, timeoutMs=45000)
[probe] hash · desktopApi(GET /workspace/ws_9fbf9217cadd/opencode2/api/form/request)
[user] notSee(text=Which format should the unrelated task use?) · screenshot · label=/^Child checklist/ · click(label=/^Child checklist/)
[probe] desktopApi(GET /workspace/ws_9fbf9217cadd/opencode2/api/form/request) ×2 · eventually(only the original child request is settled) · desktopApi(GET /workspace/ws_9fbf9217cadd/opencode2/api/session/ses_f87af76e5ffek6zU8vc0UIclK5/form/frm_078508bc0001e5V1Nx1PwtI9si/state) · desktopApi(GET /workspace/ws_9fbf9217cadd/opencode2/api/session/ses_f87af9c6bffeDF0Lm4m0G6I8Pc/form/frm_078506fea001zDNHipXkbs7fsS/state) · desktopApi(GET /workspace/ws_9fbf9217cadd/opencode2/api/session/ses_f87af76e5ffek6zU8vc0UIclK5/context) · eventually(question settles and its session returns the actual answer) · desktopApi(GET /workspace/ws_9fbf9217cadd/opencode2/api/session/ses_f87af76e5ffek6zU8vc0UIclK5) · eventually(the native session records successful completion) · desktopApi(GET /workspace/ws_9fbf9217cadd/opencode2/api/session/ses_f87afa193ffeTSbTEz5zBGZR3D/context) · eventually(subagent settles and its session returns the actual answer) · desktopApi(GET /workspace/ws_9fbf9217cadd/opencode2/api/session/ses_f87afa193ffeTSbTEz5zBGZR3D) · eventually(the native session records successful completion)
[user] see(text=/User has answered your questions:.="Child checklist"/) · notSee(label=/^Child checklist/)
[probe] hash · desktopApi(GET /workspace/ws_9fbf9217cadd/opencode2/api/form/request) · desktopApi(GET /workspace/ws_9fbf9217cadd/opencode2/api/session/ses_f87af9c6bffeDF0Lm4m0G6I8Pc/context)
[user] text=Unrelated question root · click(text=Unrelated question root)
[probe] hash · eventually(the requested root conversation is selected)
[user] see(text=Which format should the unrelated task use?) · notSee(text=Which format should the child task use?) · label=/^Unrelated outline/ · click(label=/^Unrelated outline/)
[probe] desktopApi(GET /workspace/ws_9fbf9217cadd/opencode2/api/session/ses_f87af9c6bffeDF0Lm4m0G6I8Pc/context) ×2 · eventually(question settles and its session returns the actual answer) · desktopApi(GET /workspace/ws_9fbf9217cadd/opencode2/api/session/ses_f87af9c6bffeDF0Lm4m0G6I8Pc) · eventually(the native session records successful completion)
[user] see(text=/User has answered your questions:.
="Unrelated outline"/)
[probe] desktopApi(GET /workspace/ws_9fbf9217cadd/opencode2/api/form/request) · desktopApi(GET /workspace/ws_9fbf9217cadd/opencode2/api/session/ses_f87afa193ffeTSbTEz5zBGZR3D/context) · desktopApi(GET /workspace/ws_9fbf9217cadd/opencode2/api/session/ses_f87af76e5ffek6zU8vc0UIclK5/context)
[user] screenshot
steps 1 ✅ an unrelated root waits for its own answer (2.7s) · 2 ✅ the parent displays only its delegated child's question (14.1s) · 3 ✅ reloading the parent restores the same unanswered requests (6.3s) · 4 ✅ answering in the parent resumes the original child and then the parent (7.0s) · 5 ✅ the unrelated root remains answerable without changing the parent's result (7.3s)
verdict passed · 14 user observations (see ×6, notSee ×6, screenshot ×2) · 42 probes · steps 5/5

⚪ UNVALIDATED — 1. a-parent-answers-its-real-child-question-without-settling-an-unrelated-root-ques artifact 1

  • ⚪ UNVALIDATED — no visual expectations recorded.

⚪ UNVALIDATED — 2. a-parent-answers-its-real-child-question-without-settling-an-unrelated-root-ques artifact 2

  • ⚪ UNVALIDATED — no visual expectations recorded.

Test run created 2026-09-06T19:56:07.967Z · Source: evals/results/test-runs/2026-09-06T19-56-07-967Z-a-parent-answers-its-real-child-question-without-settling-an-unrelated-root-ques/test-run.json · Repro: pnpm --dir evals artifacts:publish -- --pr 4579 --test-run 2026-09-06T19-56-07-967Z-a-parent-answers-its-real-child-question-without-settling-an-unrelated-root-ques


Test evidence — a-parent-task-surfaces-and-resolves-its-child-session-permission-request — ✅ passed

SHA c6fe518 · engine v2

✅ 0/1 screenshots passed · 0 expectations passed · 0 failed · 0 pending

screenshots not attached (gh < 2.99; run brew upgrade gh)

[world] desktop(daytona) · workspace(/tmp/openwork-workspace-spec-1788724512974) · session("New task") · [seed:raw] evalIn()
[user] see(text=/Needs permission/, timeoutMs=30000) · see(text=/Requested by Investigate the deployment failure/) · see(text=/git status --short --branch/) · see(Deny) · see(Allow once) · see(Allow for session)
[probe:raw] [probe:raw] eval()
[user] screenshot · Allow once · click(Allow once) · notSee(text=/Requested by Investigate the deployment failure/) · notSee(text=/Needs permission/)
[probe:raw] [probe:raw] eval()
steps 1 ✅ The parent exposes the child request (2.0s) · 2 ✅ Approving clears the blocked state (18.9s)
verdict passed · 9 user observations (see ×6, screenshot ×1, notSee ×2) · 2 probes · steps 2/2

⚪ UNVALIDATED — 1. a-parent-task-surfaces-and-resolves-its-child-session-permission-request artifact 1

  • ⚪ UNVALIDATED — no visual expectations recorded.

Test run created 2026-09-06T19:53:31.913Z · Source: evals/results/test-runs/2026-09-06T19-53-31-912Z-a-parent-task-surfaces-and-resolves-its-child-session-permission-request/test-run.json · Repro: pnpm --dir evals artifacts:publish -- --pr 4579 --test-run 2026-09-06T19-53-31-912Z-a-parent-task-surfaces-and-resolves-its-child-session-permission-request

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (c6fe518c14a069e0f704cece3a48903b243c60e7). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

This branch was successfully deployed

4 active deployments
Preview – openwork-landing — c6fe518c Deployed Sep 6, 2026 by vercel[bot]
Preview – openwork-den — c6fe518c Deployed Sep 6, 2026 by vercel[bot]
Preview – openwork-app — c6fe518c Deployed Sep 6, 2026 by vercel[bot]
Preview – openwork-diagnostics — c6fe518c Deployed Sep 6, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant