singularity-forge/packages/pi-coding-agent/src
Tom Boucher 4cb6252b9b fix(perf): share jiti module cache across extension loads (#3308)
* fix(perf): share jiti module cache across extension loads (#2108)

Each extension was creating a new jiti instance with moduleCache: false,
causing shared dependencies to be recompiled for every extension. Use a
shared singleton with moduleCache: true so shared modules are compiled once.

Export resetExtensionLoaderCache() for test teardown and explicit reload.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: correct loader path in extension-load-perf test (4 → 3 levels up)

The test file is at src/tests/ (2 levels deep from repo root), so
fileURLToPath(import.meta.url) + 3x'..' reaches the repo root.
Using 4 levels exits the repo into the GitHub Actions workspace parent,
causing ERR_MODULE_NOT_FOUND for loader.js in dist/.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: use process.cwd() for loader path in perf test (source/compiled portability)

import.meta.url resolves to different depths in source (src/tests/) vs compiled
(dist-test/src/tests/), so relative '../' navigation produces the wrong path in
the build phase. process.cwd() is always the repo root in CI regardless of
where the test file is compiled to.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: trek-e <trek-e@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 07:59:17 -04:00
..
cli feat: Wire --bare mode across headless → pi-coding-agent → resource-loa… 2026-03-26 11:39:25 -06:00
core fix(perf): share jiti module cache across extension loads (#3308) 2026-04-05 07:59:17 -04:00
modes fix: route non-builtin slash commands after TUI dispatch 2026-04-03 06:44:09 +02:00
resources/extensions/memory refactor(test): replace try/finally with beforeEach/afterEach in packages tests (#2390) 2026-03-24 21:34:10 -06:00
tests fix: normalize Windows paths in LLM-visible text to prevent bash failures (#874) (#884) 2026-03-17 09:02:23 -06:00
utils fix(windows): prevent EINVAL by disabling detached process groups on Win32 (#2744) 2026-03-26 16:08:03 -06:00
cli.ts feat: vendor Pi source into workspace monorepo 2026-03-12 21:55:17 -06:00
config.ts refactor: remove dead code (unused exports) (#1486) 2026-03-19 15:33:32 -06:00
index.ts fix(security): add configurable overrides for command allowlist and SSRF blocklist 2026-04-02 13:45:05 +02:00
main.ts feat: Wire --bare mode across headless → pi-coding-agent → resource-loa… 2026-03-26 11:39:25 -06:00
migrations.ts refactor: remove dead code (unused exports) (#1486) 2026-03-19 15:33:32 -06:00