Skip to content

fix(qa): keep restart validation on the active pending wait - #128436

Merged
vincentkoc merged 1 commit into
mainfrom
fix/qa-pending-wait-correlation
Aug 24, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/qa-pending-wait-correlation

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes an issue where restart qualification could treat an earlier completed wait call as proof that the current checkpoint was still pending when one session crossed multiple Gateway replacements.

Why This Change Was Made

The restart scenarios now compare issued wait calls with call-ID-correlated completed results. This preserves the existing three-checkpoint flow while removing the incorrect dependency on checkpoint ordinal.

User Impact

There is no production runtime change. Main and release qualification now restart only while the active checkpoint wait is genuinely pending, reducing false failures and false-positive restart timing.

Evidence

  • Regression contract failed on the pre-fix scenarios: 2 failed, 9 passed.
  • node scripts/run-vitest.mjs extensions/qa-lab/src/scenario-catalog-causality.test.ts extensions/qa-lab/src/scenario-catalog.runtime-pair.test.ts
    • 2 files passed, 15 tests passed.
  • Focused mock OpenAI scenario:
    • pnpm openclaw qa suite --provider-mode mock-openai --concurrency 1 --model openai/gpt-5.6-luna --alt-model openai/gpt-5.6-luna-alt --scenario gateway-restart-inflight-run --output-dir .artifacts/qa-e2e/qa-wait-correlation
    • 1 scenario passed through three Gateway replacements.
    • 3 recovery dispatches, 1 final delivery, 0 resend notices.
  • node_modules/.bin/oxfmt --check --threads=1 extensions/qa-lab/src/scenario-catalog-causality.test.ts qa/scenarios/runtime/gateway-restart-inflight-run.yaml qa/scenarios/runtime/gateway-restart-multi-live.yaml
  • git diff origin/main...HEAD --check
  • Production LOC delta: 0. The change is limited to QA scenarios and their contract test.

@vincentkoc vincentkoc self-assigned this Aug 24, 2026
@clawsweeper

clawsweeper Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@vincentkoc
vincentkoc marked this pull request as ready for review August 24, 2026 01:02
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 24, 2026
@clawsweeper

clawsweeper Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 23, 2026, 9:09 PM ET / August 24, 2026, 01:09 UTC.

ClawSweeper review

What this changes

The PR updates two Gateway-restart QA scenarios and their contract test so a restart occurs only while an issued wait lacks a correlated completed result.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open. Current main still uses the checkpoint ordinal rather than unmatched call-ID-correlated wait results; the patch corrects that QA qualification predicate without changing production runtime behavior. No blocking correctness or security finding was identified.

Priority: P3
Reviewed head: 4b2afbbbdd8c33691e7742a516f641404608e802

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused QA repair with source-backed correlation semantics and targeted scenario coverage; no blocking issue found.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored QA-only PR is exempt from the external-contributor proof gate; its body nevertheless records a focused mock-OpenAI three-restart run.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored QA-only PR is exempt from the external-contributor proof gate; its body nevertheless records a focused mock-OpenAI three-restart run.
Evidence reviewed 6 items Current-main gap: Current main still gates the deterministic scenario with the ordinal predicate completedToolCallCounts.wait < checkpoint, so the requested qualification change is not already implemented.
Patched predicate: The branch requires issued waits to exceed completed waits before the restart, and repeats that invariant immediately before restart in the deterministic scenario.
Correlation owner: The transcript summary counts a completed result only when its tool-call ID maps to a prior assistant tool call of the same name, then separately counts issued calls.
Findings None None.
Security None None.

Live Verification

Command: pnpm openclaw qa suite --provider-mode mock-openai --concurrency 1 --model openai/gpt-5.6-luna --alt-model openai/gpt-5.6-luna-alt --scenario gateway-restart-inflight-run --output-dir .artifacts/qa-e2e/qa-wait-correlation

Result: FAIL (partial) — step 2 expect_output gateway-restart-inflight-run: expected terminal output was not visible within 30 seconds: "gateway-restart-inflight-run"

pnpm openclaw qa suite --provider-mode mock-openai --concurrency 1 --model openai/gpt-5.6-luna --alt-model openai/gpt-5.6-luna-alt --scenario gateway-restart-in
flight-run --output-dir .artifacts/qa-e2e/qa-wait-correlation
runner@runnervm76f27:/tmp/clawsweeper-live-proof-128436-KWMHtH/target$ pnpm openclaw qa suite --provider-mode mock-openai --concurrency 1 --model openai/gpt-5.6
-luna --alt-model openai/gpt-5.6-luna-alt --scenario gateway-restart-inflight-run --output-dir .artifacts/qa-e2e/qa-wait-correlation
$ node scripts/run-node.mjs qa suite --provider-mode mock-openai --concurrency 1 --model openai/gpt-5.6-luna --alt-model openai/gpt-5.6-luna-alt --scenario gate
way-restart-inflight-run --output-dir .artifacts/qa-e2e/qa-wait-correlation
pnpm openclaw qa suite --provider-mode mock-openai --concurrency 1 --model openai/gpt-5.6-luna --alt-model openai/gpt-5.6-luna-alt --scenario gateway-restart-in
flight-run --output-dir .artifacts/qa-e2e/qa-wait-correlation
[openclaw] Building TypeScript (dist is stale: missing_private_qa_dist - private QA dist entry missing).
[openclaw] Building bundled plugin assets.
[canvas] build: node scripts/bundle-a2ui.mjs
[log] ‹DIR›/a2ui.bundle.js  chunk │ size: 399.96 kB
[log] ‹DIR›/a2ui-v0.9.bundle.js  chunk │ size: 615.66 kB
[log]
[success] rolldown v1.2.0 Finished in 80.02 ms
[diffs] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts curated
[diffs-language-pack] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts full
[discord] build: node --import tsx ../../scripts/build-discord-activity-sdk.mts
[tsdown-build] invocation 1/2 finished in 0.6s
node_modules/playwright-core/lib/coreBundle.js (65821:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65821:29 ]
       │
 65821 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/playwright-core/lib/coreBundle.js (65828:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65828:29 ]
       │
 65828 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2343:30) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2343:31 ]
      │
 2343 │           ASM_CONSTS[start] = eval(func);
      │                               ──┬─
      │                                 ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2366:32) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2366:33 ]
      │
 2366 │           moduleExports[name] = eval(func);
      │                                 ──┬─
      │                                   ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the docum
… output truncated …

Assertions:

  • FAIL expect_output: gateway-restart-inflight-run

How this fits together

QA Lab loads YAML scenarios that drive an isolated Gateway and qa-channel through restart checkpoints. Transcript summaries turn persisted assistant tool calls and tool results into scenario predicates before the harness restarts the Gateway and verifies recovery.

flowchart LR
  A[QA scenario YAML] --> B[Transcript summary]
  B --> C[Issued and completed wait counts]
  C --> D[Pending wait decision]
  D --> E[Gateway restart]
  E --> F[Recovery and delivery checks]
Loading

Before merge

  • Resolve merge risk (P1) - The supplied check state still had exact-head shards in progress; merge should wait for the normal exact-head check completion.
  • Complete next step (P2) - No repair lane is needed because no actionable defect was found in this focused PR; await the normal exact-head check gate.
Agent review details

Security

None.

PR surface

Tests +7, Other 0. Total +7 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 9 2 +7
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 3 3 0
Total 3 12 5 +7

Review metrics

Metric Value Why it matters
Production versus QA LOC production +0/-0; QA scenarios/tests +12/-5 The patch changes only qualification scenarios and their contract coverage, with no shipped runtime behavior added.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the narrow QA-only predicate change after exact-head checks complete, retaining the shared transcript-summary correlation rather than adding a parallel checkpoint tracker.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land the narrow QA-only predicate change after exact-head checks complete, retaining the shared transcript-summary correlation rather than adding a parallel checkpoint tracker.

Do we have a high-confidence way to reproduce the issue?

Yes—source reproducible. Current main's ordinal predicate is visible in both restart scenarios, while the transcript owner exposes issued and call-ID-correlated completed wait counts needed to exercise the corrected condition.

Is this the best way to solve the issue?

Yes. Reusing the existing transcript-summary owner is the narrowest maintainable fix: it distinguishes issued from correlated completed waits in both invariant-sharing restart scenarios without adding runtime state.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 8646b061a20c.

Labels

Label changes:

  • add P3: This is a small QA reliability repair with no production runtime or user-facing behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored QA-only PR is exempt from the external-contributor proof gate; its body nevertheless records a focused mock-OpenAI three-restart run.

Label justifications:

  • P3: This is a small QA reliability repair with no production runtime or user-facing behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored QA-only PR is exempt from the external-contributor proof gate; its body nevertheless records a focused mock-OpenAI three-restart run.

Evidence

What I checked:

Likely related people:

  • steipete: History identifies repeated live restart coverage and replay-safe Gateway recovery commits in this area. (role: restart-recovery and QA-history contributor; confidence: high; commits: 1a946dba78f6, d14bb8ec44e1; files: qa/scenarios/runtime/gateway-restart-inflight-run.yaml, qa/scenarios/runtime/gateway-restart-multi-live.yaml)
  • vincentkoc: Prior merged QA transcript-summary and harness commits, plus the current focused repair, connect this contributor to the owner surface. (role: QA transcript and harness contributor; confidence: high; commits: a58a6f63cac3, 2547e35b0a3b; files: extensions/qa-lab/src/suite-runtime-agent-session.ts, extensions/qa-lab/src/scenario-catalog-causality.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Let the remaining exact-head checks complete before merge.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@vincentkoc
vincentkoc merged commit 19d44d3 into main Aug 24, 2026
307 checks passed
@vincentkoc
vincentkoc deleted the fix/qa-pending-wait-correlation branch August 24, 2026 01:20
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: qa-lab maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant