Repository navigation
fix(runtime): bound execution and preserve cancellation progress - #1200
Merged
XuPeng-SH merged 5 commits intoNov 3, 2026
Merged
Conversation
Keep one finite admitted budget and remove ordinary completion obligations. Converge cancellation with existing Run and Session fences, retain partial results through canonical recovery, and expose bounded child activity. Align Edge capabilities and compound shell timeouts with execution. Refs matrixorigin#1199
XuPeng-SH
force-pushed
the
fix/issue-1199-execution-convergence
branch
from
November 3, 2026 02:30
555e0b7 to
a905f41
Compare
8 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Capability assessment: Updated: Shared CLI/Server cancellation distinguishes accepted intent from proven executor settlement; child inspection exposes bounded partial activity. Bash background projection uses the resolved executor authorization. Runtime lifecycle, session observability and Edge execution references are updated.
Summary
Long turns could renew their own allowance, reject ordinary completion, lose useful partial results, and repeatedly write cancellation requests while execution and Session ownership diverged. Keep a finite admitted allowance and converge cancellation through the existing Run, Session and invocation owners.
Related issue
Refs #1199. Canonical history compaction and stale-live TUI reconciliation are owned by #1196 and excluded here. This PR does not close the entire issue or claim reproduction of the original 26-minute provider stall.
Change type
User and compatibility impact
Ordinary turns can finish without artificial write/observe obligations. Incomplete and cancelled turns retain useful partial output. Cancellation stays pending until physical execution and durable ownership are settled; an unavailable owner is not treated as proof of exit. Child activity reads are bounded and explicitly partial. No history migration or compatibility shim is introduced; obsolete checkpoint fields are removed. The frozen MOI chat API is unchanged.
Architecture and complexity delta
Verification
Base:
c2e4ea411; tested head:6a72b4693. CLI, Server and harness were rebuilt from that clean commit, checked for embedded SHA/dirty status, hashed and sealed before the final live run.Incremental SCA: eight affected packages checked earlier; all subsequent Runtime/CLI changes passed
cargo clippy -p astra-runtime -p astra-cli --all-targets -- -D warnings. Formatting andgit diff --checkpass.Unit tests: initial affected library matrix produced 17,430 passes and exposed an obsolete finite-budget assertion, corrected and verified in the subsequent full Runtime/CLI run (5,910 passes). Its sole timing-sensitive cancellation fixture was replaced with a semantic deadline control; all 13 cancellation tests pass. Final Work validation/settlement suite: 37/37. Both new observable Work regressions failed against the old production code before the correction. The added receipt-priority regression also failed against
8c4d7f4ee, then passed with the correction, including typed rejection of delivery after an observed change.Actual race instrumentation: nightly ThreadSanitizer with rebuilt std passed cancellation, spawner, terminal materialization and canonical DB scopes. Final affected Work run: Runtime 308, CLI 78, ThinClient 13 passed, no race report. Scopes overlap earlier runs and are not summed as distinct tests. Baseline nightly macro warnings remain; stable Clippy passes.
Real MatrixOne: 12/12 isolated-schema tests pass: canonical commit/cold replay, multiple admissions, owner/activity isolation and paging, held Session fence, stale-local/live-remote lease, and cancellation/admission barriers. No database boundary changed afterward.
Full original local harness (sealed
5a4ccb6c7, before the final Work correction): DeepSeek-v4.1-flash, 75 original available cases: 68 passed / 7 failed. Seven additional originals require old GLM-5.2/Qwen3.7 credentials returning HTTP 401; retain them as unavailable. The shallow-history setup failure was rerun unchanged with complete history and passed.Fresh targeted harness on
8c4d7f4ee: 7/8 passed on that earlier commit: five corrected, same-semantics modern-model diagnostics all pass; the original news Work failure and an adjacent Work journey pass. The remaining strict case rejects one premature settlement after the model reads before Work genesis; it recovers and completes, but its no-rejection criterion correctly remains failed. The previous invented validation debt and unrelatedcargo checkare absent. In this one news trial, execution changed from 224.6 seconds/incomplete to 53.7 seconds/completed; this is not a throughput benchmark.Final-head public control: the unchanged original news Work case passes 1/1 on clean
6a72b4693, using the same DeepSeek-v4.1-flash root/judge and two-model registry. It completes in 12 rounds without an unrelated build; a recovered pre-existing Bash policy rejection remains visible in the trace.Remaining harness evidence and scope limits
These results are not an all-green harness claim, and diagnostic variants are not added to the original score.
/run_id, while the supported introspection result is a paged artifact with the correct previous-Run header.5a4ccb6c7, one returns the correct integer but spawns an extra unwanted child; the other returns both correct fanout markers but cannot prove the oracle's exact logical-round count: the unchanged canonical terminal projection no longer carries the legacyturn_evaluationfield. Missing proof remains unavailable, not passed.gpt-6.1-terra/max, accepted on exact commit6a72b4693and diff fingerprint1d16ab6462b9181afc9f25e70f263bbc996561930b94a666bf634456b4fe698c, with no unresolved material introduced blocker. CI results are pending.Final checklist