Skip to content

fix(test): restore custodian UUID mocks under Bun - #139832

Merged
steipete merged 1 commit into
mainfrom
codex/bun-uuid-mocks
Sep 6, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/bun-uuid-mocks

Conversation

@steipete

@steipete steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where custodian UI tests leaked a deterministic UUID mock into later tests under Bun, causing session identity regeneration checks to fail.

Why This Change Was Made

Mock the existing project-owned UUID function in six test producers. Bun's inherited native crypto method cannot be restored reliably by the previous spy; the existing module boundary supports normal per-test restoration.

User Impact

No production behavior changes. The UI tests retain their deterministic IDs without affecting later session identity tests.

Evidence

  • In the original campaign file order, Bun changed from 58 passes and two failures to all 60 passing. Node passed all 60 before and after repair.
  • All 80 sibling tests in the six producer files pass on both runtimes.
  • Complete changed-file gate and independent P0–P2 review pass.
  • Production code, assertions, cleanup scope, and timeout limits are unchanged. The wider Bun campaign remains in progress.

@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 app: web-ui App: web-ui size: XS maintainer Maintainer-authored PR labels Sep 6, 2026
@steipete
steipete marked this pull request as ready for review September 6, 2026 06:23
@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, 2:28 AM ET / 06:28 UTC.

ClawSweeper review

What this changes

The PR makes Custodian UI tests mock OpenClaw’s UUID helper instead of native crypto, preserving deterministic IDs without leaking the mock into later Bun tests.

Merge readiness

✅ Ready for maintainer review

Keep open: current main retains the problematic native spies, and this focused repair introduces no actionable correctness findings. The maintainer-authored, protected PR remains a useful landing candidate.

Priority: P3
Reviewed head: da266e99760c85e4f5af4c4baca0e9c98fdd5abf

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair using an existing seam, unchanged behavioral assertions, and reported cross-runtime validation.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored test-only repair is exempt from external-contributor runtime proof; its body reports Bun original-order recovery and Node parity, with no changed production behavior to demonstrate.
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 test-only repair is exempt from external-contributor runtime proof; its body reports Bun original-order recovery and Node parity, with no changed production behavior to demonstrate.
Evidence reviewed 7 items Verified introduced patch: The merge-base-to-head diff changes only UUID imports and spy targets in six test files; assertions, cleanup, timeouts, and production code are unchanged.
Repair remains relevant on main: All six corresponding suites still spy on crypto.randomUUID at the supplied current-main revision.
Existing production seam: Custodian session creation already calls generateUUID from the project-owned module; the patch needs no new production injection seam.
Findings None None.
Security None None.

How this fits together

Custodian powers the Control UI’s Ask OpenClaw setup and repair conversation. Its tests mount the UI with simulated Gateway responses and use predictable session identifiers to check conversation behavior.

flowchart TD
  A[Custodian test setup] --> B[Mock UUID helper]
  B --> C[Session identity creation]
  C --> D[UI and simulated Gateway]
  D --> E[Behavior assertions]
  E --> F[Restore mocks after test]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +6. Total +6 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 6 12 6 +6
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 12 6 +6

Review metrics

None.

Technical review

Best possible solution:

Keep deterministic UUIDs scoped to the existing project helper while preserving independent session-regeneration assertions and per-test restoration.

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

Unclear independently: the PR reports a failing original-order Bun campaign, and source identifies the affected producers and identity assertions, but this read-only review did not execute that campaign.

Is this the best way to solve the issue?

Yes: mocking the existing UUID helper removes the native spy mutation at its producer without weakening assertions or changing runtime identity generation.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a bounded test-isolation repair 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 test-only repair is exempt from external-contributor runtime proof; its body reports Bun original-order recovery and Node parity, with no changed production behavior to demonstrate.

Label justifications:

  • P3: This is a bounded test-isolation repair 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 test-only repair is exempt from external-contributor runtime proof; its body reports Bun original-order recovery and Node parity, with no changed production behavior to demonstrate.

Evidence

What I checked:

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 ce7eb85 into main Sep 6, 2026
133 checks passed
@steipete
steipete deleted the codex/bun-uuid-mocks branch September 6, 2026 09:14
@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

app: web-ui App: web-ui 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