{"record":{"id":"401964107aea9020","repo":"earendil-works/pi","slug":"cannot-submit-a-prompt-while-compaction-is-in-prog","errorCode":null,"errorMessage":"Cannot submit a prompt while compaction is in progress. Wait for compaction to finish and retry.","messagePattern":"Cannot submit a prompt while compaction is in progress\\. Wait for compaction to finish and retry\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/core/agent-session.ts","lineNumber":1145,"sourceCode":"\tasync prompt(text: string, options?: PromptOptions): Promise<void> {\n\t\tconst expandPromptTemplates = options?.expandPromptTemplates ?? true;\n\t\tconst preflightResult = options?.preflightResult;\n\t\tlet messages: AgentMessage[] | undefined;\n\n\t\ttry {\n\t\t\t// Handle extension commands first (execute immediately, even during streaming)\n\t\t\t// Extension commands manage their own LLM interaction via pi.sendMessage()\n\t\t\tif (expandPromptTemplates && text.startsWith(\"/\")) {\n\t\t\t\tconst handled = await this._tryExecuteExtensionCommand(text);\n\t\t\t\tif (handled) {\n\t\t\t\t\t// Extension command executed, no prompt to send\n\t\t\t\t\tpreflightResult?.(true);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this._compactionAbortController !== undefined) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"Cannot submit a prompt while compaction is in progress. Wait for compaction to finish and retry.\",\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Emit input event for extension interception (before skill/template expansion)\n\t\t\tlet currentText = text;\n\t\t\tlet currentImages = options?.images;\n\t\t\tif (this._extensionRunner.hasHandlers(\"input\")) {\n\t\t\t\tconst inputResult = await this._extensionRunner.emitInput(\n\t\t\t\t\tcurrentText,\n\t\t\t\t\tcurrentImages,\n\t\t\t\t\toptions?.source ?? \"interactive\",\n\t\t\t\t\tthis.isStreaming ? options?.streamingBehavior : undefined,\n\t\t\t\t);\n\t\t\t\tif (inputResult.action === \"handled\") {\n\t\t\t\t\tpreflightResult?.(true);\n\t\t\t\t\treturn;\n\t\t\t\t}","sourceCodeStart":1127,"sourceCodeEnd":1163,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/coding-agent/src/core/agent-session.ts#L1127-L1163","documentation":"Error \"Cannot submit a prompt while compaction is in progress. Wait for compaction to finish and retry.\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/coding-agent/src/core/agent-session.ts:1145 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"}