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:
Nikketryhard
2026-02-14 19:30:09 -06:00
parent 19dc920872
commit 905d55beb5
4 changed files with 60 additions and 17 deletions

View File

@@ -79,6 +79,7 @@ impl GrpcUsage {
input_tokens: self.input_tokens,
output_tokens: self.output_tokens,
thinking_output_tokens: self.thinking_output_tokens,
thinking_text: None, // gRPC proto doesn't carry thinking text
response_output_tokens: self.response_output_tokens,
cache_creation_input_tokens: self.cache_write_tokens,
cache_read_input_tokens: self.cache_read_tokens,