Repository navigation
fix(ci): retain QA profile diagnostics on failure - #143968
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 2:09 PM ET / 18:09 UTC (Revision 6). ClawSweeper reviewWhat this changesPreserve bounded, sanitized QA shard failure details in a separate diagnostic artifact when aggregation or finalization fails. Merge readiness✅ Ready for maintainer review This PR remains useful: current main and the latest release still lose aggregate diagnostics on the reported failure paths. The prior extraction-layout finding is fixed, and no blocking introduced defect was found. Priority: P2 Review scores
Verification
How this fits togetherQA Profile Evidence combines parallel test results into evidence used by the maturity scorecard. The diagnostic collector reads surviving shard statuses and workflow outcomes without deciding whether the run qualifies. flowchart TD
A[Planned QA shards] --> B[Downloaded shard results]
B --> C[Aggregation and attestation]
C --> D[Qualified evidence]
A --> E[Diagnostic collector]
B --> E
C -->|Stage outcome| E
E --> F[Separate diagnostic artifact]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +525, Config +30, Other +316. Total +871 across 4 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep failure diagnostics independently retainable while leaving evidence admission, attestation, and allow_failures decisions with their existing owners. Do we have a high-confidence way to reproduce the issue? Yes, from source: a missing or timed-out shard exits the current-main aggregate shell before status construction. This read-only review did not execute that path. Is this the best way to solve the issue? Yes. An advisory collector in the frozen workflow preserves failure information without relaxing qualification, and its extraction handling matches the pinned artifact action. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e98e95c03374. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
Punchcard-Session: clear-meadow-meadow-4g
|
Current-head validation: All runs below passed on this exact head, attempt 1:
Fresh exact-head autoreview found no actionable P0-P2 findings. ClawSweeper revision 6 reviewed this head with no findings or remaining rank-up moves. Native The retained 37 focused collector tests cover unchanged collector/test bytes, including red-before-green flat-layout regressions. Earlier heads retain their own proof and failure limits; those results are not promoted to this head. No new hosted failure-path exercise, live QA profile run or full release qualification is claimed. Named follow-up: the preexisting depth-two qualification scan in |
|
Merged via squash.
|
Related: #144392 Supersedes #145788 by @Marvinthebored. Thanks to @EnotionZ for the issue report. The original commit and authorship are preserved. ## What Problem This Solves Canceling a reply makes the next turn forget the conversation, even though earlier messages still appear in history. ## User Impact Stopping a reply keeps the established conversation available for the next turn. Invalid sessions and account boundaries still receive their existing checks. ## Why This Change Was Made Retain established native bindings on cancellation. Clear unfinished replacements on both thrown errors and returned partial-output interruptions. An incomplete fork claim is restored by current-owner cleanup even when the signal is aborted. New claims, successor publication, and recovery arming retain their abort guards; all writes retain session, lifecycle, writer, and source-binding checks. This preserves partial-output reporting from #126883 while removing cancellation-only binding invalidation. No schema, migration, configuration, protocol, or dependency change. ## Final-head evidence Head `b068bf05618ddcd3e1b28894c68ad734e0eac997` includes a one-line test-type correction that passes the existing defined session entry; the command still reloads persisted state before choosing the next native binding. All 157 tests in that file, targeted lint, and formatting pass. Production source is unchanged from `2c163fd9eb57100ae3a2eec38cb6038e5f752851`. The complete affected owner suites passed on fresh merge `4b66a1a18209c21b5e92986452b2b98b95ae6fa1`, with parents `2c163fd9eb57100ae3a2eec38cb6038e5f752851` and main `9542320aa5cdcc4af53e3b05ad75160992a34407`. All **28 complete canonical groups exited 0**: 46,971 labeled passes and 88 skips. Three cases are unlabelled in the native support summary; no status is inferred. This includes both fork-restoration cases and all four abort/timeout × established/replacement command cases. Complete current group membership, exact commands, numeric exits, and raw logs are retained. ```sh env -u NO_COLOR -u FORCE_COLOR node --import tsx scripts/ci-run-node-test-shard.mts ``` Hosted [CI run 34774482283, attempt 1](https://github.com/openclaw/openclaw/actions/runs/34774482283) passed except `checks-node-compact-small-32` and its aggregate gate. Its QA-profile routing assertion is **base-red**: the same test fails on plain main `28887b564210326174413d0d8ade72b38268d5f3` and fresh candidate/main merge `7ea7374fcf62570c9b3fa631cf17072ef5eda2d6`, both exit 1. #143968 (`07b96d9b4122e1afdd0efbb662b2335eb716dfec`) added `qa-profile-run-status.test.ts` as a sixth workflow reader without updating the five-target expectation. This PR changes none of those routing inputs. ```sh OPENCLAW_E2E_USE_PREBUILT_DIST=1 node scripts/run-vitest.mjs run \ test/scripts/test-projects.test.ts -t 'routes QA Profile Evidence' ``` ## Fork-claim correction Candidate `2c163fd9eb57100ae3a2eec38cb6038e5f752851` restores a committed fork claim after cancellation before a successor appears. Previously, restoration rejected the aborted signal, lost the fork marker, and let the next command resume the source directly. Cleanup now uses the existing current-owner settlement assertion. Stale session, lifecycle, writer, placement, and source-binding checks remain enforced. The regression fails on `e2ca5b29bfa09810aaa20eca8a1d0e85ced913c8`: the marker is absent and the next command receives `forkCliSessionOnResume=false`. After correction, both the recovery-error control and actual-signal cancellation pass; stored/cache markers and the source checkpoint remain, and the next command receives `forkCliSessionOnResume=true`. ```sh env -u NO_COLOR -u FORCE_COLOR node scripts/run-vitest.mjs run \ --config test/vitest/vitest.agents.config.ts \ src/agents/command/attempt-execution.cli.test.ts --maxWorkers=1 \ -t 'preserves a restored fork marker before a successor' ``` Fresh merge `54a5c90a8b4585f72842e380365b95263b05983d` has first parent candidate `2c163fd9eb57100ae3a2eec38cb6038e5f752851` and second parent main `adb6e518a44218650883f3daec4bd319165e0017`. All **436 tests in seven complete focused files passed**, including command successor/flag cleanup, aborted pre-successor restoration, stale-store guards, returned interruption, thrown cancellation, auto-reply, and fork-runner siblings. This bounded rerun supplements the earlier complete suites. Both real Gateway cancellation shapes also passed on that merge: before output (zero assistant events) and after first output. Both next turns resumed the same native binding, logged `historyPrompt=none`, and recalled `PEBBLE-7429`. Both drivers exited 0. The new catalog regression uses the real command/store entry point with a mocked native runner; it proves next-turn fork routing, not a new live source-transcript isolation capture. Targeted lint passed, including max-lines: ```sh pnpm exec oxlint --config .oxlintrc.json \ src/agents/command/attempt-execution.ts \ src/agents/command/attempt-execution.cli.test.ts ``` Original red evidence remains intact. Exact commands, merge identities, numeric exits, and complete captures are retained. The complete affected-suite rerun and final-head CI classification are recorded above. ## Earlier evidence Validated corrected candidate `4fd555e5957f86289cf981ce4cf4b0bb1122c679` on temporary merge `d5f41d1cd6c9b603db32deec1d60c1ba93e7e04d`. Its parents are that candidate and main `a0cce74d389d737d6dcf21de7344af10cf862f72`. All 28 complete canonical CI groups for the affected agent, reply, scheduled-run, and fast test suites exited 0 on that merge. Reporters label **46,859 tests passed and 88 skipped**. The full command persistence matrix passed, including unfinished-successor and temporary-flag cleanup for abort and timeout, plus established-binding resume. Each complete group ran through the CI command, with its canonical configuration, include list and environment preserved: ```sh node --import tsx scripts/ci-run-node-test-shard.mts ``` These are the complete affected test suites on the recorded merge. Final-head CI and its reproduced base-red exception are recorded above. Initial host setup failures were retained, then resolved by removing conflicting color settings and making GNU timeout available without replacing existing command resolution. No source assertions or timeouts were relaxed. One native summary leaves three cases unlabeled; the raw count line is retained without assigning them a status. The real Gateway was also rerun from the merge with isolated state, workspace and port: ```sh OPENCLAW_CONFIG_PATH="$PROOF/openclaw.json" OPENCLAW_STATE_DIR="$PROOF/state" \ pnpm openclaw gateway --port 21978 --bind loopback ``` `chat.send` remembered a synthetic code, a second request started a long reply, `chat.abort` canceled it, and the next `chat.send` requested the code without repeating it. | Cancellation | Recorded main | Corrected merge | | --- | --- | --- | | Before output | Fresh native session; `UNKNOWN` | Same native binding; `PEBBLE-7429` | | After first output | Fresh native session; `UNKNOWN` | Same native binding; `PEBBLE-7429` | Both drivers exited 0. Both continuations logged `useResume=true` with the same native fingerprint and `historyPrompt=none`. The pre-output run had zero assistant events before cancellation. Original red captures, merge parents, selection, exact commands, numeric exits and complete logs are preserved. Final-head CI and its reproduced base-red exception are recorded above. ## Compatibility and prior behavior This deliberately changes the cancellation-only binding invalidation retained by #126883 and #128131. Partial output remains visible, interrupted turns remain unsuccessful, and successful authentication settlement remains suppressed. Expired-session recovery from #115513 and the retired-field migration from #143347 remain unchanged. There is no schema, migration, configuration, protocol, dependency, or permission change. ## Consumers Command attempts, auto-reply turns, and scheduled turns consume the binding result. History import, session freshness, catalog continuation, export, runtime selection, and detached-media continuation read the retained binding or its explicit absence. Catalog adoption seeds a binding with `forceReuse` and a one-shot fork marker. The command path claims that marker before execution and can persist a successor before final settlement. These writes require the current session, lifecycle, writer, and expected source binding. Successful settlement removes the temporary reuse flag; interrupted replacement cleanup removes the successor and flag together. An established binding remains available after cancellation. Cancellation before a fork successor appears restores the one-shot marker, so the next command must still fork from the source. Cache updates occur at the successful commit, and scheduled continuation publication follows base-session persistence. ## Evidence limits The real Gateway sequences cover cancellation before output and after the first output. Both failed on main `fe3b2891fdeaa1a891d54cb2b306e975fc5408cf` and passed at `f9c5b148cf4d92de5211315a4e8c374bef279d9d`. The next turn resumed the same native binding without replaying local history and recalled the seeded code. The initial 272 focused tests include command persistence and next-turn routing, auto-reply retention, failed-flush cleanup, and scheduled-run settlement. They ran on the branch based on `f85a9945daaebc61d041db27b4d3175d17082e37`. The later fresh merge `d5f41d1cd6c9b603db32deec1d60c1ba93e7e04d`, recorded above, passed all 28 complete affected test groups and both real Gateway cancellation shapes. No browser-click or platform-specific UI claim is made. The two test suites that failed on the contributor head pass when applied to the refreshed main base and after correction. The original hosted failures were not reproduced in their original shard order, so their cause remains unclassified. No assertion or timeout was relaxed for this repair. ## Test ledger clarification - The ordinary-abort policy and command assertions now require retention instead of unconditional deletion. Command coverage also checks the subsequent resume. - The contributor-only interrupted-flush helper matrix was removed before the final diff because command persistence coverage supersedes it. - The retained interrupted-partial-output fixture now names an established reusable session. Its unchanged clear assertion independently protects failed transcript flush; its partial-output, unsuccessful-hook, timeout, and authentication assertions remain. - The new composition cases invoke `runAgentAttempt`, claim a fork, persist its successor, abort the actual signal, consume the production settlement result, reopen stored state, and check the next attempt. The channel regression invokes `executeAgentTurn`; the failed-flush regression invokes `runPreparedCliAgent`. Direct policy-unit assertions supplement these entry-point checks. The earlier head `e2ca5b29bfa09810aaa20eca8a1d0e85ced913c8` only replaces a retained unflushed ID with the equivalent condition at its two consumers. Review accepted that behavior-preserving delta. CI run [34769866871](https://github.com/openclaw/openclaw/actions/runs/34769866871) passed at attempt 2 on this exact head. Attempt 1 had one test failure in an unrelated QA binary-admission case; it passed on the retry without a code or timeout change and is recorded as a flake. Co-authored-by: Marvinthebored <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
openclaw#143968 added test/scripts/qa-profile-run-status.test.ts, which references .github/workflows/qa-profile-evidence.yml, so changed-target routing now selects it for that workflow. The routing expectation in test-projects.test.ts still listed the previous five owners, which turned main's tooling shard red. Add the new owner to the expected target list. (cherry picked from commit 9aecc88)
) #143968 added test/scripts/qa-profile-run-status.test.ts, which references .github/workflows/qa-profile-evidence.yml, so changed-target routing now selects it for that workflow. The routing expectation in test-projects.test.ts still listed the previous five owners, which turned main's tooling shard red. Add the new owner to the expected target list.
Compose exact CI main and preserve all reviewed production updater behavior. Use real local executor identity, executable temporary Node paths, modeled loaded service state, and the genuine sixth QA workflow owner. QA workflow owner was introduced by Vincent Koc in #143968 (07b96d9). Existing published authorship and main history are preserved.
…nds (#146350) * fix(gateway): post-ack webhook work fails with "Async work scope is closed" Plugins that defer work through runDetachedWebhookWork after a turn ends (e.g. post-agent_end memory extraction) now keep an independently owned async work lifetime: the detached callback runs in a fresh AsyncWorkScope so tracked work stays accepted after the caller's scope closes, while the live-parent root reservation and acknowledgement ordering are preserved. Fixes #144788 AI-assisted: yes * fix(hooks): keep automatic reset hooks alive after request completion * fix(agents): classify a Code Mode host-exchange deadline as a timeout A headless run and the host exchange it drives observe the same deadline. When the exchange rejects with that scope's own timeout or abort error before the scope's abort controller settles, runCodeModeWorker only inspects signal.reason, so the typed error falls through to codeModeFailureCode and the run reports internal_error. That code is the closed failure code cron automations classify with: only timeout is retryable, so an expired wall clock was recorded as a permanent internal failure and its notification lost the timeout cause. (cherry picked from commit d586df5) * test(agents): prove the headless deadline path through a real tool leg The classification cells exercise runCodeModeWorker through a substituted host. Add a case that runs the production headless entry end to end: a real worker, a real tool and the real deadline scope, with only the timer clock virtual, so the scope observes its own deadline inside the host exchange. Without the classification repair this case reports internal_error while its own message reads "code mode headless wall-clock timeout exceeded". (cherry picked from commit 38752f6) * test(agents): force the headless deadline ordering without a startup assumption The deadline case advanced the clock by a fixed margin below the wall clock and relied on worker startup taking longer than that margin. A faster run left both the inner deadline and the outer abort pending, and the assertion that would have caught it ran after an await on a tool that never settles. Park the run on a first tool leg for a fixed real span instead. The scope measures its remaining budget with an unfaked performance clock, so the second leg's deadline is always armed at least that far ahead of the abort timer, on warm runs as well as cold ones. (cherry picked from commit ff36535) * fix(hooks): preserve existing webhook cancellation semantics Keep the automatic-reset repair on the shared internal detached continuation, but restore the public webhook helper and its tests exactly to main. The public-helper migration remains in #144801; this PR no longer changes third-party cancellation inheritance. * chore(hooks): remove temporary Code Mode dependency Keep the automatic-reset lifetime repair and its shared helper unchanged. Restore the two Code Mode files to their pre-stack bytes while preserving the contributor history and webhook scope reduction. The complete four-file PR diff remains f51a1a4c after the contributor rebase. Fresh full-candidate autoreview is scoped-clean. Earlier-base remote proof passed 66 focused tests and pinned formatting; the native command ended with exit 255 before changed-gates returned a result. Current-head hosted CI must qualify the new base before landing. * fix(ci): route QA Profile Evidence to its run-status owner test #143968 added test/scripts/qa-profile-run-status.test.ts, which references .github/workflows/qa-profile-evidence.yml, so changed-target routing now selects it for that workflow. The routing expectation in test-projects.test.ts still listed the previous five owners, which turned main's tooling shard red. Add the new owner to the expected target list. (cherry picked from commit 9aecc88) --------- Co-authored-by: LiuwqGit <[email protected]> Co-authored-by: Yigtwxx <[email protected]> Co-authored-by: Vincent Koc <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
* fix(ci): retain QA profile diagnostics on failure * fix(ci): retain directly extracted QA shard diagnostics Punchcard-Session: clear-meadow-meadow-4g * fix(ci): use set lookup for QA diagnostic files Punchcard-Session: clear-meadow-meadow-4g
Related: openclaw#144392 Supersedes openclaw#145788 by @Marvinthebored. Thanks to @EnotionZ for the issue report. The original commit and authorship are preserved. ## What Problem This Solves Canceling a reply makes the next turn forget the conversation, even though earlier messages still appear in history. ## User Impact Stopping a reply keeps the established conversation available for the next turn. Invalid sessions and account boundaries still receive their existing checks. ## Why This Change Was Made Retain established native bindings on cancellation. Clear unfinished replacements on both thrown errors and returned partial-output interruptions. An incomplete fork claim is restored by current-owner cleanup even when the signal is aborted. New claims, successor publication, and recovery arming retain their abort guards; all writes retain session, lifecycle, writer, and source-binding checks. This preserves partial-output reporting from openclaw#126883 while removing cancellation-only binding invalidation. No schema, migration, configuration, protocol, or dependency change. ## Final-head evidence Head `b068bf05618ddcd3e1b28894c68ad734e0eac997` includes a one-line test-type correction that passes the existing defined session entry; the command still reloads persisted state before choosing the next native binding. All 157 tests in that file, targeted lint, and formatting pass. Production source is unchanged from `2c163fd9eb57100ae3a2eec38cb6038e5f752851`. The complete affected owner suites passed on fresh merge `4b66a1a18209c21b5e92986452b2b98b95ae6fa1`, with parents `2c163fd9eb57100ae3a2eec38cb6038e5f752851` and main `a9a9a16114bea90d6eac90486356697df2462cb9`. All **28 complete canonical groups exited 0**: 46,971 labeled passes and 88 skips. Three cases are unlabelled in the native support summary; no status is inferred. This includes both fork-restoration cases and all four abort/timeout × established/replacement command cases. Complete current group membership, exact commands, numeric exits, and raw logs are retained. ```sh env -u NO_COLOR -u FORCE_COLOR node --import tsx scripts/ci-run-node-test-shard.mts ``` Hosted [CI run 34774482283, attempt 1](https://github.com/openclaw/openclaw/actions/runs/34774482283) passed except `checks-node-compact-small-32` and its aggregate gate. Its QA-profile routing assertion is **base-red**: the same test fails on plain main `a1105f105a093f768914a29c24b70d6ba406cad8` and fresh candidate/main merge `7ea7374fcf62570c9b3fa631cf17072ef5eda2d6`, both exit 1. openclaw#143968 (`41aebf15de48524e80c95f05e0c1212f2dfd29c6`) added `qa-profile-run-status.test.ts` as a sixth workflow reader without updating the five-target expectation. This PR changes none of those routing inputs. ```sh OPENCLAW_E2E_USE_PREBUILT_DIST=1 node scripts/run-vitest.mjs run \ test/scripts/test-projects.test.ts -t 'routes QA Profile Evidence' ``` ## Fork-claim correction Candidate `2c163fd9eb57100ae3a2eec38cb6038e5f752851` restores a committed fork claim after cancellation before a successor appears. Previously, restoration rejected the aborted signal, lost the fork marker, and let the next command resume the source directly. Cleanup now uses the existing current-owner settlement assertion. Stale session, lifecycle, writer, placement, and source-binding checks remain enforced. The regression fails on `e2ca5b29bfa09810aaa20eca8a1d0e85ced913c8`: the marker is absent and the next command receives `forkCliSessionOnResume=false`. After correction, both the recovery-error control and actual-signal cancellation pass; stored/cache markers and the source checkpoint remain, and the next command receives `forkCliSessionOnResume=true`. ```sh env -u NO_COLOR -u FORCE_COLOR node scripts/run-vitest.mjs run \ --config test/vitest/vitest.agents.config.ts \ src/agents/command/attempt-execution.cli.test.ts --maxWorkers=1 \ -t 'preserves a restored fork marker before a successor' ``` Fresh merge `54a5c90a8b4585f72842e380365b95263b05983d` has first parent candidate `2c163fd9eb57100ae3a2eec38cb6038e5f752851` and second parent main `e08263bdd3341031c219bb147638f23a1f4c3c03`. All **436 tests in seven complete focused files passed**, including command successor/flag cleanup, aborted pre-successor restoration, stale-store guards, returned interruption, thrown cancellation, auto-reply, and fork-runner siblings. This bounded rerun supplements the earlier complete suites. Both real Gateway cancellation shapes also passed on that merge: before output (zero assistant events) and after first output. Both next turns resumed the same native binding, logged `historyPrompt=none`, and recalled `PEBBLE-7429`. Both drivers exited 0. The new catalog regression uses the real command/store entry point with a mocked native runner; it proves next-turn fork routing, not a new live source-transcript isolation capture. Targeted lint passed, including max-lines: ```sh pnpm exec oxlint --config .oxlintrc.json \ src/agents/command/attempt-execution.ts \ src/agents/command/attempt-execution.cli.test.ts ``` Original red evidence remains intact. Exact commands, merge identities, numeric exits, and complete captures are retained. The complete affected-suite rerun and final-head CI classification are recorded above. ## Earlier evidence Validated corrected candidate `4fd555e5957f86289cf981ce4cf4b0bb1122c679` on temporary merge `d5f41d1cd6c9b603db32deec1d60c1ba93e7e04d`. Its parents are that candidate and main `e0ad90d2bc2effce521cbde79cec2be56cece725`. All 28 complete canonical CI groups for the affected agent, reply, scheduled-run, and fast test suites exited 0 on that merge. Reporters label **46,859 tests passed and 88 skipped**. The full command persistence matrix passed, including unfinished-successor and temporary-flag cleanup for abort and timeout, plus established-binding resume. Each complete group ran through the CI command, with its canonical configuration, include list and environment preserved: ```sh node --import tsx scripts/ci-run-node-test-shard.mts ``` These are the complete affected test suites on the recorded merge. Final-head CI and its reproduced base-red exception are recorded above. Initial host setup failures were retained, then resolved by removing conflicting color settings and making GNU timeout available without replacing existing command resolution. No source assertions or timeouts were relaxed. One native summary leaves three cases unlabeled; the raw count line is retained without assigning them a status. The real Gateway was also rerun from the merge with isolated state, workspace and port: ```sh OPENCLAW_CONFIG_PATH="$PROOF/openclaw.json" OPENCLAW_STATE_DIR="$PROOF/state" \ pnpm openclaw gateway --port 21978 --bind loopback ``` `chat.send` remembered a synthetic code, a second request started a long reply, `chat.abort` canceled it, and the next `chat.send` requested the code without repeating it. | Cancellation | Recorded main | Corrected merge | | --- | --- | --- | | Before output | Fresh native session; `UNKNOWN` | Same native binding; `PEBBLE-7429` | | After first output | Fresh native session; `UNKNOWN` | Same native binding; `PEBBLE-7429` | Both drivers exited 0. Both continuations logged `useResume=true` with the same native fingerprint and `historyPrompt=none`. The pre-output run had zero assistant events before cancellation. Original red captures, merge parents, selection, exact commands, numeric exits and complete logs are preserved. Final-head CI and its reproduced base-red exception are recorded above. ## Compatibility and prior behavior This deliberately changes the cancellation-only binding invalidation retained by openclaw#126883 and openclaw#128131. Partial output remains visible, interrupted turns remain unsuccessful, and successful authentication settlement remains suppressed. Expired-session recovery from openclaw#115513 and the retired-field migration from openclaw#143347 remain unchanged. There is no schema, migration, configuration, protocol, dependency, or permission change. ## Consumers Command attempts, auto-reply turns, and scheduled turns consume the binding result. History import, session freshness, catalog continuation, export, runtime selection, and detached-media continuation read the retained binding or its explicit absence. Catalog adoption seeds a binding with `forceReuse` and a one-shot fork marker. The command path claims that marker before execution and can persist a successor before final settlement. These writes require the current session, lifecycle, writer, and expected source binding. Successful settlement removes the temporary reuse flag; interrupted replacement cleanup removes the successor and flag together. An established binding remains available after cancellation. Cancellation before a fork successor appears restores the one-shot marker, so the next command must still fork from the source. Cache updates occur at the successful commit, and scheduled continuation publication follows base-session persistence. ## Evidence limits The real Gateway sequences cover cancellation before output and after the first output. Both failed on main `0c664785f82d3af6c2101efb53d7269d30261f4c` and passed at `f9c5b148cf4d92de5211315a4e8c374bef279d9d`. The next turn resumed the same native binding without replaying local history and recalled the seeded code. The initial 272 focused tests include command persistence and next-turn routing, auto-reply retention, failed-flush cleanup, and scheduled-run settlement. They ran on the branch based on `329bc5bf9694af38477f9fd45ebe47ad86b538a9`. The later fresh merge `d5f41d1cd6c9b603db32deec1d60c1ba93e7e04d`, recorded above, passed all 28 complete affected test groups and both real Gateway cancellation shapes. No browser-click or platform-specific UI claim is made. The two test suites that failed on the contributor head pass when applied to the refreshed main base and after correction. The original hosted failures were not reproduced in their original shard order, so their cause remains unclassified. No assertion or timeout was relaxed for this repair. ## Test ledger clarification - The ordinary-abort policy and command assertions now require retention instead of unconditional deletion. Command coverage also checks the subsequent resume. - The contributor-only interrupted-flush helper matrix was removed before the final diff because command persistence coverage supersedes it. - The retained interrupted-partial-output fixture now names an established reusable session. Its unchanged clear assertion independently protects failed transcript flush; its partial-output, unsuccessful-hook, timeout, and authentication assertions remain. - The new composition cases invoke `runAgentAttempt`, claim a fork, persist its successor, abort the actual signal, consume the production settlement result, reopen stored state, and check the next attempt. The channel regression invokes `executeAgentTurn`; the failed-flush regression invokes `runPreparedCliAgent`. Direct policy-unit assertions supplement these entry-point checks. The earlier head `e2ca5b29bfa09810aaa20eca8a1d0e85ced913c8` only replaces a retained unflushed ID with the equivalent condition at its two consumers. Review accepted that behavior-preserving delta. CI run [34769866871](https://github.com/openclaw/openclaw/actions/runs/34769866871) passed at attempt 2 on this exact head. Attempt 1 had one test failure in an unrelated QA binary-admission case; it passed on the retry without a code or timeout change and is recorded as a flake. Co-authored-by: Marvinthebored <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
…claw#147293) openclaw#143968 added test/scripts/qa-profile-run-status.test.ts, which references .github/workflows/qa-profile-evidence.yml, so changed-target routing now selects it for that workflow. The routing expectation in test-projects.test.ts still listed the previous five owners, which turned main's tooling shard red. Add the new owner to the expected target list.
…nds (openclaw#146350) * fix(gateway): post-ack webhook work fails with "Async work scope is closed" Plugins that defer work through runDetachedWebhookWork after a turn ends (e.g. post-agent_end memory extraction) now keep an independently owned async work lifetime: the detached callback runs in a fresh AsyncWorkScope so tracked work stays accepted after the caller's scope closes, while the live-parent root reservation and acknowledgement ordering are preserved. Fixes openclaw#144788 AI-assisted: yes * fix(hooks): keep automatic reset hooks alive after request completion * fix(agents): classify a Code Mode host-exchange deadline as a timeout A headless run and the host exchange it drives observe the same deadline. When the exchange rejects with that scope's own timeout or abort error before the scope's abort controller settles, runCodeModeWorker only inspects signal.reason, so the typed error falls through to codeModeFailureCode and the run reports internal_error. That code is the closed failure code cron automations classify with: only timeout is retryable, so an expired wall clock was recorded as a permanent internal failure and its notification lost the timeout cause. (cherry picked from commit d586df5) * test(agents): prove the headless deadline path through a real tool leg The classification cells exercise runCodeModeWorker through a substituted host. Add a case that runs the production headless entry end to end: a real worker, a real tool and the real deadline scope, with only the timer clock virtual, so the scope observes its own deadline inside the host exchange. Without the classification repair this case reports internal_error while its own message reads "code mode headless wall-clock timeout exceeded". (cherry picked from commit 38752f6) * test(agents): force the headless deadline ordering without a startup assumption The deadline case advanced the clock by a fixed margin below the wall clock and relied on worker startup taking longer than that margin. A faster run left both the inner deadline and the outer abort pending, and the assertion that would have caught it ran after an await on a tool that never settles. Park the run on a first tool leg for a fixed real span instead. The scope measures its remaining budget with an unfaked performance clock, so the second leg's deadline is always armed at least that far ahead of the abort timer, on warm runs as well as cold ones. (cherry picked from commit ff36535) * fix(hooks): preserve existing webhook cancellation semantics Keep the automatic-reset repair on the shared internal detached continuation, but restore the public webhook helper and its tests exactly to main. The public-helper migration remains in openclaw#144801; this PR no longer changes third-party cancellation inheritance. * chore(hooks): remove temporary Code Mode dependency Keep the automatic-reset lifetime repair and its shared helper unchanged. Restore the two Code Mode files to their pre-stack bytes while preserving the contributor history and webhook scope reduction. The complete four-file PR diff remains f51a1a4c after the contributor rebase. Fresh full-candidate autoreview is scoped-clean. Earlier-base remote proof passed 66 focused tests and pinned formatting; the native command ended with exit 255 before changed-gates returned a result. Current-head hosted CI must qualify the new base before landing. * fix(ci): route QA Profile Evidence to its run-status owner test openclaw#143968 added test/scripts/qa-profile-run-status.test.ts, which references .github/workflows/qa-profile-evidence.yml, so changed-target routing now selects it for that workflow. The routing expectation in test-projects.test.ts still listed the previous five owners, which turned main's tooling shard red. Add the new owner to the expected target list. (cherry picked from commit 9aecc88) --------- Co-authored-by: LiuwqGit <[email protected]> Co-authored-by: Yigtwxx <[email protected]> Co-authored-by: Vincent Koc <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
QA profile aggregation rejects missing or timed-out shards before writing aggregate status, leaving operators without the diagnostics needed to investigate the failure.
Why This Change Was Made
A dependency-free collector runs from the frozen trusted harness after aggregation and finalization, including their failure paths. It publishes bounded, sanitized diagnostics in a separate artifact and reports collection/upload failures as warnings. Existing aggregate admission, plan attestation, finalization, qualification uploads and
allow_failuresdecisions remain authoritative.The collector now handles both layouts produced by the pinned
actions/download-artifact: one matching artifact extracted directly at the input root, or multiple artifacts in named directories. A flat root is one artifact, including its suite reports and execution folders. Both layouts use the same bounded parser; flat shard identity comes from the validated status and planned shard IDs, without inventing artifact-name provenance.User Impact
Operators retain surviving shard exit, timeout and completion details while absent planned shards remain missing. Diagnostics cover malformed, duplicate, unexpected and identity-mismatched input without exposing downloaded names or free-form payload text. Unknown aggregate exits remain unknown.
The separate
qa-profile-diagnostics-<profile>-<sha>-<run>-<attempt>artifact contains onlyqa-profile-run-status.json; it cannot qualify a run.Evidence
Current signed repair:
0d08f82fb020f57d42ef156c2b16f1da8a1dcda5(parent1c1b362288758358241894d12e2fa2b3b1613cc8).The parent contains the flat-layout repair. This child only uses
Set.hasfor fixed diagnostic filename membership; the exact patch passed targeted lint and all 37 collector tests, and fresh exact-head autoreview found no actionable P0-P2 findings.node scripts/run-vitest.mjs test/scripts/qa-profile-run-status.test.ts: 37 passed on the final committed content. Coverage includes one survivor of two planned shards, a single planned shard, normal report/execution payloads, unplanned IDs, symlinks, malformed/oversized inputs, input-byte preservation, named-directory behavior and rejection of diagnostics-only qualification.git diff --checkpassed. Independent source review and fresh exact-commit autoreview found no actionable P0-P2 findings. Normal signing hooks passed and committed blobs match the tested content.New-head hosted checks and ClawSweeper review are separate landing gates. No live QA profile or full release qualification is claimed.
Follow-up: single-artifact qualification discovery
.github/workflows/qa-profile-evidence.yml:933-934still searches only depth two for qualification inputs. This behavior predates this PR and remains unchanged. Handle the flat download layout in a separate qualification-owner change with its own aggregate, attestation and finalizer coverage; this diagnostic repair does not relax those gates.