Skip to content

test(discord): move ready abort proof to lifecycle - #122869

Merged
steipete merged 1 commit into
mainfrom
test/audit-discord-ready-abort
Aug 12, 2026
Merged

steipete merged 1 commit into
mainfrom
test/audit-discord-ready-abort

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The Discord READY-backoff abort regression was tested by exporting the private waitForGatewayReady helper through a production testing object and a plugin-root test-api.ts bridge. That kept an implementation seam alive even though the behavior belongs to the full gateway lifecycle.

Why This Change Was Made

Move the regression through runDiscordGatewayLifecycle, where the channel-owned abort signal actually enters the lifecycle owner. The rewritten test proves startup reaches the READY retry backoff, abort immediately reaches the normal stop boundary, lifecycle cleanup runs, no retry timer remains, and no additional reconnect occurs.

Delete the now-unused production testing export and the entire Discord test-api.ts bridge. Discord's package metadata exposes only index.ts, and bundled public-surface tests explicitly exclude test-api.js, so this is not a public or shipped Plugin SDK contract.

User Impact

No behavior change. The existing abort-aware retry remains intact, but its regression coverage now exercises the real owner boundary instead of a private helper.

Production delta is -6 lines; tests are -16 lines net.

Evidence

  • Rewritten focused regression passed through runDiscordGatewayLifecycle.
  • Historical mutation proof: replacing the abort-aware sleep with the former bare timer failed in 1.8 seconds because waitForDiscordGatewayStop was not reached after abort; production was then restored.
  • node scripts/run-vitest.mjs extensions/discord/src/monitor/provider.lifecycle.test.ts extensions/discord/src/monitor.gateway.test.ts packages/retry/src/index.test.ts src/plugins/contracts/extension-test-api-consumption.test.ts src/plugins/bundled-plugin-metadata.test.ts — 77 tests passed across four shards.
  • node scripts/check-changed.mjs -- extensions/discord/src/monitor/provider.lifecycle.ts extensions/discord/src/monitor/provider.lifecycle.test.ts extensions/discord/test-api.ts — extension and extension-test gates passed, including API baseline, plugin boundaries, dead exports, both typechecks, lint, storage/media/runtime guards, and import cycles. The configured remote backend was unavailable because the blacksmith executable is not installed on this host, so the wrapper used its documented trusted-source local fallback.
  • git diff --check — passed.
  • Structured branch autoreview — no accepted or actionable findings.

@clawsweeper

clawsweeper Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added the channel: discord Channel integration: discord label Aug 12, 2026
@steipete
steipete marked this pull request as ready for review August 12, 2026 23:45
@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 12, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready proof for 578573481c9b3a49f391ef551f7269e133ef601d:

  • Rewritten READY-backoff abort regression passed through runDiscordGatewayLifecycle.
  • Historical mutation proof replaced the abort-aware sleep with the former bare timer; the test failed in 1.8 seconds because the lifecycle did not reach waitForDiscordGatewayStop after abort. Production was restored.
  • node scripts/run-vitest.mjs extensions/discord/src/monitor/provider.lifecycle.test.ts extensions/discord/src/monitor.gateway.test.ts packages/retry/src/index.test.ts src/plugins/contracts/extension-test-api-consumption.test.ts src/plugins/bundled-plugin-metadata.test.ts — 77 tests passed across four shards, both before and after rebase.
  • node scripts/check-changed.mjs -- extensions/discord/src/monitor/provider.lifecycle.ts extensions/discord/src/monitor/provider.lifecycle.test.ts extensions/discord/test-api.ts — passed before and after rebase, including API baseline, plugin boundaries, dead exports, extension typechecks, lint, storage/media/runtime guards, and import cycles. The configured remote backend was unavailable because the blacksmith executable is not installed on this host, so the wrapper used its documented trusted-source local fallback.
  • git diff --check origin/main...HEAD — passed.
  • Structured uncommitted and rebased branch autoreviews — no accepted or actionable findings.
  • Native review artifacts — validated as READY FOR /prepare-pr with zero findings.
  • Exact-head hosted CI: run 31652026064 — green.
  • Native OPENCLAW_TESTBOX=1 scripts/pr prepare-run 122869 — passed by reusing exact-head hosted CI.

ClawSweeper had only its acknowledgement at prepare time, with no published finding or rank-up move; repository policy does not block on a late review publisher.

Production/test-support delta is -6 lines; tests are -16 lines net.

@steipete
steipete merged commit 52cda53 into main Aug 12, 2026
171 checks passed
@steipete
steipete deleted the test/audit-discord-ready-abort branch August 12, 2026 23:54
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: discord Channel integration: discord maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant