Repository navigation
refactor: finish shared test helper migrations - #120996
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 9, 2026, 7:41 AM ET / 11:41 UTC. ClawSweeper reviewWhat this changesMigrates test-local deferred-promise and temporary-directory setup to existing shared helper APIs across core, UI, scripts, and bundled plugin tests. Merge readinessKeep open for maintainer review. The available source supports reusing the existing helper seams, but this read-only checkout cannot retrieve the exact PR head and cannot satisfy the required sibling Codex-source gate. Priority: P3 Review scores
Verification
How this fits togetherShared helper APIs provide promise coordination and isolated temporary workspaces to test suites. Core, UI, script, and plugin tests consume them so fixture setup and cleanup remain consistent without changing production behavior. flowchart LR
A[Test suites] --> B[Shared helper APIs]
B --> C[Deferred async coordination]
B --> D[Temporary workspaces]
C --> E[Assertions]
D --> E
E --> F[CI validation]
Before merge
Agent review detailsSecurityNone. Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the canonical shared helpers and complete the consumer migration after the exact head is inspectable, its checks finish, and the Codex dependency gate can be satisfied. Do we have a high-confidence way to reproduce the issue? Not applicable: the PR refactors test support and does not report a production failure. Is this the best way to solve the issue? Yes for the inspectable scope: migrating consumers to existing public helper seams is preferable to retaining duplicated local helpers; exact-head and Codex-gate evidence still prevent a merge recommendation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4cb33d48cddb. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
338104d to
0ae1874
Compare
|
Land-ready proof for
Review artifacts validated with |
0ae1874 to
de69d6c
Compare
eb10009 to
752f6a7
Compare
752f6a7 to
4fe2dc2
Compare
|
Merged via squash.
|
* test: finish shared helper migrations * test: fix helper migration CI * style: fix test import ordering * test(acpx): restore deferred void types * test: fix helper migrations after rebase
… advance 80) Resolution (13 raw conflicts; 12 ui resolved by fork-ownership policy): - pnpm-lock.yaml: regenerated via pnpm install (derived file). - extensions/openshell/src/openshell-core.test.ts (merge=ours drift): ADOPT-UPSTREAM openclaw#129258 fixture dedup + openclaw#120996 tempWorkspace migration + openclaw#126828 canonical-owner test (fork's makeTempDir shape + missing test were stale freezes of older upstream code, not fork intent). Grafted fork's one genuine delta: required SandboxConfig.osSandbox block into createOpenShellBackendSandboxConfig. - src/agents/cli-runner.reliability.test.ts (merge=ours drift): clean 3-way merge-file. Kept fork tests + upstream openclaw#125085 (codex->agent-cli literals, watchdog resume tuning test; math verified against merged reliability.ts). - src/agents/embedded-agent-runner/run/incomplete-turn-recovery.ts: ADOPT-UPSTREAM (preflight tsgo-core=1 catch: upstream consumer openclaw#128970 imports resolveSettledToolBatchEvidence which merge churn had dropped from the fork provider; export surface differs by exactly this extraction; fork toolMetas type carries toolCallId?/terminate?/isError?). - ui/src/ui/markdown.ts: explicit param types on the linkify www plugin callbacks (validate/normalize). @types/markdown-it 14.1.2->14.2.0 (upstream dep bump) dropped contextual typing for them; the fork-owned ui copy now types them inline per linkify-it's Validate/Match signatures (upstream adapted its own ui tree the same way). Only ui file needed it; tsgo:test:ui 3->0 locally. Note: ui tree-hash invariant vs main intentionally broken by this one adaptation — main's ui does not compile against the new lockfile (baseline 0 was measured with @types 14.1.2). No product-collision: no codex/** residuals.
What Problem This Solves
Resolves a stalled test-maintenance migration where hundreds of tests still carried local copies of shared deferred-promise and temporary-directory helpers. The duplicates had drifted across core, UI, packages, and plugins, including repeated macOS temp-path canonicalization workarounds.
Why This Change Was Made
This completes the migration to the canonical shared helpers while preserving owner boundaries: core/root tests use
test/helpers, plugin tests remain behind existing Plugin SDK surfaces, and semantic outliers with permission, lifecycle, deterministic-layout, or migration-path contracts stay local. The shared temp-dir helper now owns canonical default temp roots while preserving explicitly supplied lexical roots. Obsolete test-only deferred aliases are removed.AI-assisted: yes. The final diff was manually coordinated, fully gated, simplified, and reviewed.
User Impact
No runtime or product behavior changes. Test setup is smaller and more consistent, cleanup ownership is clearer, and macOS path comparisons no longer need scattered default-temp
realpathcompensation.Evidence
pnpm plugin-sdk:surface:check, extension import boundaries, helper duplicate audits, andgit diff --checkpassed.origin/main; currentmainhas absorbed that red-main repair, so the final rebased PR correctly carries no generated manifest delta.pnpm plugin-sdk:api:checkpassed; the focused cron test passed 7/7; focused lint passed; follow-up autoreview was clean.0ae187485aa4ce1dbbe1d501cd54a26dec08624a: whole-repooxfmt --checkpassed across 27,898 files; focused tests passed 17/17 across three shards;pnpm plugin-sdk:api:check, helper duplicate audits, andgit diff --checkpassed.