Skip to content

test(qa-lab): expect SIGKILL restart to resume the killed Code Mode run - #192840

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

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

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Problem

extensions/qa-lab/src/gateway-kill-restart-send.e2e.test.ts ("leaves a killed run idle until a new user message arrives") is stale on main. It asserts that a Gateway restarted after SIGKILL makes no provider requests until a fresh user message arrives.

#190964 changed that on purpose: a root session interrupted by SIGKILL now gets one ordinary resume input on the next startup. The contract is documented in docs/gateway/restart-recovery.md and proven by test/gateway-restart-resume.e2e.test.ts. That PR did not update this qa-lab test, so it now asserts the old behavior. The test is only selected by changed-node rows on broad-scope PRs, which is why it went unnoticed. Because the resume is real, the old assertion fails whenever the resume reaches the mock provider before the test's empty-requests check. That happened in both local main runs and two of three #192607 CI runs (checks-node-changed-7). The new assertion waits for the resume input, so it does not depend on that timing.

Solution

Update the test to the current contract. It keeps the same setup: a qa-channel inbound, a Code Mode wait still pending, a process-group SIGKILL, and a restart with the session row retained. It now asserts that the same session gets the standard Gateway resume input without another inbound message, and that exactly one user-role message (the resume input) follows the pre-kill transcript cursor. The fresh-inbound and empty-mock-requests steps checked the retired "stay idle" behavior, so I removed them.

Test-only change. No production code changed.

Impact

  • Unblocks changed-node CI rows that select this file.
  • Keeps qa-channel and Code Mode coverage of crash recovery: the dangling wait call is closed and the run resumes in the original session.
  • Test lines: net -12 (17 insertions, 29 deletions in one file).

Evidence

All runs are local, macOS, Node, node scripts/run-vitest.mjs run --config test/vitest/vitest.e2e.config.ts --configLoader runner extensions/qa-lab/src/gateway-kill-restart-send.e2e.test.ts --maxWorkers=1:

Tree Old test New test
99e12c88fe97 (parent of #190964, before SIGKILL resume) pass (46.7 s) fail: no resume input, times out with only inbound-message
919b0567dd1b (parent of #192501) fail: two resume requests after restart n/a
main (df93e5d0e9a8 / 1d5bc6779517) fail: expected [ {…}, {…} ] to deeply equal []; the requests carry "The Gateway restarted while you were working. Resume your work:" pass (30.9 s)
  • The CI failure on feat(release): add read-only release:watch for any publish parent #192607 matches the local main failure: job 126432244272 and job 126648493317.
  • oxfmt --check, oxlint, and tsgo -p test/tsconfig/tsconfig.extensions.test.json pass on the changed file. check:test-lines-ratchet reports net delta -12.
  • Wall time: 30.9 s, lower than the old 46.7 s. This is a full Gateway kill/restart composition with nothing cheaper to replace it. The SIGKILL resume contract itself stays owned by test/gateway-restart-resume.e2e.test.ts.
  • CI: on this PR's run 41854024874, checks-node-changed ran the file under pinned Bun and passed in 17.1 s (job 126658791849). The only red check, checks-fast-baseline-ratchets, fails on mock-exports in ui/src/pages/model-providers/profiles-view.test.tsx and ui/src/pages/sessions/sessions-page-cloud-stop.test.ts. That failure is already on main and fix(ci): restore main mock and static checks #192850 fixes it.

@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 the clawsweeper:intake:bug Preliminary submission classification; full source review pending. label Nov 4, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:needs-environment 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. 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

The PR updates the qa-lab SIGKILL test to expect an automatic resume input instead of waiting for another user message.

Example: SIGKILL interrupts the kill-restart-send conversation while a Code Mode wait is pending.

  • Before: The test incorrectly expects zero provider requests after restart.
  • After: The test waits for the standard restart input and checks that one new user-role message follows the saved transcript cursor.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, correct test repair supported by source, reported negative controls, and passing harness CI; no independent shipped-entry-point capture was inspected.
Proof confidence 🦐 gold shrimp (3/6) The maintainer-authored test correction has reported local negative controls and a successful focused CI job; no separate contributor production-proof gate applies.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: CI can reject unrelated changes because a qa-lab test still expects the retired SIGKILL behavior.
Reason: The maintainer-authored correction follows an already merged product decision and preserves distinct channel and Code Mode lifecycle coverage.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR corrects a stale restart expectation on current main, and the focused CI job passed; no actionable patch defect was found.

Priority: P2
Reviewed head: 259b3df614b6caebab8a44889451e74323f8fee8

Before merge

None.

Findings

None.

Agent review details

How this fits together

The qa-lab test sends channel input through an isolated Gateway, kills its process group during Code Mode execution, restarts it with retained session state, and inspects the transcript.

flowchart LR
  A[QA channel input] --> B[Gateway agent run]
  B --> C[Pending Code Mode wait]
  C --> D[Process group SIGKILL]
  D --> E[Gateway startup recovery]
  E --> F[Retained session transcript]
Loading

Technical review

Best possible solution:

Land the focused test correction once the inherited CI gate is resolved through its existing repair.

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

Source establishes the conflict between automatic predecessor recovery and main's zero-request assertion; the author supplies before/after failures and passes, but no target code was executed during this review.

Is this the best way to solve the issue?

This is the smallest complete correction: retain the real kill/restart composition, observe the existing resume contract, and remove assertions for retired behavior.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • SIGKILL idle expectation changes intended behavior with a stated reason (9344233: The graceful-restart simplification intentionally accepted no automatic recovery after SIGKILL; the later merged SIGKILL recovery change superseded that contract.)
  • Removed fresh-input completion sequence changes intended behavior with a stated reason (90463e2: Fixture consolidation retained fresh-input recovery checks; the subsequent graceful-restart refactor used them to demonstrate progress after the intentionally idle crash path.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Tests -12. Total -12 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 17 29 -12
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 17 29 -12

Labels

Label changes:

  • add P2: A stale integration assertion intermittently breaks CI selections despite correct production recovery 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: A stale integration assertion intermittently breaks CI selections despite correct production recovery 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 4, 2026, 10:42 AM ET / 15:42 UTC.

@RomneyDa

RomneyDa commented Nov 5, 2026

Copy link
Copy Markdown
Member Author

Superseded by #192996 (5b0e4e8), which landed the same rewrite of gateway-kill-restart-send.e2e.test.ts (resume once, then abort and accept fresh input). Merging current main into this branch leaves an empty diff, so closing.

@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