Skip to content

fix(qa): correct SIGKILL recovery expectation - #192428

Closed
RomneyDa wants to merge 2 commits into
mainfrom
fix/qa-kill-restart-observation
Closed

RomneyDa wants to merge 2 commits into
mainfrom
fix/qa-kill-restart-observation

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Current disposition: superseded by merged #192996

The original recovery-test repair is already on main in #192996, commit 5b0e4e8c0c934c3d75b92bdbf66bb815dbc1fd95. Its real-Gateway QA lane and complete CI run passed.

Resolved this branch's conflict by retaining main's test and removing the obsolete 39-line allocation. Reconciliation commit 8952d5be8c97 has a tree identical to integrated main cc595f5c0f6be5aedfad37507ef7c7dd2b50ee3c; no product or test delta remains against that base. git diff --cached --check, exact tree comparison, and independent source comparison passed. No runtime test rerun is claimed for this no-delta reconciliation, and upstream CI is identified as upstream proof rather than a new branch CI run.

Main preserves the intended contracts: one ordinary crash-resume input, no original-prompt replay, the same persisted session, and successful subsequent message delivery/settlement. It explicitly aborts the resumed multi-restart fixture before the subsequent message. The old branch submitted that message during recovery, but that timing was not a separate requested invariant. No duplicate regression was retained. This PR no longer needs to be merged.

Historical failed-CI attribution

Original head 058bb9d16ad8f4c5a34672a8b4cf885dac625c70: ratchet job 126306012265 reported Test lines: 6446674; ceiling: 6446537; over by: 137; net delta: +39. Main parent bf10667561bfdf36fed14c70a5f8ec97b4a01f09 already had 6,446,635 lines against a 6,446,498 ceiling: the same 137-line debt. This PR's 39-line growth was matched by its 39-line allocation. The debt came from toast #192013 (+46), #192014 (+66), #192015 (+17), and #192016 (+8). The aggregate CI gate failed downstream of that ratchet; no QA assertion failed in that run.

The classifier labeled this new based on a passing comparison main job, while explicitly lacking selected-scope comparison and the job log. Exact job evidence and source arithmetic establish the inherited failure instead; no matching-signature classifier result is claimed. No scalar increase or checker relaxation was made here.

Original proposal and proof (historical; superseded)

What Problem This Solves

Fixes a release-validation QA failure when an eligible active session resumes after its Gateway is killed with SIGKILL.

User Impact

No runtime behavior changes. The QA test now checks the current crash-recovery contract instead of requiring eligible work to remain idle.

Why This Change Was Made

The test retained the no-resume expectation from #185730. #190964 intentionally added recovery of persisted active runs after SIGKILL, and #190995 restricted unmarked recovery to the immediately preceding Gateway lifetime. The release failure and an unchanged local reproduction both contained the actual restart-resume input, not merely a late pre-kill request.

The test now observes requests after confirmed process death, distinguishes fresh user input from provider history, and requires exactly one resume input without replaying the original user input. It also verifies one original input and one resume in the transcript, a successful subsequent user reply, and terminal settlement in the same session. The existing Gateway recovery E2E retains the abandoned-session negative boundary; this PR does not change that boundary or production code.

Evidence

  • Unchanged real QA Gateway E2E reproduced the reported expected [] failure on macOS with pinned OpenClaw Bun; wrapper elapsed 263.88s including private runtime build/cold compilation.
  • Updated real QA Gateway E2E: 1 passed, test 78.848s, Vitest duration 90.37s. Uses a real Gateway child and QA transport with the synthetic mock provider; no live model claim.
  • OPENCLAW_VITEST_FS_MODULE_CACHE_PATH=/tmp/qa-kill-restart-vitest-cache node scripts/run-vitest.mjs extensions/qa-lab/src/gateway-kill-restart-send.e2e.test.ts --maxWorkers=1
  • pnpm tsgo:extensions:test — passed.
  • pnpm exec oxlint --type-aware extensions/qa-lab/src/gateway-kill-restart-send.e2e.test.ts — passed.
  • pnpm exec oxfmt --check extensions/qa-lab/src/gateway-kill-restart-send.e2e.test.ts — passed.
  • Test-line ratchet against d27139b2b220327d6f65b659c6fba0b0110fad97: exact +39 test-line allocation, zero slack; git diff --check passed.
  • Simplification: replaced the obsolete no-call oracle; no new production machinery. Independent source review found no actionable findings.
  • Local ClawSweeper review completed on exact head 058bb9d16ad8f4c5a34672a8b4cf885dac625c70 against d27139b2b220327d6f65b659c6fba0b0110fad97: no actionable findings. Read-only review did not itself run tests; execution results above are separate proof.

@clawsweeper

clawsweeper Bot commented Nov 4, 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. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed 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 4, 2026
@clawsweeper

clawsweeper Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR updates the SIGKILL QA test to require one recovery input, no original-input replay, and successful subsequent messaging.

Example: The Gateway is killed while processing the prompt marked KILL-RESTART-PROMPT.

  • Before: The test rejects automatic continuation by expecting no provider requests after restart.
  • After: The test requires exactly one restart input and verifies that a later message completes in the same session.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused test repair is sound by source inspection and has reported Gateway-harness validation, while the failing required ratchet check remains unattributed.
Proof confidence 🦐 gold shrimp (3/6) The ordinary contributor-proof gate does not apply to this maintainer-authored test-only PR; its body reports a failing unchanged scenario and passing revised scenario using a real Gateway child with a synthetic provider.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Release validation rejects intentional automatic recovery after an eligible Gateway run is killed.
Reason: The maintainer-authored change aligns an existing QA scenario with the documented recovery contract while preserving meaningful delivery and transcript checks.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR corrects an obsolete recovery expectation without changing runtime behavior; no actionable patch defects were found, but the failing ratchet check remains unattributed.

Priority: P2
Reviewed head: 058bb9d16ad8f4c5a34672a8b4cf885dac625c70

Before merge

None.

Findings

None.

Agent review details

How this fits together

The QA channel drives an isolated Gateway child against a synthetic provider, then observes provider requests, outbound replies, persisted session status, and transcript events across process death and restart.

flowchart TD
  A[QA channel input] --> B[Gateway child]
  B --> C[Synthetic provider]
  B --> D[Session database]
  E[SIGKILL and restart] --> B
  C --> F[Request assertions]
  D --> G[Transcript and settlement assertions]
  B --> H[Outbound reply assertions]
Loading

Technical review

Best possible solution:

Keep the existing Gateway QA scenario and replace its obsolete oracle with assertions for one continuation, preserved transcript input, and subsequent same-session delivery.

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

Current-main source and documentation contradict the old empty-request assertion, and the PR reports a matching unchanged-test failure; this review ran no target code.

Is this the best way to solve the issue?

The patch is a focused oracle repair using existing Gateway, provider-observation, and transcript owners, with distinct assertions for duplicate continuation and user-input replay.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 9e8cd4fd9266.

Provenance checked

  • SIGKILL recovery expectation changes intended behavior with a stated reason (9344233: The graceful-restart redesign intentionally accepted no automatic continuation after crashes; subsequent merged recovery changes explicitly superseded that choice.)
  • Provider request observation boundary changes intended behavior with a stated reason (9344233: The request cursor supported the old no-call oracle; moving it after confirmed death excludes requests belonging to the killed process.)
  • Post-kill delivery and settlement coverage keeps the original intent (c28cf4f: The hard-kill scenario protects against recovery leaving a phantom active run that blocks later sends.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 90463e2 adds extensions/qa-lab/src/gateway-kill-restart-send.e2e.test.ts:89 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 90463e20009e; files: extensions/qa-lab/src/gateway-kill-restart-send.e2e.test.ts)

PR surface

Tests +39, Other +2. Total +41 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 48 9 +39
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 2 50 9 +41

Labels

Label changes:

  • add P2: The obsolete oracle causes a release-validation failure while production recovery already implements the intended behavior.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: The obsolete oracle causes a release-validation failure while production recovery already implements the intended behavior.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 3, 2026, 7:49 PM ET / November 4, 2026, 00:49 UTC.

Resolve the conflict with #192996 by retaining its verified recovery test and removing this branch's superseded test-line allocation. The resulting tree is identical to main cc595f5.
@RomneyDa RomneyDa closed this Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: qa-lab P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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