Skip to content

test(gateway): observe native drain without a lint exception - #139576

Merged
steipete merged 1 commit into
mainfrom
codex/test-audit-held-work-observer
Sep 6, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-audit-held-work-observer

Conversation

@steipete

@steipete steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Related: #139428

What Problem This Solves

The test helper introduced in #139483 uses an unbound-method lint suppression that the broader suppression-inventory check rejects. Local lifetime and changed-file checks had passed, so that validation gap was discovered in subsequent CI.

Why This Change Was Made

Observe the native drain through a call-through spy instead of capturing and replacing its implementation. Select the exact owner by signal, wait for its drain and transport releases, and check the native promise remains pending while work is held. Stop waiting when close settles on either outcome. The bounded wait has no mandatory delay.

User Impact

No production behavior changes. Lifetime coverage remains while the suppression disappears. The inventory/ratchet is unchanged; net two test-support lines removed.

Evidence

All 15 lifetime tests and four unchanged suppression-inventory tests pass. A negative control omitting only the selected owner's join makes exactly five intended pending-drain checks fail, while the other ten cases pass. Final native code was restored and revalidated.

The full changed gate, including core test typing, dead-export scans and helper lint, passes. Deslop, diff check and independent P2 review pass. No new full-suite runtime claim.

@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: XS maintainer Maintainer-authored PR labels Sep 6, 2026
@steipete
steipete marked this pull request as ready for review September 6, 2026 00:51
@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 5, 2026, 8:57 PM ET / September 6, 2026, 00:57 UTC.

ClawSweeper review

What this changes

Updates Gateway shutdown test support to observe native drain completion through a call-through spy without a lint exception.

Merge readiness

✅ Ready for maintainer review

Keep open: current main still contains the rejected lint suppression, and this focused repair preserves meaningful lifecycle coverage. No actionable correctness or security defects found.

Priority: P3
Reviewed head: 6db508425473ab0300eb33cb06759f4200764806

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, well-supported test repair with preserved lifecycle coverage and no actionable findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored PR changes only the Gateway test observer; the external-contributor runtime-proof gate does not apply. Its reported lifetime and negative-control results support the changed assertions.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored PR changes only the Gateway test observer; the external-contributor runtime-proof gate does not apply. Its reported lifetime and negative-control results support the changed assertions.
Evidence reviewed 8 items Verified introduced change: The merge-base-to-head diff changes only the test observer; production drain code, caller scenarios, and suppression inventory remain unchanged.
Still needed on fetched main: Fetched main retains the unbound-method suppression and replacement drain implementation that this PR removes.
Inventory failure mechanism: The inventory excludes .test.ts files but includes .test-support.ts files; its explicit suppression allowlist has no entry for this helper. Removing the suppression addresses that mismatch without weakening the inventory.
Findings None None.
Security None None.

How this fits together

Gateway shutdown must finish admitted work before releasing its dependencies. This test helper observes the selected work owner and connection cleanup so lifetime tests can verify that shutdown waits for held work.

flowchart TD
  A[Lifetime test holds work] --> B[Gateway shutdown]
  B --> C[Native work drain]
  D[Selected owner signal] --> E[Test observer]
  C --> E
  F[Connection releases] --> E
  E --> G[Assert drain remains pending]
  G --> H[Release work and verify shutdown]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -2. Total -2 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 22 24 -2
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 22 24 -2

Review metrics

None.

Technical review

Best possible solution:

Keep native drain execution and exact-owner lifecycle assertions while removing the unnecessary suppression without changing the ratchet.

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

Yes, from source: current main adds a suppression in a file scanned by an inventory that does not allow it. Tests were not executed during this read-only review.

Is this the best way to solve the issue?

Yes. A call-through spy uses Vitest's existing receiver and promise-settlement tracking while preserving the native drain and final lifecycle assertions.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 3d14bba71949.

Labels

Label changes:

  • add P3: This is a bounded test-support cleanup 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: The maintainer-authored PR changes only the Gateway test observer; the external-contributor runtime-proof gate does not apply. Its reported lifetime and negative-control results support the changed assertions.

Label justifications:

  • P3: This is a bounded test-support cleanup 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: The maintainer-authored PR changes only the Gateway test observer; the external-contributor runtime-proof gate does not apply. Its reported lifetime and negative-control results support the changed assertions.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 13e1b10 adds src/gateway/server-held-work.test-support.ts:39 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 13e1b10f78cb; files: src/gateway/server-held-work.test-support.ts)

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 e927f02 into main Sep 6, 2026
168 checks passed
@steipete
steipete deleted the codex/test-audit-held-work-observer branch September 6, 2026 01:01
@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Sep 6, 2026
Upstream #139576 now observes the native drain without an unbound-method suppression. Remove the obsolete inventory entry so the combined CI tree matches current main.
vincentkoc added a commit that referenced this pull request Sep 6, 2026
* origin/main: (302 commits)
  test(gateway): preserve held-work close failures (#139593)
  refactor(exec): share package argument scanning (#139560)
  fix(audit): preserve sequence range validation before numeric decoding (#139587)
  fix(transcripts): retain capture ownership through failed cleanup (#139572)
  refactor(models): share selector reference traversal (#139571)
  perf(agents): classify allowlists without intermediate sets (#138392)
  chore(release): update appcast for 2026.9.2 (#139575)
  fix(ci): synchronize cloud retries and board widget input (#139506)
  fix(plugins): explain SDK incompatibilities after core updates (#139458)
  fix(voice-call): retain installed WebSocket behavior under Bun (#139567)
  test(text): consolidate literal sanitizer cases (#139579)
  test(gateway): observe native drain without a lint exception (#139576)
  test(memory): consolidate visibility fixtures without policy defaults (#139569)
  fix(ui): show shimmer skeletons while loading Control UI (#139525)
  test(qa): make cleanup child logging deterministic (#139566)
  test(cli): keep Unix socket fixtures within path limits (#139565)
  fix: avoid slow incognito key checks in large session stores (#139528)
  feat(macos): open Gateway windows from the Gateways menu (#139522)
  test(workshop): isolate marker casing fixture identities (#139554)
  fix(process): require cleanup evidence before releasing owned work (#139517)
  ...

# Conflicts:
#	scripts/release-check.ts
vincentkoc added a commit that referenced this pull request Sep 6, 2026
* commit '047587a542ce205ee78354fbd88ba8ec05c07844': (45 commits)
  chore(ui): refresh control ui locales (#139481)
  fix(slack): keep prototype-named emoji shortcodes intact (#136374)
  fix(gateway): deliver upgrade rejection responses under Bun (#139516)
  refactor(test): simplify catalog guards and fix native report fixture (#139496)
  fix(macos): prevent dashboard fixture loopback timeouts (#139556)
  fix(matrix): preserve selected reply targets inside threads (#139479)
  test(gateway): preserve held-work close failures (#139593)
  refactor(exec): share package argument scanning (#139560)
  fix(audit): preserve sequence range validation before numeric decoding (#139587)
  fix(transcripts): retain capture ownership through failed cleanup (#139572)
  refactor(models): share selector reference traversal (#139571)
  perf(agents): classify allowlists without intermediate sets (#138392)
  chore(release): update appcast for 2026.9.2 (#139575)
  fix(ci): synchronize cloud retries and board widget input (#139506)
  fix(plugins): explain SDK incompatibilities after core updates (#139458)
  fix(voice-call): retain installed WebSocket behavior under Bun (#139567)
  test(text): consolidate literal sanitizer cases (#139579)
  test(gateway): observe native drain without a lint exception (#139576)
  test(memory): consolidate visibility fixtures without policy defaults (#139569)
  fix(ui): show shimmer skeletons while loading Control UI (#139525)
  ...
steipete added a commit that referenced this pull request Sep 6, 2026
* fix(cron): keep dashboard current-session delivery in its conversation

* fix(cron): retain unresolved explicit delivery failures

* test: complete cron delivery fixtures and CI inventory

Carry the normalized delivery plan through CLI suppression and Gateway background-completion fixtures. Preserve their assertions and the existing runtime requirement.

Record the existing native drain capture suppression introduced by #139483 in the intentional inventory, without changing its receiver semantics.

* test: drop superseded drain suppression entry

Upstream #139576 now observes the native drain without an unbound-method suppression. Remove the obsolete inventory entry so the combined CI tree matches current main.

* test: keep native process probes in report fixture

Default the shared spawnSync mock to Node so Linux cleanup probes remain observable. Preserve the explicit report-unit overrides and strict process-tree checks.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 6, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 6, 2026
* fix(cron): keep dashboard current-session delivery in its conversation

* fix(cron): retain unresolved explicit delivery failures

* test: complete cron delivery fixtures and CI inventory

Carry the normalized delivery plan through CLI suppression and Gateway background-completion fixtures. Preserve their assertions and the existing runtime requirement.

Record the existing native drain capture suppression introduced by openclaw#139483 in the intentional inventory, without changing its receiver semantics.

* test: drop superseded drain suppression entry

Upstream openclaw#139576 now observes the native drain without an unbound-method suppression. Remove the obsolete inventory entry so the combined CI tree matches current main.

* test: keep native process probes in report fixture

Default the shared spawnSync mock to Node so Linux cleanup probes remain observable. Preserve the explicit report-unit overrides and strict process-tree checks.
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: 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