Skip to content

/reload doesn't pick up changes to an extension's imported .mjs/.cjs files #6000

Description

@eyalroth

What happened?

/reload picks up changes to an extension's entry .ts but not to its imported .mjs/.cjs dependencies. The stale dependency module is reused, so a new entry referencing a newly-added dependency export sees undefined.

Steps to reproduce

  1. Create ~/.pi/agent/extensions/reload-test/dep.mjs with export const VAL = "old";
  2. Create index.ts next to it that imports VAL and exposes it (e.g. a /reproval command that notifies its value).
  3. /reload -> /reproval -> reports old.
  4. Edit only dep.mjs -> export const VAL = "new";.
  5. /reload -> /reproval -> still reports old.
  6. Restart pi -> /reproval -> reports new.

Expected behavior

/reload re-evaluates the full extension module graph, or at least have this gap mentioned in the docs.

Version

pi 0.78.1, macOS 26.5.1, Node v24.15.0, iTerm2 3.6.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingno-actionThis issue has been rejected after triage

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions