{"record":{"id":"f339bfe7d31d5123","repo":"earendil-works/pi","slug":"extension-extension-path-failed-to-load-and-i","errorCode":null,"errorMessage":"Extension \"${extension.path}\" failed to load and its API is no longer active.","messagePattern":"Extension \"(.+?)\" failed to load and its API is no longer active\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/core/extensions/loader.ts","lineNumber":266,"sourceCode":"\n/**\n * Create the ExtensionAPI for an extension.\n * Registration methods write to the extension object.\n * Action methods delegate to the shared runtime.\n */\nfunction createExtensionAPI(\n\textension: Extension,\n\truntime: ExtensionRuntime,\n\tcwd: string,\n\teventBus: EventBus,\n): { api: ExtensionAPI; commit: () => void; discard: () => void } {\n\tconst pendingFlagValues = new Map<string, boolean | string>();\n\tconst pendingRuntimeChanges: Array<() => void> = [];\n\tconst loadingUnsubscribers: Array<() => void> = [];\n\tlet state: \"loading\" | \"active\" | \"failed\" = \"loading\";\n\tconst assertActive = () => {\n\t\tif (state === \"failed\") {\n\t\t\tthrow new Error(`Extension \"${extension.path}\" failed to load and its API is no longer active.`);\n\t\t}\n\t\truntime.assertActive();\n\t};\n\tconst applyRuntimeChange = (change: () => void) => {\n\t\tif (state === \"loading\") pendingRuntimeChanges.push(change);\n\t\telse change();\n\t};\n\tconst clearPending = () => {\n\t\tpendingFlagValues.clear();\n\t\tpendingRuntimeChanges.length = 0;\n\t\tloadingUnsubscribers.length = 0;\n\t};\n\n\tconst api = {\n\t\t// Registration methods - write to extension\n\t\ton(event: string, handler: HandlerFn): void {\n\t\t\tassertActive();\n\t\t\tconst list = extension.handlers.get(event) ?? [];","sourceCodeStart":248,"sourceCodeEnd":284,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/coding-agent/src/core/extensions/loader.ts#L248-L284","documentation":"Error \"Extension \"${extension.path}\" failed to load and its API is no longer active.\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/coding-agent/src/core/extensions/loader.ts:266 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4af9d21d3b4d664e4a29fcabfec85171077248e3","analyzedAt":"2026-08-24T13:07:14.692Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}