Skip to content

fix(qa): prevent Slack cleanup from stalling profile runs - #116361

Merged
RomneyDa merged 3 commits into
mainfrom
fix/qa-slack-cleanup-boundary
Jul 30, 2026
Merged

RomneyDa merged 3 commits into
mainfrom
fix/qa-slack-cleanup-boundary

Conversation

@RomneyDa

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes an issue where maturity profile runs would hang after the final Slack scenario had already passed, eventually consuming the full 90-minute job timeout without producing aggregate evidence.

The failed run completed the final thread-isolation scenario at 09:56:31, then emitted no further QA progress before cancellation at 10:26:48: https://github.com/openclaw/openclaw/actions/runs/30528316514

Why This Change Was Made

Slack observer cancellation no longer awaits the SDK request at the pre-Gateway cleanup boundary. The observer already owns its rejection handler, so cancellation can safely proceed while Gateway shutdown runs. Heartbeat shutdown and Convex credential release now use the existing post-Gateway cleanup phase, ensuring the Gateway is stopped before its lease is released.

User Impact

Maturity and live Slack QA runs can finish after their last scenario instead of stalling during cleanup. This has no product-runtime behavior change.

AI-assisted: yes.

Evidence

  • Failure artifact: the final child wrote a passing Thread and top-level session isolation summary (wallMs: 30783) but the parent never received completion before the job timeout.
  • node scripts/run-vitest.mjs extensions/qa-lab/src/live-transports/slack/adapter.runtime.test.ts — 3 tests passed.
  • git diff --check — passed.
  • .agents/skills/autoreview/scripts/autoreview --mode uncommitted --stream-engine-output — clean; no accepted/actionable findings.
  • Focused current-main live reproducer (running): https://github.com/openclaw/openclaw/actions/runs/30535256408

@clawsweeper clawsweeper Bot added 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. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Jul 30, 2026
@clawsweeper

clawsweeper Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 30, 2026, 6:58 AM ET / 10:58 UTC.

ClawSweeper review

What this changes

The PR prevents a stalled Slack observer request from blocking QA profile shutdown, and releases the Slack heartbeat and credential lease only after the Gateway has stopped.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep this PR open for maintainer review. The current head centralizes the post-Gateway cleanup hook in the QA runner contract and moves Slack lease release to that phase, while leaving observer cancellation non-blocking before Gateway shutdown. The repository’s maintainer label and member authorship require explicit maintainer handling rather than cleanup closure.

Priority: P2
Reviewed head: 29e02d603669abb52f1ff4d5be1c9465d832c0cd
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is small, contract-aware, and supported by focused tests plus passing API-boundary checks; completing the live QA run would reduce the remaining lifecycle-ordering uncertainty.
Proof confidence 🌊 off-meta tidepool Not applicable: This member-authored PR is outside the external-contributor real-behavior-proof gate; its linked focused live run is still useful merge evidence once complete.
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 PR is outside the external-contributor real-behavior-proof gate; its linked focused live run is still useful merge evidence once complete.
Evidence reviewed 4 items Current patch lifecycle split: The Slack adapter aborts polling in pre-Gateway cleanup without awaiting the observer promise, then stops the heartbeat and releases the lease in cleanupAfterGatewayStop. This directly addresses the reported stalled SDK request while preserving resource release after Gateway shutdown.
Central QA runner contract: The PR adds cleanupAfterGatewayStop to the shared QA runner transport adapter definition and removes local type intersections from the Telegram and generic transport code, avoiding a Slack-only hidden extension to the adapter contract.
Prior review continuity: The previous ClawSweeper review asked for the post-Gateway ordering to be rechecked after the branch’s cleanup contract was clarified. The new head adds the shared contract field, and no prior blocking finding remains.
Findings None None.
Security None None.

How this fits together

QA Lab profile runs create a channel transport adapter that polls the live channel, owns a heartbeat and lease, and cleans up around Gateway shutdown. The adapter lifecycle feeds aggregate scenario evidence, so a cleanup wait that never settles can leave an otherwise completed profile run hanging.

flowchart LR
  A[QA profile run] --> B[Slack transport adapter]
  B --> C[Observer polling and heartbeat]
  C --> D[Pre-Gateway cleanup]
  D --> E[Gateway shutdown]
  E --> F[Post-Gateway cleanup]
  F --> G[Lease release and aggregate evidence]
Loading

Decision needed

Question Recommendation
Should this member-authored QA lifecycle change merge after the pending QA smoke/live reproducer confirms the post-Gateway cleanup ordering on the current base? Merge after current-base proof: Confirm the pending Slack QA run completes with aggregate evidence and merge the narrow lifecycle fix if the clean merge still preserves the stated ordering.

Why: The patch changes the shared QA transport lifecycle and is protected by the maintainer label; the remaining judgment is whether its current-base live evidence is sufficient for landing.

Before merge

  • Resolve merge risk (P1) - The branch is behind current main; GitHub reports a clean merge, but the final merged lifecycle should still preserve exactly-once post-Gateway cleanup and lease release.
  • Resolve merge risk (P1) - The supplied focused live reproducer was still running, so the reported 90-minute cleanup stall is not yet independently demonstrated as resolved by the current head.
  • Complete next step (P2) - A protected, member-authored shared lifecycle change needs maintainer confirmation of the current-base live proof rather than an automated repair lane.
Agent review details

Security

None.

PR surface

Source -2. Total -2 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 4 7 9 -2
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 7 9 -2

Review metrics

Metric Value Why it matters
Adapter lifecycle surface 1 shared optional cleanup hook added The hook changes the ordering contract available to every QA transport adapter, so current-base lifecycle proof matters before merge.

Merge-risk options

Maintainer options:

  1. Prove the shutdown ordering on current main (recommended)
    Rebase or merge-refresh, then retain this change only after the focused Slack profile completes and shows aggregate evidence with lease release after Gateway shutdown.
  2. Accept the lifecycle risk
    Merge based on the focused adapter tests and existing passing contract checks while accepting that the supplied live reproducer was still pending.
  3. Pause for adapter contract review
    Pause the PR if maintainers do not want to add a shared post-Gateway cleanup hook to QA transport adapters.

Technical review

Best possible solution:

Rebase or merge-refresh the small lifecycle change, then confirm a Slack QA profile completes and emits aggregate evidence after its final scenario while post-Gateway lease release runs once.

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

No high-confidence independent reproduction is established here: the failure mechanism is clear from the supplied stalled-run account and the changed cleanup boundary, but the after-fix live run was still in progress.

Is this the best way to solve the issue?

Yes, conditionally: separating cancellation from awaited post-Gateway resource release is a narrow maintainable repair, provided the shared hook’s runner ordering is verified on the current base.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This fixes a bounded but costly QA-profile completion stall rather than product-runtime availability.
  • merge-risk: 🚨 availability: A changed shutdown boundary can still stall profile completion or release the QA lease at the wrong point if ordering regresses on the current base.
  • 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 PR is outside the external-contributor real-behavior-proof gate; its linked focused live run is still useful merge evidence once complete.

Evidence

What I checked:

  • Current patch lifecycle split: The Slack adapter aborts polling in pre-Gateway cleanup without awaiting the observer promise, then stops the heartbeat and releases the lease in cleanupAfterGatewayStop. This directly addresses the reported stalled SDK request while preserving resource release after Gateway shutdown. (extensions/qa-lab/src/live-transports/slack/adapter.runtime.ts:297, 29e02d603669)
  • Central QA runner contract: The PR adds cleanupAfterGatewayStop to the shared QA runner transport adapter definition and removes local type intersections from the Telegram and generic transport code, avoiding a Slack-only hidden extension to the adapter contract. (src/plugin-sdk/qa-runner-runtime.ts:136, 29e02d603669)
  • Prior review continuity: The previous ClawSweeper review asked for the post-Gateway ordering to be rechecked after the branch’s cleanup contract was clarified. The new head adds the shared contract field, and no prior blocking finding remains. (src/plugin-sdk/qa-runner-runtime.ts:136, 29e02d603669)
  • Focused validation and CI: The PR body reports three focused Slack adapter runtime tests passing; the supplied check state shows the plugin-SDK API baseline, extension-package boundary, architecture, lint, type, dependency, and security lanes passing, while QA smoke lanes remain in progress. (extensions/qa-lab/src/live-transports/slack/adapter.runtime.test.ts, 29e02d603669)

Likely related people:

  • RomneyDa: Authored the three commits that introduce the lifecycle split and shared adapter-contract declaration in this PR. (role: current QA cleanup-path contributor; confidence: medium; commits: 7dab9821b4b7, b438651a1581, 29e02d603669; files: extensions/qa-lab/src/live-transports/slack/adapter.runtime.ts, src/plugin-sdk/qa-runner-runtime.ts)

Rank-up moves

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

  • Confirm the linked focused Slack QA run completes on the current merge result and includes aggregate evidence.
  • If practical, add or point to runner-level coverage for the post-Gateway cleanup ordering.

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 (1 earlier review cycle)
  • reviewed 2026-07-30T10:47:37.162Z sha b438651 :: needs maintainer review before merge. :: none

@RomneyDa
RomneyDa merged commit 424c36a into main Jul 30, 2026
121 checks passed
@RomneyDa
RomneyDa deleted the fix/qa-slack-cleanup-boundary branch July 30, 2026 11:05
vincentkoc added a commit that referenced this pull request Jul 30, 2026
* origin/main: (99 commits)
  docs(automation): rename scheduled-tasks feature wording to Automations (#114855)
  feat(ui): finish cron -> Automations rename in visible strings (#114853)
  feat(cli): add openclaw automations alias and reword cron display prose (#114854)
  feat(agents): rename scheduler agent tool cron -> automations (#114841)
  fix(tui): preserve session state across switches and reconnects (#116399)
  feat(agents): report CLI command outcomes in channel progress
  fix(cli): preserve explicit option intent (#116389)
  fix(release): trust update restart harness (#116301)
  test(reef): remove false-green live guard smoke (#116393)
  test(comfy): evaluate live guards after setup (#116388)
  fix(heartbeat): serialize wake lifecycle state (#116351)
  test: remove redundant extension boundary wrapper (#116385)
  fix(test): bound Testbox agentic and extension suites (#115696)
  fix(ui): show the correct Threads page size (#116349)
  test(discord): align progress timing expectations (#116377)
  feat(ui): add composable skill references (#116330)
  fix(qa): prevent Slack cleanup from stalling profile runs (#116361)
  fix(ci): validate frozen release candidates faithfully (#116357)
  improve(ci): fail_fast option for release validation, off by default (#116352)
  fix(agents): compare shell tool names case-insensitively and stop re-parsing tool labels
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 31, 2026
…16361)

* fix(qa): release Slack leases after gateway stop

* fix(qa): preserve async Slack cleanup contract

* fix(qa): expose post-gateway adapter cleanup
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 merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P2 Normal backlog priority with limited blast radius. 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