Generate reasoning if Claude CLI is available, returning None if not. This is the non-fatal version — returns `None` instead of an error when Claude CLI is not installed or generation fails. Suitable for the recording pipeline where reasoning is optional enrichment.
(condensed_text: &str, files: &[String])
| 381 | /// Claude CLI is not installed or generation fails. Suitable for the |
| 382 | /// recording pipeline where reasoning is optional enrichment. |
| 383 | pub fn try_generate_reasoning(condensed_text: &str, files: &[String]) -> Option<TurnReasoning> { |
| 384 | let generator = ClaudeCliGenerator::new(); |
| 385 | |
| 386 | if !generator.is_available() { |
| 387 | log::debug!("Claude CLI not available — skipping reasoning generation"); |
| 388 | return None; |
| 389 | } |
| 390 | |
| 391 | match generator.generate(condensed_text, files) { |
| 392 | Ok(reasoning) => { |
| 393 | if reasoning.is_empty() { |
| 394 | log::debug!("Reasoning generator returned empty result — skipping"); |
| 395 | None |
| 396 | } else { |
| 397 | Some(reasoning) |
| 398 | } |
| 399 | } |
| 400 | Err(e) => { |
| 401 | log::warn!("Reasoning generation failed (non-fatal): {}", e); |
| 402 | None |
| 403 | } |
| 404 | } |
| 405 | } |
| 406 | |
| 407 | // Mock Generator (for testing) |
| 408 |
nothing calls this directly
no test coverage detected