Skip to content

fix(runtime): simplify question coordination and execution views - #1283

Merged
XuPeng-SH merged 4 commits into
matrixorigin:mainfrom
XuPeng-SH:fix/issue1281-execution-facts
Nov 12, 2026
Merged

XuPeng-SH merged 4 commits into
matrixorigin:mainfrom
XuPeng-SH:fix/issue1281-execution-facts

Conversation

@XuPeng-SH

@XuPeng-SH XuPeng-SH commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

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.wait requests 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

  • Bug fix
  • Documentation
  • Refactor or performance improvement
  • Test

User and compatibility impact

Sending a question no longer suspends independent work or vetoes a final answer. Models use the existing bounded agent.wait when 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

  • Canonical owner changed or extended: existing loop input boundary and direct-child completion owner; bounded question correlation; existing task projection, ephemeral status indicator and selected-workspace executor.
  • Existing implementations and callers searched: message admission/receipt/ingestion, provider lease and checkpoint restore, tool-batch wait admission, child-result finalization, fanout/persistence, CLI/SDK/Web consumers and harness evidence.
  • Superseded code removed: question-driven post-tool/finalization waits, the completion-veto API, first-seen task ordering and hidden history cap, merged reported/observed counter semantics, and verifier claims that delivery proves provider inclusion.
  • No additional execution state machine, storage, SQL scan/update or polling is introduced. The original bounded correlation owner retains exact identities and FIFO eviction; it grants no execution authority. Live hints are discarded behind durable batches or full/disconnected observers without creating replay gaps or extra flushes. No parallel implementation remains.

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):

    cargo test --locked -p astra-runtime --lib -- --test-threads=2 messaging:: explicit_observation_cutoff input_wait_ pause_during_timeout paused_dependency_
    cargo test --locked -p astra-pipeline --test crash_recovery_integration -- --test-threads=2
    cargo clippy --locked --all-targets -p astra-runtime -p astra-cli -p astra-pipeline -p astra-turn-types -p astra-server-types -p astra-turn-core -p astra-tools -p astra-test-harness -p astra-thin-client -- -D warnings
    cargo fmt --all -- --check
    RUSTFLAGS='-Zsanitizer=thread' TSAN_OPTIONS='halt_on_error=1' cargo +nightly test --locked --target x86_64-unknown-linux-gnu -Zbuild-std -p astra-runtime --lib -- --test-threads=2 messaging::e2e_loop_tests:: explicit_observation_cutoff input_wait_ pause_during_timeout paused_dependency_ shutdown_handoff

    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 used gpt-6.1-terra with max reasoning; 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

  • Tests cover real behavior at the existing owning layers.
  • Public/design contracts are updated.
  • The diff contains no credentials, private endpoints, customer data or generated output.
  • The title follows Conventional Commit format.

@mergify

mergify Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

This pull request is merged.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.

@XuPeng-SH
XuPeng-SH merged commit a4f3d71 into matrixorigin:main Nov 12, 2026
40 checks passed
@XuPeng-SH
XuPeng-SH deleted the fix/issue1281-execution-facts branch November 12, 2026 19:33
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.

[Bug]: Reconcile agent completion and make task failures actionable

1 participant