Repository navigation
refactor(test): share Bun native-policy test launcher - #203064
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs changes before merge. What this changesThis PR replaces four identical synchronous Bun fixture launch blocks with one shared test helper. Example: The managed GitHub credential regression launches its Bun fixture with FS_SAFE_NATIVE_MODE=auto.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep open: this maintainer-authored PR makes a useful, focused test refactor, and source review found no introduced defect. Priority: P3 Before merge
FindingsNone. Agent review detailsHow this fits togetherFour Vitest cases launch separate Bun scripts that exercise native filesystem policy across credential, sandbox, skill-library, and skill-discovery workers; the helper accepts a script URL and temporary home and returns the synchronous process result. flowchart LR
A[Four Vitest cases] --> B[Shared Bun launcher]
B --> C[Isolated Bun subprocess]
C --> D[Native policy fixtures]
D --> E[Production worker paths]
C --> F[Raw process result]
F --> A
Technical reviewBest possible solution: Retain the purpose-specific synchronous helper and all four independent regression cases without generalizing launchers that have different contracts. Do we have a high-confidence way to reproduce the issue? Source inspection confirms equivalent repeated launch blocks on current main; this is a refactor rather than a product bug, and no target code was executed during this read-only review. Is this the best way to solve the issue? The extraction is the smallest complete change: one reused helper owns the repeated launch contract while caller-specific lifecycle and distinct native-policy coverage remain intact. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c98816b7d4de. Provenance checked
TestingProof path: none. SecurityNone. EvidenceWhat I checked:
PR surfaceTests -61. Total -61 across 5 files. Added test files: 1. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 21, 2026, 6:47 AM ET / 11:47 UTC. |
|
Merged via squash.
|
…3044 * origin/main: refactor(test): remove duplicate token startup wait case (#203087) fix: keep Plugin SDK declarations within the build limit fix(ci): remove unused hook type exports (#203074) fix(test): exercise the sign-in callback path guard (#203075) refactor(tts): separate caption eligibility from text helpers (#203068) test: reuse worker preload options (#203058) refactor(test): share Bun native-policy test launcher (#203064) fix(cron): a chat-created automation's failure notice reaches that chat (#203056) refactor(test): remove duplicate claw origin rejection case (#203067) refactor(channels): move chunk-mode lookup to streaming readers (#203047) refactor: separate skill queries from workspace discovery (#203045) fix: resume new chat turns in retained tasks after a restart refactor: separate usage pricing preparation from formatting (#203043) fix: avoid repeated filesystem probes before agent turns (#203057) perf(agents): preserve sealed history during endpoint compaction (#203037) fix(test): give deferred identity fixtures read scope (#203053) refactor(test): remove redundant channel catalog facade (#203052) refactor(cli): isolate daemon port presentation (#203020) refactor(cron): isolate CLI input parsing (#203031)
* feat: open shared sessions in their source Control UI * feat: open shared sessions in their source Control UI OpenClaw-Publication: a3826b6b-5899-8ff2-a1b5-84961c64219f * Merge remote-tracking branch 'origin/main' into land/open-original-203044 * origin/main: fix(ci): decouple boundary fixture from timing inventory (#203026) fix(ci): shard capable compatibility UI targets (#203042) perf(agents): restore selected subagent payloads once (#203039) fix: keep standalone context from completing QA tool steps perf(sessions): reuse sealed ownership for context projections (#203040) refactor(hooks): separate event predicates from hook registry (#203017) fix(ci): align update export audits with their consumers (#203030) fix: keep cold baseline checks within the existing heap limit * fix(session-share): accept the runtime config snapshot in the source link resolver The stored-session link resolver took a mutable config, so the plugin's readonly runtime snapshot failed production and test typechecks. Accept the snapshot type. Document the real Open original setup: allow the link command on the receiver Gateway, set the source Control UI origin, reinstall the source node with all three commands, then approve the widened surface. Move the section ahead of Security boundary and add a troubleshooting entry. Assert through the Gateway catalog list that a provider-supplied link survives streamed and final rows, and drop the menu unit test the browser fixture covers. * Merge remote-tracking branch 'origin/main' into land/open-original-203044 * origin/main: refactor(test): remove duplicate token startup wait case (#203087) fix: keep Plugin SDK declarations within the build limit fix(ci): remove unused hook type exports (#203074) fix(test): exercise the sign-in callback path guard (#203075) refactor(tts): separate caption eligibility from text helpers (#203068) test: reuse worker preload options (#203058) refactor(test): share Bun native-policy test launcher (#203064) fix(cron): a chat-created automation's failure notice reaches that chat (#203056) refactor(test): remove duplicate claw origin rejection case (#203067) refactor(channels): move chunk-mode lookup to streaming readers (#203047) refactor: separate skill queries from workspace discovery (#203045) fix: resume new chat turns in retained tasks after a restart refactor: separate usage pricing preparation from formatting (#203043) fix: avoid repeated filesystem probes before agent turns (#203057) perf(agents): preserve sealed history during endpoint compaction (#203037) fix(test): give deferred identity fixtures read scope (#203053) refactor(test): remove redundant channel catalog facade (#203052) refactor(cli): isolate daemon port presentation (#203020) refactor(cron): isolate CLI input parsing (#203031) * chore(plugin-sdk): record the approved session-discussion surface growth Open original adds two exports to openclaw/plugin-sdk/session-discussion: the stored-session Control UI path resolver and the session path parser. Raise the public export and callable budgets by two for them. Use neutral fixtures for the rejected-origin and rejected-query URL tests so the fixtures do not resemble credentials; the same rejections are covered. Co-authored-by: Vincent Koc <[email protected]> Co-authored-by: vincentkoc <[email protected]>
* feat: open shared sessions in their source Control UI * feat: open shared sessions in their source Control UI OpenClaw-Publication: a3826b6b-5899-8ff2-a1b5-84961c64219f * Merge remote-tracking branch 'origin/main' into land/open-original-203044 * origin/main: fix(ci): decouple boundary fixture from timing inventory (openclaw#203026) fix(ci): shard capable compatibility UI targets (openclaw#203042) perf(agents): restore selected subagent payloads once (openclaw#203039) fix: keep standalone context from completing QA tool steps perf(sessions): reuse sealed ownership for context projections (openclaw#203040) refactor(hooks): separate event predicates from hook registry (openclaw#203017) fix(ci): align update export audits with their consumers (openclaw#203030) fix: keep cold baseline checks within the existing heap limit * fix(session-share): accept the runtime config snapshot in the source link resolver The stored-session link resolver took a mutable config, so the plugin's readonly runtime snapshot failed production and test typechecks. Accept the snapshot type. Document the real Open original setup: allow the link command on the receiver Gateway, set the source Control UI origin, reinstall the source node with all three commands, then approve the widened surface. Move the section ahead of Security boundary and add a troubleshooting entry. Assert through the Gateway catalog list that a provider-supplied link survives streamed and final rows, and drop the menu unit test the browser fixture covers. * Merge remote-tracking branch 'origin/main' into land/open-original-203044 * origin/main: refactor(test): remove duplicate token startup wait case (openclaw#203087) fix: keep Plugin SDK declarations within the build limit fix(ci): remove unused hook type exports (openclaw#203074) fix(test): exercise the sign-in callback path guard (openclaw#203075) refactor(tts): separate caption eligibility from text helpers (openclaw#203068) test: reuse worker preload options (openclaw#203058) refactor(test): share Bun native-policy test launcher (openclaw#203064) fix(cron): a chat-created automation's failure notice reaches that chat (openclaw#203056) refactor(test): remove duplicate claw origin rejection case (openclaw#203067) refactor(channels): move chunk-mode lookup to streaming readers (openclaw#203047) refactor: separate skill queries from workspace discovery (openclaw#203045) fix: resume new chat turns in retained tasks after a restart refactor: separate usage pricing preparation from formatting (openclaw#203043) fix: avoid repeated filesystem probes before agent turns (openclaw#203057) perf(agents): preserve sealed history during endpoint compaction (openclaw#203037) fix(test): give deferred identity fixtures read scope (openclaw#203053) refactor(test): remove redundant channel catalog facade (openclaw#203052) refactor(cli): isolate daemon port presentation (openclaw#203020) refactor(cron): isolate CLI input parsing (openclaw#203031) * chore(plugin-sdk): record the approved session-discussion surface growth Open original adds two exports to openclaw/plugin-sdk/session-discussion: the stored-session Control UI path resolver and the session path parser. Raise the public export and callable budgets by two for them. Use neutral fixtures for the rejected-origin and rejected-query URL tests so the fixtures do not resemble credentials; the same rejections are covered. Co-authored-by: Vincent Koc <[email protected]> Co-authored-by: vincentkoc <[email protected]>
Fixes #202991
What Problem This Solves
Four native-policy tests duplicate the same synchronous Bun fixture launch setup.
User Impact
The four cases, fixture URLs, temporary-home cleanup and assertions stay unchanged.
Why This Change Was Made
One helper in
test/helpersowns the repeated setup. It preserves the three ordered flags, seven allowlisted environment keys, call-time Bun/cwd/PATH/SystemRoot selection and raw synchronous result.Evidence
At signed head
5b4c3253b0c2f7c826517ba67f1c50ac504dca47, all four existing Bun native-policy cases passed with zero skips on Darwin using the repository-pinned Bun. The three owning test type graphs and five-file type-aware lint passed. Normal hooks, formatting and full committed-range source review passed with no actionable findings. Native preparation and exact-head CI passed. The Darwin tooling check also passed. Hosted build-artifacts was skipped for this test-only change.