Skip to content

test(qa): preserve task cancellation across process replacement - #147382

Merged
fuller-stack-dev merged 1 commit into
mainfrom
openclaw/orchestration-cancel-restart-proof-20260913
Sep 13, 2026
Merged

fuller-stack-dev merged 1 commit into
mainfrom
openclaw/orchestration-cancel-restart-proof-20260913

Conversation

@fuller-stack-dev

Copy link
Copy Markdown
Member

Summary

Add two isolated real-Gateway cancellation/restart checks to the existing QA-lab subagent fixture:

  • Cancel a genuinely running child through tasks.cancel, then gracefully replace the Gateway.
  • Cancel the child, terminate only the fixture Gateway process group, then start its replacement.

Heartbeat is explicitly disabled in effective configuration on every boot and checked against scheduled jobs and observed provider requests.

What the tests verify

  • The task, run, child session, requester, delivery route, physical session IDs, task/subagent generations, and lifecycle identity remain attached to the original cancelled work.
  • Exactly one canonical cancellation-request confirmation is allowed. No completion reply, new provider work, or duplicate output appears after cancellation or across a full65-second registry-sweep observation window after replacement.
  • The replacement uses a different PID. Only the fixture's isolated processes and temporary state are touched.

This is test-only. No product, schema, default configuration, or operator service change.

Evidence and limits

Both replacement cases pass against the final test source. The independent P0–P2 review is clean after fixing traffic-observation and custody assertions; required changed-code checks pass. A final null-safe assertion typing adjustment preserves the same runtime checks.

These are local source-based embedded-runtime/qa-channel proofs with a synthetic provider. They do not establish native/remote executor behavior, installed-package compatibility, or the separate accepted-but-unfinished parent handoff path. The broader orchestration reliability work remains open. This extends the heartbeat-disabled process proof already landed in #147313.

@clawsweeper

clawsweeper Bot commented Sep 13, 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 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 Sep 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 4:36 PM ET / 20:36 UTC.

ClawSweeper review

What this changes

Adds QA tests verifying that explicitly cancelled background tasks remain cancelled after graceful Gateway replacement or process loss, without heartbeat assistance or unexpected output.

Merge readiness

✅ Ready for maintainer review

Keep open: the cancellation cases add distinct coverage beyond the merged restart-recovery test, and no actionable patch defect was found. The MEMBER-authored, maintainer-labeled PR is also protected from automatic closure.

Priority: P3
Reviewed head: 42fecc5b6e2381d41d656cf4d73cd5488b535f2c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Focused, useful boundary coverage with no concrete correctness or security finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The MEMBER-authored test-only PR is exempt from the external-contributor proof gate; its body reports both real-Gateway cancellation/replacement cases passing with a synthetic provider, which this review did not independently execute.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The MEMBER-authored test-only PR is exempt from the external-contributor proof gate; its body reports both real-Gateway cancellation/replacement cases passing with a synthetic provider, which this review did not independently execute.
Evidence reviewed 8 items Verified introduced scope: The pinned merge-base-to-head comparison contains only the added cancellation test cases; unrelated endpoint drift is not attributed to this PR.
Meaningful cancellation boundary: The cases wait for a running task with an unfinished tool call, invoke tasks.cancel, require one cancellation notice, replace the process, and check unchanged generations, session identities, provider request count, and outbound messages.
Actual process replacement and observation: The existing Gateway helper launches a detached child and replaces it through its lifecycle owner. The transport's quiet-window helper checks accumulated outbound messages after waiting, so transient messages remain observable.
Findings None None.
Security None None.

How this fits together

QA Lab launches an isolated Gateway with a synthetic provider and test channel. These tests send work through the plugin interface, cancel it through the Gateway API, and observe persisted task state and delivery after replacing the process.

flowchart TD
  A[Test channel request] --> B[Isolated Gateway]
  B --> C[Running background task]
  D[Task cancellation request] --> C
  C --> E[Persisted cancelled state]
  E --> F[Replacement Gateway]
  F --> G[Unchanged task identity]
  F --> H[No new provider work or replies]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +273. Total +273 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 273 0 +273
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 273 0 +273

Review metrics

Metric Value Why it matters
Replacement coverage 2 replacement modes; 65-second observation per mode Graceful replacement and process loss exercise cancellation persistence across the existing 60-second registry sweep interval.

Technical review

Best possible solution:

Retain cancellation coverage alongside interrupted-task recovery coverage, using the existing isolated Gateway fixture and lifecycle owner.

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

Not applicable: this is coverage for an existing cancellation contract, not a reported current failure; the scenarios were inspected but not executed during this read-only review.

Is this the best way to solve the issue?

Yes: extending the existing process fixture tests cancellation through the registered API and observes persistent state and downstream traffic without adding production seams.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This strengthens isolated reliability coverage without changing production behavior.
  • 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: The MEMBER-authored test-only PR is exempt from the external-contributor proof gate; its body reports both real-Gateway cancellation/replacement cases passing with a synthetic provider, which this review did not independently execute.

Label justifications:

  • P3: This strengthens isolated reliability coverage without changing production behavior.
  • 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: The MEMBER-authored test-only PR is exempt from the external-contributor proof gate; its body reports both real-Gateway cancellation/replacement cases passing with a synthetic provider, which this review did not independently execute.

Evidence

What I checked:

Likely related people:

  • fuller-stack-dev: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

@fuller-stack-dev
fuller-stack-dev merged commit e5e7d2a into main Sep 13, 2026
109 checks passed
@fuller-stack-dev
fuller-stack-dev deleted the openclaw/orchestration-cancel-restart-proof-20260913 branch September 13, 2026 21:19
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit to Alix-007/openclaw that referenced this pull request Sep 13, 2026
…1-prep

* commit '912ae8d96e5964dfdcdf419b79613fb941cdf0a8': (350 commits)
  fix: keep workspace preparation responsive during cleanup (openclaw#147358)
  docs: alphabetize donors and sponsors and add Red Hat logo (openclaw#147302)
  fix(plugins): retain update authority through doctor effects (openclaw#144316)
  refactor(qa): share Multipass mount retry lifecycle (openclaw#147084)
  fix(memory): emit one JSON result for command failures (openclaw#147366)
  improve(plugins): speed up cold metadata loading (openclaw#147411)
  fix(sessions): avoid duplicate work after waited child replies (openclaw#147394)
  fix(agents): retain outstanding child results in parent context (openclaw#112623)
  test: preserve native workflow loader selection (openclaw#147403)
  fix: reduce repeated work while polling session pull requests (openclaw#147373)
  test(qa): preserve task cancellation across process replacement (openclaw#147382)
  fix: prevent sidebar refresh storms during session activity (openclaw#147400)
  refactor: simplify skills CLI formatting (openclaw#147368)
  fix: prevent Git checkout certificate failures behind egress proxy (openclaw#147410)
  fix(qa): stop live threads after their process leader exits (openclaw#147386)
  refactor(release): share agent turn retry lifecycle (openclaw#147076)
  fix(ui): keep uploaded images aligned with their prompts (openclaw#147389)
  fix(fs): guard skill reads and bound worker bundle staging (openclaw#147336)
  fix(ci): restore Linux service ownership fixtures (openclaw#147398)
  fix(plugins): preserve manifest permissions when building plugins (openclaw#147393)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 14, 2026
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: M 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