coleam00/Archon · error
Pi extension load failed: ${message}. Check the extensions i
Error message
Pi extension load failed: ${message}. Check the extensions in ~/.pi/agent/extensions/ (and the repo's .pi/), or set `assistants.pi.enableExtensions: false` to run without them. What it means
getOrCreateReloadedExtensionLoader loads Pi extensions (arbitrary JS) from ~/.pi/agent/extensions/ and the repo's .pi/. If an extension throws during load, the failed promise is evicted for clean retry and the error is rethrown with an actionable pointer, preserving the original as `cause`.
Source
Thrown at packages/providers/src/community/pi/resource-loader.ts:233
// would silently never apply.
try {
await loader.reload();
// Snapshot NOW, before any session's bindCore() drains the queue into
// its own ModelRegistry and clears it. Defensive copy: bindCore()
// reassigns the array, so the copy stays stable, but a copy also
// guards against future in-place mutation upstream.
const providerRegistrations: ExtensionProviderRegistration[] = [
...loader.getExtensions().runtime.pendingProviderRegistrations,
];
return { loader, providerRegistrations };
} catch (error) {
// Extensions execute arbitrary JS from ~/.pi/agent/extensions/ (and the
// repo's .pi/); a broken one fails here. Rethrow with an actionable
// pointer, preserving the original error as `cause`, so the operator
// isn't left with a bare Pi SDK message. The failed promise is evicted
// below, so the next call retries cleanly.
const message = error instanceof Error ? error.message : String(error);
throw new Error(
`Pi extension load failed: ${message}. Check the extensions in ~/.pi/agent/extensions/ ` +
"(and the repo's .pi/), or set `assistants.pi.enableExtensions: false` to run without them.",
{ cause: error }
);
}
})();
reloadedExtensionLoaderCache.set(key, pending);
// Evict on failure so a transient reload error doesn't poison the cache.
pending.catch(() => reloadedExtensionLoaderCache.delete(key));
}
return pending;
}
/**
* Test-only: clear the process-level loader cache so each test starts empty.
* The cache is module-level and would otherwise leak loaders (and their mocked
* reload/construct call counts) across tests in the same file.
*/View on GitHub (pinned to 0773b97458)
Solutions
- Read the `cause` in the message/logs to find which extension failed, then fix or remove it from ~/.pi/agent/extensions/ (and repo .pi/)
- Temporarily set assistants.pi.enableExtensions: false in .archon/config.yaml to run without extensions
- Update or reinstall the broken extension (e.g. `pi install npm:pi-provider-kiro`)
- Check the extension's dependencies are installed and compatible with the current Pi SDK version
Example fix
// before: broken ~/.pi/agent/extensions/myext.js import missingPkg from 'not-installed'; // after: either remove the file or install its dependency $ npm install -g not-installed # or delete ~/.pi/agent/extensions/myext.js
Defensive patterns
Strategy: try-catch
Validate before calling
import { existsSync, readdirSync } from 'node:fs';
const extDirs = [`${process.env.HOME}/.pi/agent/extensions`, '.pi'].filter(existsSync);
for (const dir of extDirs) {
for (const f of readdirSync(dir)) {
if (f.endsWith('.js')) {
try { await import(`${dir}/${f}`); } catch (e) { console.error(`Extension ${f} fails to load: ${e.message}`); }
}
}
} Type guard
function isExtensionLoadError(e: unknown): boolean {
return e instanceof Error && e.message.startsWith('Pi extension load failed');
} Try / catch
try {
await sendQuery(q);
} catch (err) {
if (isExtensionLoadError(err)) {
log.error({ cause: err.cause }, 'pi extension failed; fix/remove it or set enableExtensions: false');
}
throw err;
} Prevention
- Test extension scripts with `node --check` / a smoke import after editing them
- Keep extensions' npm dependencies installed and updated for the Pi SDK version
- Remove stale repo-local .pi/ extensions you don't need
- Set assistants.pi.enableExtensions: false in environments where extensions aren't required
When it happens
Trigger: sendQuery/listPiModels triggering extension loading when any extension file in ~/.pi/agent/extensions/ or .pi/ throws on import, has a syntax error, a missing dependency, or an incompatibility with the current Pi SDK version.
Common situations: A broken/half-edited extension script, an extension requiring an npm package not installed, an extension written against an older Pi SDK after an upgrade, or a repo-local .pi/ extension left over from another project.
Related errors
- Pi model not found: provider='${parsed.provider}' model='${p
- Pi provider requires a model. Set `model` on the workflow no
- Pi auth storage init failed: ${e.message}. Check that ~/.pi/
- Pi auth: no credentials for provider '${parsed.provider}'. $
- missing_assistant_message
AI-assisted analysis of coleam00/Archon@0773b97458 (2026-09-01).
Data as JSON: /api/errors/b4c50266ea76a0e0.
Report an issue: GitHub.