{"record":{"id":"c3d42a3336e0c577","repo":"Kuberwastaken/claurst","slug":"api-error","errorCode":null,"errorMessage":"API error: {}","messagePattern":"API error: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-rust/crates/query/src/session_memory.rs","lineNumber":258,"sourceCode":"\r\n        let working_dir_str = working_dir.display().to_string();\r\n        let prompt = build_extraction_prompt(&transcript, &working_dir_str);\r\n\r\n        let api_msgs = vec![ApiMessage {\r\n            role: \"user\".to_string(),\r\n            content: Value::String(prompt),\r\n        }];\r\n\r\n        let request = CreateMessageRequest::builder(&self.model, self.max_tokens)\r\n            .messages(api_msgs)\r\n            .system(SystemPrompt::Text(EXTRACTION_SYSTEM_PROMPT.to_string()))\r\n            .build();\r\n\r\n        let handler: Arc<dyn StreamHandler> = Arc::new(claurst_api::streaming::NullStreamHandler);\r\n        let mut rx = api_client\r\n            .create_message_stream(request, handler)\r\n            .await\r\n            .map_err(|e| anyhow::anyhow!(\"API error: {}\", e))?;\r\n\r\n        let mut acc = StreamAccumulator::new();\r\n        while let Some(evt) = rx.recv().await {\r\n            acc.on_event(&evt);\r\n            if matches!(evt, AnthropicStreamEvent::MessageStop) {\r\n                break;\r\n            }\r\n        }\r\n\r\n        let (response_msg, _usage, _stop) = acc.finish();\r\n        let response_text = response_msg.get_all_text();\r\n\r\n        if response_text.is_empty() {\r\n            debug!(\"Session memory extraction produced empty response\");\r\n            return Ok(vec![]);\r\n        }\r\n\r\n        let memories = parse_extraction_response(&response_text);\r","sourceCodeStart":240,"sourceCodeEnd":276,"githubUrl":"https://github.com/Kuberwastaken/claurst/blob/b0637c97ec34144387cbf2f74f65df6d16a6cef1/src-rust/crates/query/src/session_memory.rs#L240-L276","documentation":"Generic re-wrapping sentinel from session-memory extraction: the LLM request used to extract a session summary returned a non-success API result, and the underlying API error is re-raised as \"API error: {e}\". The fault is the model API call (auth, rate limit, server error), not the local transcript.","triggerScenarios":"Thrown at src-rust/crates/query/src/session_memory.rs:258 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check API key validity and quota","Retry the session-memory extraction; transient provider errors are common","Disable session memory extraction if the configured model is unavailable"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b0637c97ec34144387cbf2f74f65df6d16a6cef1","analyzedAt":"2026-09-10T00:24:58.650Z","contentChangedAt":"2026-09-10T00:24:58.650Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}