{"record":{"id":"60cf2c0cff1beef1","repo":"aaif-goose/goose","slug":"session-has-no-conversation-60cf2c","errorCode":null,"errorMessage":"Session has no conversation","messagePattern":"Session has no conversation","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/goose/src/agents/execute_commands.rs","lineNumber":186,"sourceCode":"                    .await\n            }\n        }\n    }\n\n    async fn handle_compact_command(&self, session_id: &str) -> Result<Option<Message>> {\n        let provider = self.provider().await?;\n        if provider.manages_own_context() {\n            return Err(anyhow!(context_management_unsupported_message(\n                \"compact\",\n                provider.get_name()\n            )));\n        }\n\n        let manager = self.config.session_manager.clone();\n        let session = manager.get_session(session_id, true).await?;\n        let conversation = session\n            .conversation\n            .ok_or_else(|| anyhow!(\"Session has no conversation\"))?;\n\n        let model_config = self.model_config_for_session(session_id).await?;\n        let compaction = compact_messages(\n            provider.as_ref(),\n            &model_config,\n            session_id,\n            &conversation,\n            true, // is_manual_compact\n        )\n        .await?;\n\n        manager\n            .replace_conversation(session_id, &compaction.conversation)\n            .await?;\n\n        self.update_session_metrics(\n            session_id,\n            session.schedule_id,","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/aaif-goose/goose/blob/3810898a7447ec3299be72e223d3570a7aabf0ab/crates/goose/src/agents/execute_commands.rs#L168-L204","documentation":"Thrown by the /compact command when the loaded session has no conversation: manager.get_session(session_id, true) succeeded but session.conversation is None. Compaction rewrites stored history, so with nothing stored there is nothing to compact. Most often this means the session was created but never persisted a message.","triggerScenarios":"Running /compact on a freshly created session before any user/assistant message was saved, or on a session whose conversation payload failed to persist/was never written to storage.","commonSituations":"Users running /compact immediately after session creation; automations issuing /compact unconditionally; partially written session files after a crash.","solutions":["Send at least one message in the session before running /compact","Verify the session id is the one you actually messaged in","If the session file should have history, inspect it in the session store for a missing conversation section"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Rust — confirm the session has history before compacting\nlet session = manager.get_session(session_id, true).await?;\nif session.conversation.is_none() {\n    // nothing to compact; send at least one message first\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only run /compact after at least one exchange has been persisted","In automations, skip compaction for sessions with no message history","Verify the session id matches the session you are actually conversing in"],"tags":["compact","session","empty-state","slash-commands"],"backgroundTag":null,"analyzedSha":"3810898a7447ec3299be72e223d3570a7aabf0ab","analyzedAt":"2026-08-16T10:14:26.282Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}