Skip to content

refactor(queue): reuse shared deferred fixtures - #137338

Merged
steipete merged 1 commit into
mainfrom
codex/test-bounded-queue-deferreds
Sep 3, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-bounded-queue-deferreds

Conversation

@steipete

@steipete steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

The bounded serial queue and voice transcript registry tests each maintained a local deferred-promise factory despite an existing shared test helper used by the neighboring store-writer queue suite.

Why This Change Was Made

Replace both local factories with createDeferred from test/helpers/promise. All seven target cases and 32 assertions remain, with only the factory calls renamed inside their bodies. FIFO ordering, failure barriers, count/weight limits, accepted-prefix flushing, idempotent sealing, and terminal overflow through drain and close/reopen keep their existing checks.

User Impact

No user-visible behavior change. Production delta is zero; tests are +9/−29, net −20 lines. Runtime queues, registry ownership, shared helpers, and public interfaces are unchanged.

Evidence

The same canonical five-suite selection passed all 24 cases before and after, with identical per-file order: bounded queue (6), voice registry (1), store-writer queue (3), request-start (6), and Talk Gateway control (8). Proof used Node 26.8.1, pnpm 12.1.0, and Vitest 4.1.11.

After the normal frozen install, the first unchanged baseline failed before collection with a Vitest cache ENOENT; zero tests ran. The installed cache owner was inspected, all children were joined, and the same canonical selection with --clearCache succeeded. The unchanged baseline retry then passed. The failed attempt remains recorded; no manual cache removal, cache override, source workaround, or timeout increase was used.

node scripts/check-changed.mjs -- src/shared/bounded-serial-queue.test.ts src/talk/voice-transcript.test.ts passed the full configured local gate, including test typechecking, lint, and export checks. Formatting preserved the reviewed bytes. Managed Codex review was clean through P2. This is helper consolidation, not new lifecycle coverage; the existing synchronous overflow case's unjoined release remains unchanged. Hosted CI will be checked on the published head.

@clawsweeper

clawsweeper Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review September 3, 2026 13:59
@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Sep 3, 2026
@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 3, 2026
@clawsweeper

clawsweeper Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 3, 2026, 10:08 AM ET / 14:08 UTC.

ClawSweeper review

What this changes

The branch replaces local deferred-promise test fixtures in the bounded queue and voice-transcript tests with the existing shared helper.

Merge readiness

✅ Ready for maintainer review

Keep this PR open for normal maintainer merge handling. The focused test-only refactor is correct, current main still contains both local fixtures, and the protected maintainer label prevents automated cleanup closure.

Priority: P3
Reviewed head: 335732928ce754d869c26b2fc3799b91a1324af5

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent, low-risk test-only consolidation whose shared helper preserves every deferred member used by the existing assertions.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR changes only test fixtures and does not alter production behavior; the supplied focused test and changed-check evidence is appropriate supplemental validation.
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 PR changes only test fixtures and does not alter production behavior; the supplied focused test and changed-check evidence is appropriate supplemental validation.
Evidence reviewed 4 items Shared helper contract: The shared test helper is a direct re-export of the canonical deferred constructor, whose returned shape includes promise, resolve, and reject; this covers the members used by both updated tests.
Changed test owners and runtime boundary: The bounded-queue test still exercises all queue admissions, while the voice-transcript test still drives the registry; the registry remains the caller of BoundedSerialQueue and the client voice-session module remains its production caller.
Current-main necessity check: Current main still has the removed local deferred factories in both tests, so the PR’s cleanup has not already landed.
Findings None None.
Security None None.

How this fits together

These tests hold asynchronous queue work behind deferred promises, then release it to verify FIFO ordering, overflow behavior, drain barriers, and voice-transcript cleanup. The production queue and transcript registry consume that asynchronous work; this PR changes only how the tests control it.

flowchart LR
  A[Test case] --> B[Shared deferred helper]
  B --> C[Queue or transcript registry]
  C --> D[Asynchronous operation]
  D --> E[Ordering and cleanup assertions]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -20. Total -20 across 2 files.

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

Review metrics

Metric Value Why it matters
Production vs test delta production +0/-0; tests +9/-29 The entire introduced change is test-fixture consolidation, with a net reduction in test code and no runtime surface change.

Technical review

Best possible solution:

Keep one shared deferred fixture for these tests and merge the refactor once ordinary exact-head CI completes.

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

Not applicable: the PR is a behavior-neutral test-fixture consolidation, not a report of a runtime defect.

Is this the best way to solve the issue?

Yes. Both removed fixtures only provide deferred promise controls already supplied by the canonical helper, which is already used by the neighboring store-writer queue test and many other tests.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a small test-only cleanup with no user-visible 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 PR changes only test fixtures and does not alter production behavior; the supplied focused test and changed-check evidence is appropriate supplemental validation.

Label justifications:

  • P3: This is a small test-only cleanup with no user-visible 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 PR changes only test fixtures and does not alter production behavior; the supplied focused test and changed-check evidence is appropriate supplemental validation.

Evidence

What I checked:

  • Shared helper contract: The shared test helper is a direct re-export of the canonical deferred constructor, whose returned shape includes promise, resolve, and reject; this covers the members used by both updated tests. (test/helpers/promise.ts:1, 335732928ce7)
  • Changed test owners and runtime boundary: The bounded-queue test still exercises all queue admissions, while the voice-transcript test still drives the registry; the registry remains the caller of BoundedSerialQueue and the client voice-session module remains its production caller. (src/shared/bounded-serial-queue.test.ts:2, 335732928ce7)
  • Current-main necessity check: Current main still has the removed local deferred factories in both tests, so the PR’s cleanup has not already landed. (src/shared/bounded-serial-queue.test.ts:4, 2d17bbaf88a8)
  • Feature-history routing: Recent history identifies Peter Steinberger’s prior shared-helper fixture work; the local partial clone could not retrieve all older blobs needed to establish a line-introduction claim. (test/helpers/promise.ts:1, 364a55212485)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: 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 self-assigned this Sep 3, 2026
@steipete
steipete merged commit 3fab0f5 into main Sep 3, 2026
164 of 173 checks passed
@steipete
steipete deleted the codex/test-bounded-queue-deferreds branch September 3, 2026 15:39
@steipete

steipete commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 3, 2026
* refs/remotes/origin/main:
  fix(plugins): reject unverifiable pinned npm installs (#136725)
  improve(ui): lift sidebar section headers on hover and mark online owners (#136985)
  test(cron): reuse isolated run suite hooks (#137341)
  test(channels): reuse shared indexed call guards (#137350)
  fix(ui): sidebar header controls read misaligned after the + button lost its border (#137317)
  fix(qa-channel): preserve conversation kind for implicit actions (#137343)
  fix: target the source checkout in Control UI repair commands (#137354)
  chore: reduce CI job count and database test overhead (#137352)
  fix(ios): preserve chat live edge across keyboard transitions (#136660)
  refactor(control-ui): consolidate mention inbox requests (#137375)
  fix(openai): preserve ChatGPT HTTP status for retry pacing (#137146)
  fix(mcp): hide policy-denied plugin tools from ACP sessions [AI] (#136546)
  test(queue): reuse shared deferred fixtures (#137338)
  fix(gateway): repair the Gateway E2E shard (browser suite project, skill resource argv, Codex diagnostic) (#137358)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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