Skip to content

fix(packaging): make built package imports side-effect free - #136308

Merged
vincentkoc merged 4 commits into
mainfrom
fix/frv-logger-temp
Sep 2, 2026
Merged

vincentkoc merged 4 commits into
mainfrom
fix/frv-logger-temp

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 2, 2026 •

Copy link
Copy Markdown
Member

Summary

  • defer secure temporary-directory resolution until logger runtime initialization
  • keep the plugin SDK browser-profile facade free of import-time filesystem work
  • model the installed package layout without preserving package-root symlinks
  • add import and pnpm-shaped transitive-resolution regressions

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

  • Node 24 full package build: pnpm build:package
  • Node 24 built bundled-channel smoke: pass, channel=3 setup=3 legacySetup=0
  • pnpm exec vitest run test/openclaw-prepack.test.ts
  • focused logger, plugin SDK, temp-path, and browser-import tests
  • plugin SDK export check
  • formatting, oxlint, and git diff --check
  • autoreview: clean, no actionable findings

Test 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

  • production/tooling: net -8 lines
  • tests: +145/-12
  • removes import-time filesystem work and the obsolete preserve-symlinks execution path
  • no changelog entry: repository policy reserves changelog edits for release preparation

FRV evidence: https://github.com/openclaw/openclaw/actions/runs/33623025793

@vincentkoc vincentkoc self-assigned this Sep 2, 2026
@clawsweeper

clawsweeper Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: M maintainer Maintainer-authored PR labels Sep 2, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review September 2, 2026 12:58
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 2, 2026
@clawsweeper

clawsweeper Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 2, 2026, 9:50 AM ET / 13:50 UTC.

ClawSweeper review

What this changes

The 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 readiness

⚠️ Ready for maintainer review - 1 item remains

Keep 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
Reviewed head: 2802c0b14d9e5ab3349e0e9c42a8dfbc70c4963e

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-negative production repair with meaningful package and import regressions; no actionable patch defect was identified.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored internal package reliability repair is exempt from the external-contributor proof gate; its provided validation claims and focused source regressions remain supplemental evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored internal package reliability repair is exempt from the external-contributor proof gate; its provided validation claims and focused source regressions remain supplemental evidence.
Evidence reviewed 6 items Lazy logger default: The PR makes exported legacy defaults static POSIX strings, while active settings resolve the rolling file path only through the runtime resolver path.
Runtime resolver remains authoritative: The rolling-log helper resolves the secure temporary directory only when called in a Node filesystem runtime, preserving platform-aware active log paths.
Browser runtime owns upload path: The browser plugin's runtime path module independently derives its upload root from the secure temporary resolver; the changed core facade is documented as private-local rather than a third-party SDK contract.
Findings None None.
Security None None.

How this fits together

Built 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]
Loading

Before merge

  • Resolve merge risk (P1) - Current main advanced beyond the PR base, but its source blobs could not be hydrated locally because the promisor remote was unreachable; final exact-head CI and maintainer review should cover that drift.
Agent review details

Security

None.

PR surface

Source -15, Tests +133, Other +6. Total +124 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 2 9 24 -15
Tests 3 145 12 +133
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 15 9 +6
Total 7 169 45 +124

Review metrics

Metric Value Why it matters
Production versus test delta production/tooling −8 net; tests +133 net; baseline −1 The repair reduces production import-time work while adding focused import and installed-layout regressions.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain lazy secure-path resolution at active logger and browser-runtime boundaries, with the installed-layout smoke guarding package imports and pnpm transitive resolution.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best 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.

Labels

Label justifications:

  • P2: This repairs package-build reliability with a bounded blast radius and no demonstrated user-data or security impact.
  • 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 MEMBER-authored internal package reliability repair is exempt from the external-contributor proof gate; its provided validation claims and focused source regressions remain supplemental evidence.

Evidence

What I checked:

  • Lazy logger default: The PR makes exported legacy defaults static POSIX strings, while active settings resolve the rolling file path only through the runtime resolver path. (src/logging/logger.ts:42, 2802c0b14d9e)
  • Runtime resolver remains authoritative: The rolling-log helper resolves the secure temporary directory only when called in a Node filesystem runtime, preserving platform-aware active log paths. (src/logging/log-file-path.ts:45, 2802c0b14d9e)
  • Browser runtime owns upload path: The browser plugin's runtime path module independently derives its upload root from the secure temporary resolver; the changed core facade is documented as private-local rather than a third-party SDK contract. (extensions/browser/src/browser/paths.ts:35, 2802c0b14d9e)
  • Package-layout regression coverage: The prepack test builds a pnpm-shaped unhoisted dependency graph and runs source, installed-environment, and installed-path smoke variants through Node. (test/openclaw-prepack.test.ts:315, 2802c0b14d9e)
  • Relevant history: Recent logging ownership includes the active-log-path preparation change by Peter Steinberger; package-smoke cleanup was also recently maintained by Peter Steinberger. (src/logging/logger.ts:511, c6e445d2fba4)
  • Release status: No local release tag contains the PR's initial repair commit, as expected for an open branch; this is not a fixed-on-main close. (f575fcd722cb)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: 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.

History

Review history (3 earlier review cycles)
  • reviewed 2026-09-02T13:05:12.275Z sha 1cc0848 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-02T13:21:18.720Z sha 8f5d540 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-02T13:32:26.849Z sha ad3a0da0cb3dcecb8e63ec9fa5095b192b7f6443 :: needs maintainer review before merge. :: none

@vincentkoc
vincentkoc merged commit ff6fb73 into main Sep 2, 2026
434 of 492 checks passed
@vincentkoc
vincentkoc deleted the fix/frv-logger-temp branch September 2, 2026 14:29
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 3, 2026
…#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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: M 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