Skip to content

test(qa): expect empty child completions to settle as parent history - #204299

Merged
obviyus merged 1 commit into
mainfrom
fix/qa-subagent-empty-completion-history
Nov 24, 2026
Merged

obviyus merged 1 commit into
mainfrom
fix/qa-subagent-empty-completion-history

Conversation

@obviyus

@obviyus obviyus commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

What Problem This Solves

QA Smoke CI (profile 3/6) fails on every main run since cded11f (#204178): scenario subagent-empty-completion-recovery reports empty completion did not produce exactly one system failure notice. The last green run was on e2973f9.

Why

#204178 delivers a child's end state as parent history. A completion turn that consumes the child's result is delivered, whatever it replied, and the missing-reply notice ("No answer was returned. Ask again if you still need one.") was removed. The scenario still required exactly one notice. The failing run's outbound shows only the "Working" card and the parent acknowledgement, which is the new behavior.

Change (test only)

  • Replace the one-notice assertion with the new contract: the parent completion turn consumes the failed child outcome exactly once (one provider request with [Internal task completion event]).
  • The notice text moves to forbiddenReplies, so a returning notice fails the existing leak checks.
  • After the Gateway restart: no completion request replays (unchanged); the notice-identity checks are removed.
  • The child checks are unchanged: failed terminal outcome, one real write, two tool-free finalizations, no fabricated result.

Evidence

  • Failing scheduled run 45259316971, job "QA Smoke CI (profile 3/6)": outbound = Working card + QA-SUBAGENT-EMPTY-PARENT-ACK, no notice.
  • The scenario YAML parses (45 flow actions). The QA Smoke CI shard on this PR is the run proof.

#204178 delivers a child's end state as parent history and removed the
missing-reply notice. The empty-completion scenario still required exactly
one notice, so QA Smoke profile 3/6 failed on every main run since cded11f.
Assert the new contract: the parent completion turn consumes the failed
child outcome once, no notice is sent, and a Gateway restart replays nothing.

Co-authored-by: obviyus <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 24, 2026
@obviyus
obviyus merged commit f1debfd into main Nov 24, 2026
99 checks passed
@obviyus
obviyus deleted the fix/qa-subagent-empty-completion-history branch November 24, 2026 00:52
@obviyus

obviyus commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

Landed. QA Smoke profile 3/6 failed on every main run since #204178 because this scenario still required the missing-reply notice that #204178 removed. The scenario now asserts that the parent completion turn consumes the failed child outcome once and that no notice is sent. Proof: QA Smoke CI 3/6 passed on this head.

tideclaw-bot pushed a commit that referenced this pull request Nov 24, 2026
Closes #204085

Every release-path update that changes the state schema fails on Windows today: the startup swap renames over the live SQLite files while retained handles are still open. This also affects a successful migration chain, not only its generic-copy fallback (`state-upgrade.ts:566–584,660–663`). The launcher restores the previous release, but the update cannot complete. Shipped first hops use their existing in-place update route and are not affected by this release-path defect.

The candidate releases its closed databases' retained file descriptors before the startup swap. The Windows task supervisor now skips Gateway state and config bootstrap entirely, so it holds no database connection while its child runs. The child still loads its own dotenv files and selects its database and environment. Migration and rollback keep their existing owners and preserved files. There is no schema change or new user action.

An interrupted Windows swap that already created `.pre-*` hard links can still retain admission custody and roll back; this existing, visible recovery edge is unchanged.

Closing SQLite leaves the admission owner's identity descriptor open. A native Windows control reproduces the failure with both SQLite connections closed, then permits the same rename immediately after the existing admission-retirement operation runs. The durable swap now performs that retirement for both database paths before it preserves or replaces either file.

The next open must admit the replacement's physical identity again. The launcher, trial budget, attempts, rollback policy, and SQLite file-sharing mode are unchanged. This requires the candidate fix, not a new installed launcher.

The real Windows replay exposed a second holder: the waiting task supervisor had opened the shared database during Gateway pre-bootstrap. Its only job is to launch and wait for the real Gateway. Supervisor dispatch now happens before SQLite runtime, dotenv, database-engine selection, and Gateway environment selection. The late dispatch is removed.

- Original real Control UI failure: run `4adf1716-1734-4ed5-9eee-38083120fdfc`, two starts, schema 41→42 attempt, both blocked at the canonical WAL; the previous release served after rollback.
- Native Windows reproduction on Azure: a candidate with isolated state holds its own live and prepared file descriptors when replacement fails. No supervisor targets that isolated state.
- Product-API causal control on that lease:
  ```json
  {"file":"live.sqlite","nativeClosed":true}
  {"file":"next.sqlite","nativeClosed":true}
  {"beforeRetirement":"refused","code":"EPERM","syscall":"rename"}
  {"afterRetirement":"renamed"}
  ```
- One swap-owner regression checks descriptor release, new database contents, and the preserved old contents.
- AWS Linux run [`run_604041d54425b8c7e03ba43362072ac2`](https://crabbox.openclaw.ai/portal/runs/run_604041d54425b8c7e03ba43362072ac2): all 46 focused tests passed; the new regression fails on the base because the two descriptors remain retained (not a setup failure).
- Final-head T, next and crash full distribution builds, repository packing, and archive identity/SHA-256 checks passed in AWS run [`run_60ba70a2d1888c2d832aef9a1c6c3665`](https://crabbox.openclaw.ai/portal/runs/run_60ba70a2d1888c2d832aef9a1c6c3665). The corrected fixture declares its predecessor/runtime catalog inputs before generation.
- AWS run [`run_1af4700e569a25502494c17898d4839d`](https://crabbox.openclaw.ai/portal/runs/run_1af4700e569a25502494c17898d4839d): all 37 run-main tests passed; both new supervisor cases fail on clean main base `38f4f8fe018c` because the supervisor enters SQLite startup. Final parser consumer replay [`run_e6e98aa9e306b3332caadeefe5a8615c`](https://crabbox.openclaw.ai/portal/runs/run_e6e98aa9e306b3332caadeefe5a8615c) passes `cli-root-options` and `run-main`. Final-head local review and CI are owned by the lead.
- Fixed candidate-only Windows click on `3c150b5bfa`, run `36fec6f8-d822-409f-9f00-dfb6633e0d70`, still rolled back after two canonical-WAL `EPERM` failures. Native samples every two seconds show the old task supervisor retaining that WAL across candidate starts. Final head `69f58bc4e8` includes the early, database-free supervisor dispatch, its owner regression, and the preserved ordinary parser result.
- **Windows migrating UI update passed:** run `47295f8d-1098-407b-ac2d-160cdca32158`, committed on its first start, T+1 build `0322afdd098e` serving, shared schema 42 and the new STRICT table present. The startup log explicitly reports `by migration chain`. Across 491 native `openclaw.sqlite` handle samples, task-supervisor PID 404 has zero matching lines; other processes have 12,165 matching lines, confirming the sampler was active.
- **Linux chain-mode UI update passed:** run `137ae66a-ab63-4c64-af4b-9c90ee345278`, committed on its first start, T+1 serving schema 42 with the STRICT table. The startup journal explicitly reports `by migration chain`, not generic copy.
- The retained Doctor log explains the old fixture's generic-copy fallback: its schema-41 predecessor catalog was undeclared. Earlier Linux and macOS proof used that fallback. Those runs are not counted as chain-mode proof; the corrected final-head passes above are.

Crash rollback plus healthy recovery, and reboot-before-candidate recovery, cover paths this PR does not change; they run as follow-up proof after merge. Optional plugin maintenance refused old-Gateway-owned schema mutation in the passing runs; those advisory/plugin/channel checks are not claimed as passed.

The swap repair reuses admission retirement. The supervisor repair removes its unnecessary Gateway bootstrap. There is no new user-facing API, flag, configuration, retry, timer, or stored state.

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit e2973f9)
Release adaptation: Place the custody regression before the baseline-only legacy registry fixture and integrate the startup contract in the baseline update docs. Retain the in-place update flow. Fold in only the supervisor dead-export cleanup and its test consumers from #204246.
Release companions: #204246 supervisor-only cleanup included; #204224 IPC release launcher and #204127 prepared-release plugin maintenance not applicable (src/update absent). #204275 early-main Git release check and #204253 reporting-only changes are independent, not required. #204230 and #204299 SHA mentions unrelated.
Co-authored-by: RomneyDa <[email protected]>
obviyus added a commit that referenced this pull request Nov 24, 2026
…#204367)

## What Problem This Solves

Closes #204267. The QA smoke scenario `subagent-empty-completion-recovery` asserted the child delivery failure notice that #204178 removed. #204299 already replaced that notice assertion with "the parent's completion turn consumes the failed child outcome exactly once" (provider-request count). The scenario still did not check the new contract where it lives: the parent's history.

## Change (test only)

The scenario now reads the parent transcript after the child fails, and again after the Gateway restart, and asserts:

- exactly one entry carries the failed child's status (the `[Internal task completion event]` input or a `subagent-completion` entry), and it is hidden (`display: false`) but model-visible;
- no `run-failed-before-reply` row and no displayed `subagent-*` row (the removed "System" dump of the child's raw result and the "delivery delayed" row);
- the restart does not change any of this.

The existing checks stay unchanged: failed terminal outcome, one real write, two tool-free finalizations, no fabricated result, one parent completion request, and no replay after the restart.

Production-code line delta: 0 (scenario YAML only, +21 −2).

## Evidence

- Head, same lane as CI (`OPENCLAW_BUILD_PRIVATE_QA=1 pnpm build qaRuntime`, then `node openclaw.mjs qa run --qa-profile smoke-ci --scenario subagent-empty-completion-recovery`): `passed=1 failed=0`.
- Parent transcript on head (synthetic run): the child status is one hidden `openclaw.runtime-context` entry carrying `[Internal task completion event]` with the child session key. There is no `subagent-completion` entry (the completion turn consumed it) and no `run-failed-before-reply` row.
- Base (`main` after #204299): the old scenario passes too, so this PR does not repair a red; it adds the history assertions that #204299 left out.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 24, 2026
…penclaw#204299)

## What Problem This Solves

QA Smoke CI (profile 3/6) fails on every `main` run since 7172fc1 (openclaw#204178): scenario `subagent-empty-completion-recovery` reports `empty completion did not produce exactly one system failure notice`. The last green run was on 954c6f8.

## Why

openclaw#204178 delivers a child's end state as parent history. A completion turn that consumes the child's result is delivered, whatever it replied, and the missing-reply notice ("No answer was returned. Ask again if you still need one.") was removed. The scenario still required exactly one notice. The failing run's outbound shows only the "Working" card and the parent acknowledgement, which is the new behavior.

## Change (test only)

- Replace the one-notice assertion with the new contract: the parent completion turn consumes the failed child outcome exactly once (one provider request with `[Internal task completion event]`).
- The notice text moves to `forbiddenReplies`, so a returning notice fails the existing leak checks.
- After the Gateway restart: no completion request replays (unchanged); the notice-identity checks are removed.
- The child checks are unchanged: failed terminal outcome, one real write, two tool-free finalizations, no fabricated result.

## Evidence

- Failing scheduled run 45259316971, job "QA Smoke CI (profile 3/6)": outbound = `Working` card + `QA-SUBAGENT-EMPTY-PARENT-ACK`, no notice.
- The scenario YAML parses (45 flow actions). The QA Smoke CI shard on this PR is the run proof.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 24, 2026
…openclaw#204367)

## What Problem This Solves

Closes openclaw#204267. The QA smoke scenario `subagent-empty-completion-recovery` asserted the child delivery failure notice that openclaw#204178 removed. openclaw#204299 already replaced that notice assertion with "the parent's completion turn consumes the failed child outcome exactly once" (provider-request count). The scenario still did not check the new contract where it lives: the parent's history.

## Change (test only)

The scenario now reads the parent transcript after the child fails, and again after the Gateway restart, and asserts:

- exactly one entry carries the failed child's status (the `[Internal task completion event]` input or a `subagent-completion` entry), and it is hidden (`display: false`) but model-visible;
- no `run-failed-before-reply` row and no displayed `subagent-*` row (the removed "System" dump of the child's raw result and the "delivery delayed" row);
- the restart does not change any of this.

The existing checks stay unchanged: failed terminal outcome, one real write, two tool-free finalizations, no fabricated result, one parent completion request, and no replay after the restart.

Production-code line delta: 0 (scenario YAML only, +21 −2).

## Evidence

- Head, same lane as CI (`OPENCLAW_BUILD_PRIVATE_QA=1 pnpm build qaRuntime`, then `node openclaw.mjs qa run --qa-profile smoke-ci --scenario subagent-empty-completion-recovery`): `passed=1 failed=0`.
- Parent transcript on head (synthetic run): the child status is one hidden `openclaw.runtime-context` entry carrying `[Internal task completion event]` with the child session key. There is no `subagent-completion` entry (the completion turn consumed it) and no `run-failed-before-reply` row.
- Base (`main` after openclaw#204299): the old scenario passes too, so this PR does not repair a red; it adds the history assertions that openclaw#204299 left out.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. extensions: qa-lab size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant