Skip to content

test(gateway): table-drive device token lifecycle checks - #140403

Merged
steipete merged 1 commit into
mainfrom
steipete/deslop-tests-pairing-lifecycle
Sep 6, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/deslop-tests-pairing-lifecycle

Conversation

@steipete

@steipete steipete commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Related: #135868, #139421

What Problem This Solves

The pairing lifecycle suite repeats setup for token rotation and revocation around the same wake-cancellation and response-ordering boundaries. This is the maintainer-requested test compression pass in concern F of the #135868 split, following #139421.

Why This Change Was Made

Use two rotate/revoke tables while preserving all four cases in their original order. Each method keeps its own result fields, request parameters, caller permissions, and invalidation reason. The response callback still proves synchronous invalidation and defers disconnection until afterward.

User Impact

No runtime behavior changes. Tests shrink by 35 lines (+65/−100), from 838 to 803 lines; production, tooling, and docs each change by zero. No cases or assertions are removed.

Evidence

Removed standalone body Surviving coverage
Node wake invalidation after token rotation src/gateway/server-methods/devices.lifecycle.test.ts:509, “invalidates an in-flight node wake after device.token.rotate”
Node wake invalidation after token revocation Same table at :509, “invalidates an in-flight node wake after device.token.revoke”
Synchronous client invalidation before the rotation reply src/gateway/server-methods/devices.lifecycle.test.ts:558, “invalidates affected clients synchronously before responding to device.token.rotate”
Synchronous client invalidation before the revocation reply Same table at :558, “invalidates affected clients synchronously before responding to device.token.revoke”

Seeded node teardown, caller-retirement and worker-cleanup failures, operator/node role distinctions, normalized identities, and same-device/cross-device response contracts remain separate and unchanged. The response-called assertion remains because it prevents the callback assertions from passing without a reply.

Full standard src/gateway/server-methods baseline: 281 files, 5,428 passed / 2 skipped, 297.08 s. Full after-run: the identical 281 files and 5,428 passed / 2 skipped, 283.90 s. The complete before/after file sets match, including all 28 lifecycle cases. Full node scripts/check-changed.mjs passed, including test types, lint, guards, and all three dead-export scans. Independent Codex review is scoped-clean through P2; git diff --check passed. The rebase changed neither the lockfile nor the tested owners.

Exact-head CI is green for 08b272dc9e2a567fb8f431701e42c3bf6ee26c0c: https://github.com/openclaw/openclaw/actions/runs/34056519770 . ClawSweeper reviewed the same head with no findings, before-merge requests, or rank-up moves.

@clawsweeper

clawsweeper Bot commented Sep 6, 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.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: S maintainer Maintainer-authored PR labels Sep 6, 2026
@steipete
steipete force-pushed the steipete/deslop-tests-pairing-lifecycle branch from 5661abe to 08b272d Compare September 6, 2026 19:57
@steipete
steipete marked this pull request as ready for review September 6, 2026 19:58
@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 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

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

ClawSweeper review

What this changes

The PR consolidates four device-token lifecycle tests into two rotate/revoke tables while preserving their setup, execution order, and assertions.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-requested cleanup preserves the tested behavior and remains distinct from the merged lifecycle repair. No actionable defects were found.

Priority: P3
Reviewed head: 08b272dc9e2a567fb8f431701e42c3bf6ee26c0c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving test cleanup with useful reported validation and no actionable findings.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored test refactor changes no production owner or runtime behavior; reported before/after suite results support coverage preservation, and the external-contributor runtime-proof gate does not apply.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored test refactor changes no production owner or runtime behavior; reported before/after suite results support coverage preservation, and the external-contributor runtime-proof gate does not apply.
Evidence reviewed 6 items Introduced test changes preserve behavior: The complete pinned diff retains both methods in their original order, method-specific mutation results and scopes, wake-aborted assertions, assertions inside the response callback, and the response-called guard.
Shared fixture and production boundary: The full lifecycle suite and shared fixture were inspected. Each generated case retains beforeEach state cleanup; the unchanged handlers invalidate clients before replying and schedule disconnection afterward for the operator scenarios.
Cleanup remains absent from fetched main: Comparison against fetched main shows the same two test refactors; the production handler and shared fixture have no differences in this comparison. The earlier merged runtime fix does not implement this test compression.
Findings None None.
Security None None.

How this fits together

Gateway device-token handlers process authorized rotation and revocation requests, invalidate affected connections, and cancel node wake work. These tests protect cancellation and the ordering of invalidation, replies, and disconnection.

flowchart TD
  A[Rotate or revoke request] --> B[Device token handler]
  B --> C[Token mutation]
  C --> D[Invalidate affected clients]
  C --> E[Cancel node wake work]
  D --> F[Reply to caller]
  F --> G[Disconnect affected clients]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -35. Total -35 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 65 100 -35
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 65 100 -35

Review metrics

Metric Value Why it matters
Coverage preservation 4 standalone cases become 4 cases in 2 tables The refactor preserves method-specific setup and observable ordering checks without removing scenarios.

Technical review

Best possible solution:

Keep the compact tables with method-specific fixtures and the existing cancellation and response-ordering assertions intact.

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

Not applicable: this PR consolidates existing regression tests and reports no new runtime defect.

Is this the best way to solve the issue?

Yes: the tables remove repeated setup while retaining separate execution for both methods and all existing ordering assertions.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is focused test maintenance with no production behavior change.
  • 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: This maintainer-authored test refactor changes no production owner or runtime behavior; reported before/after suite results support coverage preservation, and the external-contributor runtime-proof gate does not apply.

Label justifications:

  • P3: This is focused test maintenance with no production behavior change.
  • 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 maintainer-authored test refactor changes no production owner or runtime behavior; reported before/after suite results support coverage preservation, and the external-contributor runtime-proof gate does not apply.

Evidence

What I checked:

  • Introduced test changes preserve behavior: The complete pinned diff retains both methods in their original order, method-specific mutation results and scopes, wake-aborted assertions, assertions inside the response callback, and the response-called guard. (src/gateway/server-methods/devices.lifecycle.test.ts:508, 08b272dc9e2a)
  • Shared fixture and production boundary: The full lifecycle suite and shared fixture were inspected. Each generated case retains beforeEach state cleanup; the unchanged handlers invalidate clients before replying and schedule disconnection afterward for the operator scenarios. (src/gateway/server-methods/devices.ts:568, 08b272dc9e2a)
  • Cleanup remains absent from fetched main: Comparison against fetched main shows the same two test refactors; the production handler and shared fixture have no differences in this comparison. The earlier merged runtime fix does not implement this test compression. (src/gateway/server-methods/devices.lifecycle.test.ts:508, 11f454ee82dc)
  • Prior merged work and routing: Provided GitHub metadata identifies fix(gateway): reconcile pairing lifecycle after token removal #139421 as merged. Local history records Peter Steinberger across the lifecycle split and preceding device-management repairs. Follow-history and blame could not complete because historical blobs were unavailable and network resolution failed; no line-introduction attribution is claimed. (src/gateway/server-methods/devices.ts, 51be20280b54)
  • Validation supplied by the author: The captured PR body reports identical before/after suite membership, 5,428 passing and 2 skipped tests, all 28 lifecycle cases retained, and passing changed-file checks. These are author-reported results; this read-only review did not execute tests. Local git diff --check passed. (08b272dc9e2a)
  • Release context: The lifecycle test file is absent from the supplied latest release tag v2026.9.2. This PR is test maintenance, so no user-facing fix release is claimed. (src/gateway/server-methods/devices.lifecycle.test.ts, 3928bad9badf)

Likely related people:

  • steipete: 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.

@steipete
steipete merged commit f3b41e0 into main Sep 6, 2026
169 checks passed
@steipete
steipete deleted the steipete/deslop-tests-pairing-lifecycle branch September 6, 2026 20:13
@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 6, 2026
…rol-ui

* origin/main:
  docs: remove the empty release-sections nav group (#140427)
  fix(tooling): omit Codex machine squash credit (#140420)
  chore(ui): refresh control ui locales (#140384)
  refactor(plugin-sdk): reuse native approval input contracts (#140415)
  fix: silent model WebSocket streams hang past the idle timeout (#140335)
  perf(ai): avoid unused text extraction for image results (#140409)
  fix(ui): distinguish failed GitHub status checks from disconnected accounts (#140333)
  refactor(cron): share runtime feedback schema fields (#140408)
  fix: avoid duplicate cloud worker teardown during recovery (#140377)
  fix(cli): show executable approval scope (#138386)
  refactor(ui): reuse shared requirement records (#140407)
  test(gateway): table-drive device token lifecycle checks (#140403)
  fix(chat): fence delayed history at terminal retirement (#140379)
  test(skills): compare large upload bytes natively (#140402)
  refactor(delivery): reuse the canonical rendered batch plan type (#140386)
  docs(start): repair the first-run path from landing page to first channel (#140390)

# Conflicts:
#	docs/.i18n/glossary.zh-CN.json
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime 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: S 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