feat: capture thinking text from MITM-intercepted API responses
The LS strips thinking/reasoning text from plannerResponse steps — only the thinkingSignature (opaque verification blob) is preserved. The actual thinking text flows through the MITM proxy in the raw Google SSE response (parts with thought: true) and Anthropic SSE (thinking_delta content blocks). Changes: - StreamingAccumulator now accumulates thinking text from SSE events - ApiUsage gains thinking_text: Option<String> - usage_from_poll returns (Usage, Option<thinking_text>) - Thinking text priority: MITM-captured > LS-extracted (fallback) - Reasoning output item now populated from real API data - Removed debug dump code
This commit is contained in:
@@ -22,6 +22,10 @@ pub struct ApiUsage {
|
||||
pub cache_read_input_tokens: u64,
|
||||
/// Google-specific: thinking/reasoning output tokens (extended thinking)
|
||||
pub thinking_output_tokens: u64,
|
||||
/// The actual thinking/reasoning text from the model.
|
||||
/// Captured from Google SSE parts with `thought: true` or Anthropic thinking blocks.
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub thinking_text: Option<String>,
|
||||
/// Google-specific: response output tokens (non-thinking portion)
|
||||
pub response_output_tokens: u64,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user