Skip to content

Document: pi restart (not /reload) required to pick up updated compiled extension code #129

Description

@fitchmultz

Context: found during post-release v0.4.1 verification (d6cde09).

Symptom: after pi update --extensions correctly reconciles the git clone and prepare rebuilds dist/, a running pi process keeps executing the previously imported extension modules. /reload does NOT swap them: pi-core's extension loader (dist/core/extensions/loader.js) creates jiti with moduleCache: false, but in built-Node mode jiti's tryNative path uses native import() for plain .js entrypoints/imports, and node's process-wide ESM cache returns the old modules. TypeScript-source extensions re-transpile and truly hot-swap; compiled-dist extensions like this one do not.

Proof: live tool ran pre-v0.4.1 behavior (raw batch rows got no parent-dir preparation; --bail=true + malformed ignored stdin rejected pre-spawn) while direct imports of the on-disk dist passed both. After a full pi quit+relaunch, the same calls behave correctly (raw-row mkdir works, argv-mode stdin ignored, record-start invalidation chain intact).

Actions:

  1. README + docs/RELEASE.md + docs/COMMAND_REFERENCE.md operational note: after updating this package, restart pi; /reload is not sufficient for the compiled entrypoint.
  2. Consider reporting the jiti tryNative reload gap upstream to pi (affects every compiled/multi-file .js extension, not just this package).
  3. Optional: investigate whether a cache-busting entrypoint shim (query-param import or version-stamped filename emitted by prepare) can make /reload effective for this package without pi-core changes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions