Repository navigation
fix(runtime): simplify question coordination and execution views - #1283
Conversation
|
This pull request is merged. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Reviewed the complete change on machine 57 at e22ede981f3fa07d58d410fade0532e47ef1da5a against merge-base 36f6937a5bf2a313ada604c4719a061ea958e721.
Outcome: no material findings; recommend approval.
- Design and implementation: question correlation is bounded advisory metadata, with the question-driven wait and completion veto removed. Explicit observation reuses the existing input/capacity boundary; canonical child-result custody and finalization remain responsible for unfinished or unobserved child work. No additional execution state machine, storage projection, SQL work or polling is introduced.
- Unhappy paths and performance: checked paused children, timeout/wake ordering, capacity readmission and already-started input IO, cancellation/handoff, provider rollback, late/mismatched/evicted responses, and child-output byte-budget priority. Optional wait hints remain disposable through downstream fanout, do not force durable flushes or repair gaps, and cannot leave a permanent waiting label.
- Tests and documentation were reviewed separately from production changes. The regressions exercise real message/wait handlers and loop/presentation owners. Task selection retains identity across sorting; reported and observed counts stay distinct. The existing V4 wire key/owner-generation-budget pairing, original question receipts and numeric V5/API count fields are preserved. Documentation accurately limits delivery evidence and live observations. Earlier implementation-review concerns were cross-checked against their final owners and tests.
- There were no existing GitHub code-review threads or reviews to resolve at this head.
Validation in this review: rebuilt the restored, unmodified head and ran 105 selected runtime tests covering messaging, explicit observation cutoffs, input waits, pauses and shutdown handoff: 105 passed, 0 failed. Previously recorded validation for unchanged CLI/SDK/Web, wire, crash-recovery and sanitizer scopes was inspected and reused; those full suites were not rerun here. No live provider/database journey or performance benchmark was run, and GitHub CI was not awaited. No implementation changes were made.
GitHub rejected formal approval because the authenticated reviewer is also the PR author. This COMMENT records the review conclusion only; it is not a formal approval.
Capability assessment: Unchanged: Existing CLI/Server/Web orchestration, authorized workspace execution and partial observation capabilities retain their profiles and availability. This corrects question synchronization and factual presentation within those owners; the existing capability reference's limits on retained evidence and live qualification still apply.
Summary
A question sent to a child could keep its parent waiting after all children had finished. Questions now remain asynchronous messages with bounded correlation metadata; only an explicit
agent.waitrequests observation, and the existing child-result owner still prevents finalizing before required child results reach the model.Explicit observation cutoffs preserve child custody and the original execution budgets, including pauses, capacity readmission and input transactions. Optional unanswered-question notices cannot displace retained child output. The existing task view shows its bounded retained history with active/actionable work first and stable selection. Counters distinguish observed tool starts from producer-reported totals; live wait hints reach the real status presenter and expire if their end hint is lost.
Workdir rejection now explains how to select a session rooted at an existing worktree. File, search and shell behavior is verified through that authorized workspace owner.
Related issue
Closes #1281
Change type
User and compatibility impact
Sending a question no longer suspends independent work or vetoes a final answer. Models use the existing bounded
agent.waitwhen an answer is needed. A terminal child result does not prove that a question was answered, and an answer still in transit may outlive its recipient.The strict V4 checkpoint wire, original question-receipt shape and numeric V5/API tool-count fields remain unchanged. Counts describe retained observations or reported aggregates, rather than certifying an exact live total. Rolling back to an older binary restores its older implicit question-wait behavior. No data migration is required.
Architecture and complexity delta
Verification
Initial implementation validation, reused where unchanged: 1,023 selected Rust unit tests across nine affected owners/consumers passed (Runtime 138, CLI 138, pipeline 70, shared types 296, tools 194, turn core 164, server types 4, harness 18, thin client 1). All 17 crash-recovery integration tests passed. The final affected ThreadSanitizer selection passed 51 tests, including both deadline orderings, input custody, paused children and handoff; the earlier 102-test run remains evidence for unchanged messaging/fanout/child-owner paths. SDK 205 and Web 70 tests, SDK typecheck/build, Web typecheck against the freshly built SDK, and changed-file Web ESLint passed. The unchanged task-history/worktree/guidance/cancel controls also passed.
Main executed commands (Rust 1.97.0, Node 24.20.0):
At
505c9bf, the normal runtime command passed 101 tests; the remaining 37 exact owner/HTTP/finalization tests were run from that freshly built test executable. Other selected Rust suites likewise used their fresh test executables with recorded nonempty exact selections. The sanitizer used rustc 1.97.0-nightly (66da6cae1). Independent solution/design and final overall source review usedgpt-6.1-terrawithmaxreasoning; no unresolved material source blocker remained. All remaining execution gates subsequently passed with the reviewed content unchanged.CI correction: retained the 4,000-byte guidance budget by shortening the new coordination text; aligned existing parent/workdir/selection assertions with the accepted contracts; the actual wait regression now checks timeout-driven continuation while child-result custody still blocks early completion. All five reported CI failures or their corrected replacement pass locally: 127 runtime, 38 CLI and 7 tools tests. The changed wait regression and two public-loop controls also pass ThreadSanitizer (3 tests); the affected nine-package all-target Clippy, format and diff checks pass. Independent Terra/max delta review found no material blocker. No workflow, check limit or production execution logic was changed. The new GitHub CI run is not being awaited.
Public entrypoints exercised: actual question/answer and wait handlers with controlled provider loops, authenticated run projection/tree HTTP routes, stream parser/bridge/status rendering, and real file/search/shell execution in a temporary manual Git worktree.
Unhappy paths exercised: terminal child without an answer; exact, mismatched, evicted, late and non-adopted responses; failed-provider rollback; explicit timeout before/after wakes; paused children; capacity/input IO across observation and work deadlines; cancellation/handoff; V4 restore and paired-budget rejection; escaped child results near the aggregate byte cap; full/disconnected hint lanes; stable task selection and denied workdir with no command started.
Database verification: no schema, query or storage-boundary changes. Existing in-memory/fault-injected owners verify hint disposal does not append events or advance a durable batch. Live database/provider journeys and performance measurements were not run. CI is not awaited.
Final checklist