Repository navigation
fix(work): restore continuation and simplify Edge tool handling - #1297
Conversation
|
This pull request is merged. |
d57eb09 to
7cf159a
Compare
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep review of 7cf159a against current main 2426f7d.
Recommendation: request changes for one reproducible P2 test-suite resource regression, recorded inline at the new 1000-observer test. Under the default 1024-FD environment that test fails; the controlled 8192-FD execution passes. This is an outstanding finding, not a repaired check.
Rebase is complete and published. Only the Work/Edge commit was replayed because #1295 is merged; the full source tree is identical to the pre-rebase head, and the 16-file main delta has the same SHA-256 as the previously reviewed delta. No source changes were made during this review.
No additional material production blocker found in the reviewed scope:
- Explicit continuation reaches the canonical lazy binding owner. Existing pending establishment, exact carrier identity, active-attempt, mixed-batch, owner/session and revision fences remain authoritative. Ordinary chat adds no lookup; the explicit control performs one existing recovery read.
- A later provider round cannot recreate Work simply because an earlier continuation completed: both durable semantic admission and synthetic carrier selection retain the existing bound-session check. No duplicate lifecycle or storage owner is introduced.
- Removing the Edge cache/counter/provider-round state retires the full old path and caller plumbing. Current permissions, lower file freshness/read-before-write controls, callback identity/redelivery and native dispatcher budgets remain.
- The TUI invalidation bit is guarded by the existing observer lock/generation, discards stale Bound and NotBound results and makes the existing event-loop tick perform one follow-up. Session changes and dropped observers retain their cleanup owner. The 30-second cadence and actual load measurements are described as bounded reconciliation and fixture evidence, not production capacity or a live prompt-cache guarantee.
- Implementation, tests and documentation were assessed separately. Existing real entrypoint fixtures were extended rather than replaced with assertions of internal flags; the test-pool change stops retaining workers from a terminated Tokio runtime.
Fresh validation in this review: 36 Runtime admission/plan/lifecycle tests, 287 CLI stream tests, 13 functional observer tests and 10 service plan-context tests passed (346 total). Nine database tests in that selected Runtime invocation were ignored and are not counted as passes. Formatting and diff checks passed. The 1000-observer control at FD 8192 passed separately; the default-FD execution is the reproduced failure above. Previously recorded real MatrixOne/native-entry/SQL and 46-test unsuppressed TSan evidence is reusable because the complete source tree is unchanged; those runs were not repeated here.
There were no existing PR review threads at the final head refresh. Original stale-offering changes, external skill-approval ceremony and unrecorded external effects remain unreplayed, as the PR already states. Current-head hosted CI is running without a reported failure at the last check; it was not awaited.
Review used the repository review_changes guide and the current agent on machine 57, without subagents.
GitHub rejected REQUEST_CHANGES because the authenticated account is also the PR author. This COMMENT review records the outstanding P2 finding and recommendation; it is not a formal GitHub change-request state.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Re-review of 536a166 against main 2426f7d.
No unresolved material finding. Recommendation: approve.
Reconciled the complete 17-file change map with the preceding overall review. The original 16-file Work/Edge delta is byte-identical (SHA-256 96e03d8fbc763d2515bcd9d9d938f0b9c985de5a380fab5311161550a90a4c24). The only subsequent correction adds one test-ignore attribute and the documented process-scoped load-test entry: 19 added lines, with no production or load-test body changes.
The previous P2 is verified fixed:
- The normal observer invocation has no manual skip filter and passes at FD1024: 13 passed, one explicitly identified load probe ignored.
- The exact documented opt-in command executes the complete 1000-viewer HTTP probe successfully at FD8192. Its workload, timing bounds and assertions are unchanged.
- A hard FD1024 ceiling rejects before Cargo starts; the calling shell retains its original FD1024. This is an expected preflight rejection, not an empty test pass.
- Formatting and all-target astra-cli Clippy with warnings denied passed for this content.
Checked the other test callers as well: the normal CLI nextest inventory excludes ignored tests; its explicit ignored production-supervisor lane selects three exact unrelated tests. The online Make targets select runtime/plan/services, and the nightly ignored entry selects only system_matrix_http_e2e. None accidentally admits this CLI load probe without its prerequisite.
The unchanged production design continues to use the canonical Work binding/establishment/attempt, exact invocation/callback, strict context parser and existing observer owners. Active-attempt, mixed-batch, owner/session and revision fences remain; ordinary chat gains no SQL lookup. The Edge cache/counter/round machinery is retired completely. The transient observer invalidation bit stays under its existing lock/generation and cleanup boundary. No additional production state machine, storage, poller or authority bypass is introduced.
The sole review thread is resolved with a commit-linked fix and actual boundary evidence. Existing Runtime/CLI/service, real MatrixOne/native/SQL and 46-test unsuppressed TSan evidence remains applicable to the unchanged boundaries. This re-review inspected source, test selectors and raw validation logs and checked their fingerprints; it did not rebuild or repeat those unchanged runs.
Original stale-offering, external skill-approval and unrecorded-effect incidents remain unreplayed as documented; this approval recommendation does not claim the entire #1291 incident closed. Fixture workload evidence does not establish production capacity or a live provider cache-hit rate. Current-head hosted CI is still running at the last observation and is not counted as passed.
Performed on machine 57 by the current agent under the repository review_changes guide, without subagents or source edits.
GitHub rejected APPROVE because the authenticated account is also the PR author. This COMMENT review records the approval recommendation and closure of the previous finding; it is not a formal GitHub approval.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Request changes: one verified P1 remains on 14beee7032c2c544d4cbf45e0952d7ff41b4b15f.
The continuation shortcut bypasses an already-admitted Required/Defer decision for an existing Work with a cold binding cache. The inline finding records the actual public admission, generic invocation and real-database counterexample: Start correctly creates one assignment; Defer incorrectly also creates one assignment. The negative regression fails its zero-attempt invariant, rather than a timeout or a fixture setup check.
Fresh validation on machine 57 used an isolated checkout with test-only probes and an isolated MatrixOne 4.2.8 instance. Production code remained identical to this PR:
- Original invalid self-dependent graph -> corrected graph -> real Introspect evidence -> one completed, delivered task: passed.
- Invalid graph -> clarification accepted and durably Applied -> clarification observed by the next model request -> corrected task delivered: passed.
- Two separate model-originated invalid graphs -> correction, with no host replay of either invalid carrier: passed.
- Valid graph control: passed.
- Public continuation Start control: passed.
- Public continuation Defer guard: failed; one running attempt was created instead of zero.
Provider responses were scripted over the real HTTP protocol. This does not claim a live-vendor replay of the original customer conversation. The previously recorded 46-test/16-DB, formatting and all-target Clippy evidence was checked against unchanged source; it is reused explicitly, not described as rerun here.
The owner design is otherwise coherent: Work validation remains in the existing compiler; typed non-execution comes from the handler; exact carrier reconciliation stays in the host. The Edge argument cache/counter/round machinery is retired, and the observer's bounded invalidation bit remains within its existing lock/generation. No additional production store, validator, state machine or ordinary-chat SQL path was found. Implementation, tests and documentation were assessed separately; the existing continuation test covers Start but misses the contradictory Defer case.
The earlier FD-prerequisite P2 thread is resolved and still fixed in the current tree. No additional blocker was found in the unchanged Work-plan, Edge-callback, observer or documentation boundaries. The PR continues to document its unreplayed stale-offering/external-skill/unrecorded-effect scenarios; this review does not certify all of #1291 closed.
Reviewed 2426f7dcdc8438b35901527350267c7c175c5577...14beee7032c2c544d4cbf45e0952d7ff41b4b15f using the repository review_changes guide, by the current agent without subagents or changes to the PR branch.
GitHub rejected REQUEST_CHANGES because the authenticated account is also the PR author. This COMMENT review records the blocking recommendation and verified counterexample; it is not a formal GitHub changes-requested review.
Capability assessment: Unchanged: Existing Work, native execution and CLI capabilities remain available under their canonical permission, ownership and MOI Gate contracts; this fixes continuation and observation without adding a capability or deployment profile.
Summary
A correctable direct
start_workrejection could freeze invalid arguments into host retries until a terminal contract violation. Return existing typed invalid-argument/non-execution facts, retire only the exact unadmitted rejected carrier, and let the model supply corrected arguments. Admitted operations and unknown outcomes retain exact-operation recovery.Explicit Work continuation now reaches the existing binding/recovery owner before a new semantic recommendation can create a replacement operation. It also respects the current Required/Defer decision: a plan-only turn cannot start an existing task through
run_next_work_item, including cold bindings and interrupted establishment. The existing activation rule is shared with genesis and remains effective after the genesis handoff settles. A rejection leaves the model able to acknowledge the retained plan.Related issue
Refs #1291. The context-recovery dependency #1295 is merged; this PR contains the Work/Edge follow-up on main.
The original stale-offering descriptor change, external skill-approval ceremony and unrecorded external side effects have not been replayed or proven fixed. This PR does not claim the entire incident closed or infer that an unknown side effect succeeded.
User impact
New Edge requests are no longer suppressed because a prior request had identical arguments. This retires the old sequential identical-call cap, which was not consistently enforced for parallel batches. Permissions, callback idempotency, unknown-effect custody, round budgets and deadlines retain their owners.
Retained Work does not capture unrelated follow-ups. Deferred activation creates no new attempt; a missing binding still uses the existing typed transition. Exact admitted establishment, active-attempt, mixed-batch, owner/session and revision fences remain authoritative. Task delivery, Work retention and criteria acceptance remain separate facts.
An unbound ordinary chat remains dormant until explicit refresh, board opening or a relevant event. Catalog selection does not create a push subscription.
Architecture and complexity
Canonical owners remain the Work compiler, binding resolver, establishment/attempt repositories, invocation/callback custody and existing TUI observer.
Verification
Final-source verification on machine 57 passed 50 distinct related Runtime tests, with isolated MatrixOne 4.2.8 and the actual native/HTTP boundaries:
cargo check --locked -p astra-runtime, all-target Runtime Clippy with warnings denied, andgit diff --checkpass.Native providers are scripted over the real HTTP protocol; this is not a live-vendor replay. Earlier failed test-fixture initializations and an unmatched exact-name filter are retained as failures, excluded from the passing count. No authorization guard, assertion, workload or timeout was weakened.
Previously recorded validation remains applicable to unchanged boundaries and was not rerun for this activation correction: CLI stream/observer/board tests, service plan-context tests, all affected Rust target checks, real-DB/native continuation controls and 46-test unsuppressed Rust ThreadSanitizer evidence.
The full 1000-observer probe is opt-in with the documented process-scoped FD preflight. The normal observer suite passes at FD1024; the complete probe passes at FD8192; a hard FD1024 ceiling rejects before Cargo starts without changing the caller's limit. Its isolated four-connection fixture measured 2000 HTTP requests and 4000 SELECTs in about 1.39 seconds, refresh p95 about 1.25 seconds. These are fixture measurements, not production capacity. The normal cadence test crosses the old two-second interval without extra reads and exercises the 30-second fallback through its existing elapsed-time witness.
Original customer browser/cross-instance traces and live-provider prompt-cache hit rates remain unverified. Stable system/tool prefixes and MOI Gate remain intact; the existing cache-prefix recovery controls pass. Hosted CI is inspected after pushing and is not awaited.
Change type and checklist