{"record":{"id":"f85c80a19c52ebc8","repo":"earendil-works/pi","slug":"failed-to-cleanup-session-resources","errorCode":null,"errorMessage":"Failed to cleanup session resources","messagePattern":"Failed to cleanup session resources","errorType":"exception","errorClass":"AggregateError","httpStatus":null,"severity":"error","filePath":"packages/ai/src/session-resources.ts","lineNumber":22,"sourceCode":"\nexport function registerSessionResourceCleanup(cleanup: SessionResourceCleanup): () => void {\n\tsessionResourceCleanups.add(cleanup);\n\treturn () => {\n\t\tsessionResourceCleanups.delete(cleanup);\n\t};\n}\n\nexport function cleanupSessionResources(sessionId?: string): void {\n\tconst errors: unknown[] = [];\n\tfor (const cleanup of sessionResourceCleanups) {\n\t\ttry {\n\t\t\tcleanup(sessionId);\n\t\t} catch (error) {\n\t\t\terrors.push(error);\n\t\t}\n\t}\n\tif (errors.length > 0) {\n\t\tthrow new AggregateError(errors, \"Failed to cleanup session resources\");\n\t}\n}\n","sourceCodeStart":4,"sourceCodeEnd":25,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/ai/src/session-resources.ts#L4-L25","documentation":"Error \"Failed to cleanup session resources\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/ai/src/session-resources.ts:22 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the underlying cause; ensure session resources are closable and retry the cleanup."],"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"}