Skip to content

fix(qa): release failed transport leases and always stop owned labs - #119442

Merged
steipete merged 1 commit into
mainfrom
codex/autoqa-transport-cleanup-20260805
Aug 5, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/autoqa-transport-cleanup-20260805

Conversation

@steipete

@steipete steipete commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where isolated QA runs could permanently leak a channel credential lease after one transient cleanup failure, and runtime-parity runs could leave their owned lab server running while hiding the original scenario failure.

Why This Change Was Made

The isolated-suite owner records transport cleanup only after it succeeds, preserving the registry retry contract. The runtime-parity owner now uses the existing canonical cleanup aggregation so every owned resource is released and primary failures retain their causal cleanup errors.

User Impact

Repeated QA runs recover transient credential-release failures, stop owned labs reliably, and report scenario plus cleanup errors instead of exhausting shared transport pools or leaking background servers.

Evidence

  • Authentic pre-fix failures cover both pre/post credential cleanup phases and parity lab disposal; all three lifecycle regressions now pass.
  • Full QA-focused group passed 98 tests; synthetic and Crabline channel scenarios passed 1/1.
  • Full pnpm check:changed passed all five typecheck lanes, lint, formatting, and architecture guards.
  • Fresh isolated autoreview of this exact branch: clean.
  • Production delta: +9 lines, justified by the canonical resource ownership and error-causality invariant.

Inspectable exact-head runtime proof

Exact-head required CI passed: https://github.com/openclaw/openclaw/actions/runs/30970694620

The downloadable real isolated-suite runtime artifact is https://github.com/openclaw/openclaw/actions/runs/30970694620/artifacts/8916439102. Its primary/flow/isolated-1/qa-suite-summary.json records a live owned Gateway/Crabline lifecycle and successful terminal completion:

{
  "head": "507b9dfe4a5961a260c9d549ced8706d873fa235",
  "artifactPath": "primary/flow/isolated-1/qa-suite-summary.json",
  "providerMode": "mock-openai",
  "channelDriver": "crabline",
  "scenarioIds": ["subagent-completion-direct-fallback"],
  "counts": {"total": 1, "passed": 1, "failed": 0, "skipped": 0}
}

The same artifact records three independently isolated worker lifecycles and a six-scenario aggregate with passed=6 and failed=0. The added authentic cleanup tests inject a one-time rejection into the actual registered adapter: both pre-stop and post-stop credential cleanup retry successfully, and runtime-parity cleanup stops its owned lab while preserving both the original scenario failure and the cleanup error.

@steipete
steipete marked this pull request as ready for review August 5, 2026 02:54
@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Aug 5, 2026
@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 4, 2026, 11:22 PM ET / August 5, 2026, 03:22 UTC.

ClawSweeper review

What this changes

The PR makes failed QA transport cleanup retryable and ensures runtime-parity suites stop owned labs while preserving both scenario and cleanup errors.

Regression provenance

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

Merge readiness

⛔ Blocked until stronger real behavior proof is added - 3 items remain

The patch is a focused repair of two current QA cleanup defects and reuses the existing cleanup/error-aggregation owner. Its linked exact-head artifact shows a successful isolated run, but not either failure path this PR changes, so real behavior proof is still insufficient before merge.

Priority: P2
Reviewed head: 507b9dfe4a5961a260c9d549ced8706d873fa235

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation is focused and source-backed, but the changed failure semantics still lack real runtime proof.
Proof confidence 🦪 silver shellfish (2/6) Needs stronger real behavior proof before merge: The exact-head artifact demonstrates a successful isolated run, but not the release-retry, failure-time lab shutdown, or causal-error behavior changed here; add redacted real failure-path output before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: The exact-head artifact demonstrates a successful isolated run, but not the release-retry, failure-time lab shutdown, or causal-error behavior changed here; add redacted real failure-path output before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 7 items Current isolated-run defect: Current main marks the parent transport as cleaned before awaiting release; a rejected release makes the finally block skip its retry path.
Current parity-run defect: Current main awaits transport cleanup before stopping an owned lab, so a cleanup rejection prevents lab shutdown.
Canonical cleanup contract: The shared helper continues every cleanup step after errors and retains a failed run as the AggregateError cause; the standard runner already uses this pattern.
Findings None None.
Security None None.

How this fits together

QA Lab runs isolated and runtime-parity scenarios through transport adapters and temporary Gateway labs. Its cleanup phase releases exclusive channel credentials and shuts down labs after each run, producing QA reports and terminal errors.

flowchart LR
  A[QA scenario request] --> B[Isolated or parity runner]
  B --> C[Transport credential lease]
  B --> D[Owned Gateway lab]
  C --> E[Cleanup aggregation]
  D --> E
  E --> F[Retry and shutdown]
  F --> G[QA report or causal error]
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: The exact-head artifact demonstrates a successful isolated run, but not the release-retry, failure-time lab shutdown, or causal-error behavior changed here; add redacted real failure-path output before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The linked success artifact does not prove the transient cleanup-failure paths, so it cannot yet establish that leases retry or owned labs stop in a real QA runtime.
  • Resolve merge risk (P1) - The branch is behind current main; any rebase must receive an exact-head proof and review refresh.
Agent review details

Security

None.

PR surface

Source +9, Tests +185. Total +194 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 14 5 +9
Tests 2 185 0 +185
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 199 5 +194

Review metrics

Metric Value Why it matters
Production vs test LOC production +14/-5 (net +9); tests +185/-0 The small production increase is justified by aligning two lifecycle owners with the existing cleanup aggregation contract, while the larger test delta targets both failure modes.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Rebase if needed, then attach redacted exact-head QA runtime evidence with a controlled one-time transport-release failure that records the retry, owned-lab shutdown, and retained scenario-plus-cleanup error.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Rebase if needed, then attach redacted exact-head QA runtime evidence with a controlled one-time transport-release failure that records the retry, owned-lab shutdown, and retained scenario-plus-cleanup error.

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

Yes—current main has a deterministic source path where a rejected release skips isolated retry or prevents parity lab shutdown; execution of the real failure path is still unproven.

Is this the best way to solve the issue?

Yes—the changes repair the state owner and reuse the established cleanup aggregator instead of adding a second cleanup policy; only real failure-path proof remains.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This fixes QA resource cleanup and diagnostic correctness with limited blast radius outside the QA system.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: The exact-head artifact demonstrates a successful isolated run, but not the release-retry, failure-time lab shutdown, or causal-error behavior changed here; add redacted real failure-path output before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

Likely related people:

  • steipete: Prior merged QA runner-split and transport-ownership work connects this person to the affected cleanup ownership boundary, independently of this PR. (role: feature owner and recent area contributor; confidence: high; commits: c66f0d340be6, 16badb18e5e0, 2073371f8097; files: extensions/qa-lab/src/suite-run-isolated.ts, extensions/qa-lab/src/suite-runtime-parity-runner.ts, extensions/qa-lab/src/qa-transport-registry.ts)
  • vincentkoc: Current-main blame assigns the affected lifecycle lines to this recent QA-area commit; the checkout's shallow history limits older provenance confidence. (role: recent current-main area contributor; confidence: medium; commits: 6293b54250fc; files: extensions/qa-lab/src/suite-run-isolated.ts, extensions/qa-lab/src/suite-runtime-parity-runner.ts)

Rank-up moves

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

  • Attach redacted exact-head runtime output for a controlled transient release failure showing retry, lab shutdown, and the resulting causal error.
  • After any rebase, refresh the proof against the new head.

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.

History

Review history (2 earlier review cycles)
  • reviewed 2026-08-05T03:03:34.940Z sha 507b9df :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-05T03:09:33.446Z sha 507b9df :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 5, 2026
@steipete
steipete merged commit b5d99c1 into main Aug 5, 2026
202 of 213 checks passed
@steipete
steipete deleted the codex/autoqa-transport-cleanup-20260805 branch August 5, 2026 03:31
@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 5, 2026
* origin/main:
  fix(channels): honor explicit preview streaming settings
  refactor(telegram): consolidate outbound contracts and targets (#119438)
  fix(qa): retry transport cleanup and always stop owned labs (#119442)
  fix(mcp): guard stdio stdout frame parsing against oversized-buffer crash (#119379)
  refactor(auto-reply): centralize delivery deduplication and routing (#119436)
  fix(qa): preserve scenario isolation in serial suites (#119439)
  perf(xai): lazy-load optional capability runtimes (#119374)
  refactor(browser): consolidate browser CLI and normalization helpers (#119432)
  fix(qa): require ready transport accounts (#119431)
  refactor(media): share image and video geometry normalization (#119416)
  fix(config): preserve plugin metadata for missing config (#119421)
  fix: retry delivery when outbound adapter is unavailable (#119371)
  fix(cli): retire invalid secret flags and prove doctor recovery (#118926)
  refactor(signal): share outbound and reaction transport (#119415)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 5, 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 P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant