Repository navigation
fix(dag): capture final answers and deliver parent reports once - #736
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1dd9854a6d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5afad3162a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Audit the built-in hook skills, command prompts and session guidance against the runtime. Explain supported events, handlers, protocols and lifecycle limits, and teach background polling that resumes an idle conversation. Validate independent hook creation from a natural-language request with an isolated Qwen session, including idle-to-rewake continuation and cleanup. Both affected package typechecks and 59 focused tests passed. Refs #737
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a158e6b7e8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b0d563ab62
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Issue for this PR
Closes #735
Type of change
What does this PR do?
Why
DAG workers could report through a tool and then answer again, while the parent received a truncated preview and started another model turn to repeat the result.
Scope
Complete DAG final-response capture and parent report delivery, preserve historical workflows, and cover CLI receipt baselines, concurrent parent input, transactional events, and workflow mutation/recovery. Include the next stable release notes.
What changed
New workflows persist
final_response: capture the complete final assistant text or validate one final JSON value, withoutsubmit_resultor a resubmission nudge. Historical workflows retain their existing protocol. The selected delivery node or unique terminal synthesis node returns its report verbatim once; receipts and wake markers commit atomically. Actionable pause, failure, timeout, and clarification handling continues through the existing parent decision path. The CLI renders each new durable answer before exiting, whether consumed from a local event or fetched during idle polling, including mixed and multiple workflows. Adds 1.0.69 release notes. The final head integrates the independently reviewed Hooks PR #738 so native checks validate both features together; #738 merged first as17a42b5da4877fed73ca3bdc6405592890d759c9and its Issue #737 closed.The report and wake now use one top-level EventV2 transaction, so a rollback emits no visible report event. Structured results retain all fields, including JSON string quotes, empty strings, and objects shaped like managed file references. Failed or unfinished parent replies cannot consume a pending user request, including long tool conversations. A stale final-response validation failure preserves fresh parent input through continuation, while execution failures retain their existing semantics. Workflow extension and recovery update delivery selection without changing historical explicit non-leaf choices. The CLI retries unknown baseline reads and distinguishes verified absence from transient errors.
Approach
Keep the durable protocol and public event shapes compatible. Reuse the mailbox freshness guard, existing EventV2 projections and per-event commit hook, and canonical session ordering. Add regression cases against the real database and event stream rather than only mocked transcript writes.
Acceptance
Full final answers remain intact, delivery receipts and wakes commit together, rollback/restart does not duplicate reports, pending input survives stale validation, and extended/recovered workflows select current results. The CLI requires its current process to render newly delivered answers before exit. Native required checks must pass on the final head before merge.
How did you verify your code works?
Evidence
bun run typecheck: 31/31 workspace tasks passed.bun run lint: 4739 warnings, zero errors, existing cap 4750.bun run test:dag-core: core 153, runtime 945 (2 opt-in skips), schema 3 and TUI 63 passed; all existing coverage floors passed. Current app Chromium and TUI report rendering each passed.a158e6b7e8096a0ab0c5336f7946ab80b8337e36; its diff SHA-256 against main4e86f7f95f72720e57aeb84db2d2b93dc6f0a29dise5da2ee895ea60bc242b23acad0b1660214b50bc68b2c850165d39a2c0e0d038. Native Typecheck, Linux unit and both E2E platforms will be verified on this final head before merge.cff1423773e52b40b56c8bd53f4cae235c028c41included installed CLI and isolated Qwen, GLM and DeepSeek checks. These preceded the current review fixes and are not claimed as live acceptance of this final head.submit_resultcalls, one parent answer, and preserved receipts after restart. The local test build0.0.0-dag-final-output.3passed its build and version smoke test (SHA-256c78591ada3b3e5a1dd1b0543ff5320e8d49bc3801dfb9bd6cf1c650cfd85e5be). Administrator permissions blocked installation over/usr/local/bin/opencode; the final live tests used development source, not the old installed binary.b0d563ab62341e0ae4046a245a298b2cb90808f0: conditional missing-snapshot recovery failure, explicit rejection of start-only replan fields, completed local-command admission, and identical CLI/runtime config parsing. All four threads have a fix explanation and are resolved.0.0.0-dag-final-output.4passed version smoke; SHA-2567bd541f1a1dc48271d26307a35bac3f841e66c2b7b9ef4166e6b2ef12b1230b7. This remains source live acceptance, not installed-binary acceptance.4e86f7f95f72720e57aeb84db2d2b93dc6f0a29dis16c05906e4e2d310ca61ff68ee52ae41bf53ce96cad55065b8a1f6051582448d, identical to reviewed content. Release notes now distinguish earlier and repeated final-source evidence. New-head native CI is pending and remains mandatory before merge.Latest Three Delivery Review Fixes
2c3a4b8471cc1a8fe503a96dbf44f1b62115e0f1. Recognizes historical ended synthetic/ignored goal and subgoal dispatch failures, rejects pending-user and already-stale episodes before large report artifacts are written, and renders durable receipts without assuming cross-process event delivery. Source and answer are rendered in order and deduplicated against later events; idle polling retains one pending stream read and aborts the subscription before iterator cleanup. All three new review threads have fix explanations and are resolved.bun test --timeout 30000 test/cli/run/dag-hold.test.ts test/dag/dag-final-delivery.test.ts test/cli/run/run-dag-hold-process.test.tspassed 80 tests / 298 assertions: 47 delivery, 23 receipt, and 10 real CLI process tests. Workspace typecheck passed 31/31 tasks. Full DAG gate passed core 153 / runtime 969 (2 opt-in skips) / schema 3 / TUI 63, with unchanged coverage floors and no SDK generation drift. Lint passed at 4739 warnings / zero errors; formatting, diff checks and release-note rendering passed. Commit/push hooks repeated lint, workspace typecheck and the pinned toolchain check.b0d563ab62341e0ae4046a245a298b2cb90808f0:5a3b8a278713141d54f6213d7374791a560a70398511d19ff02d931b438002f5. Combined SHA-256 against4e86f7f95f72720e57aeb84db2d2b93dc6f0a29d:cb26e7a82e1562b46f95ee1b156d284be6aa0bab151fd86c8ea0e2dd43c1beb9. Fingerprints match the reviewed content.2c3a4b8471cc1a8fe503a96dbf44f1b62115e0f1: Typecheck 5m30s (38102359146); Unit Tests (linux) 30m58s, E2E (linux) 2m18s, E2E (windows) 6m26s (38102359092). CodeQL also passed. Native required-check readback and SpecGit checks observation agree; all review threads are resolved. Earlier green heads are not used to satisfy final-head acceptance.Screenshots / recordings
App Chromium and TUI regression harnesses verify the displayed report body and source marker.
Checklist