Repository navigation
fix(packaging): make built package imports side-effect free - #136308
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 2, 2026, 9:50 AM ET / 13:50 UTC. ClawSweeper reviewWhat this changesThe PR defers temporary-directory resolution from package import time to active logger use, keeps the browser-profile facade lightweight, and strengthens the packaged bundled-channel smoke test's pnpm-layout model. Merge readinessKeep open for maintainer handling: the active member PR has a coherent, owner-boundary repair and no introduced correctness defect was found. Current-main blobs could not be hydrated in this read-only checkout, so this review does not claim a current-main equivalence check. Priority: P2 Review scores
Verification
How this fits togetherBuilt OpenClaw packages import bundled channel entrypoints from the distribution directory. Those imports can transit through logging and browser-profile SDK facades, while active runtime owners resolve secure temporary paths only when needed. flowchart LR
A[Built OpenClaw package] --> B[Bundled channel entrypoint]
B --> C[Logging and browser SDK imports]
C --> D{Runtime path needed?}
D -->|No| E[Side-effect-free package import]
D -->|Yes| F[Secure temporary-path resolver]
E --> G[Installed-layout package smoke]
F --> H[Active log or browser runtime]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -15, Tests +133, Other +6. Total +124 across 7 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain lazy secure-path resolution at active logger and browser-runtime boundaries, with the installed-layout smoke guarding package imports and pnpm transitive resolution. Do we have a high-confidence way to reproduce the issue? Unclear on fetched current main because its blobs were unavailable locally; the PR base visibly invokes secure temp resolution during logger module initialization, and the new focused tests encode that import-time regression. Is this the best way to solve the issue? Yes. The patch removes eager work at the import boundary while retaining secure resolution in the active logger path and leaving the browser plugin's platform-aware runtime path owner intact. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against db907da599e3. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
1cc0848 to
8f5d540
Compare
bf8604b to
2802c0b
Compare
|
Merged via squash.
|
…#136308) * fix(packaging): defer secure temp resolution during imports * fix(packaging): model installed layout without preserved symlinks * fix(packaging): remove obsolete logger lint suppression * fix(packaging): prune logger max-lines baseline
Summary
Root cause
Full Release Validation run 33623025793 failed the bundled-channel package smoke with
ERR_REQUIRE_ESM_RACE_CONDITION. Importing the built package triggered secure temporary-directory filesystem work during module initialization.After removing that import-time work, the smoke exposed a second harness defect: the installed-layout fixture preserved the package-root symlink globally, so Node resolved transitive dependencies from the logical package path and could not see pnpm's nested dependency layout.
The logger owns active log-path resolution, the browser plugin owns platform-aware upload paths, and the package smoke owns its installed-layout model. The fix moves work to those boundaries instead of adding retries or dependency fallbacks.
Verification
pnpm build:packagechannel=3 setup=3 legacySetup=0pnpm exec vitest run test/openclaw-prepack.test.tsgit diff --checkTest audit
The import tests fail if secure temp resolution returns to module initialization. The prepack fixture creates a pnpm-shaped unhoisted transitive dependency and fails if the smoke restores global symlink preservation or stops modeling the copied installed package.
Scope
FRV evidence: https://github.com/openclaw/openclaw/actions/runs/33623025793