claw-code/rust/crates/api/src
Yeachan-Heo 13851d800f Accept reasoning-style content blocks in the Rust API parser
The Rust API layer rejected thinking-enabled responses because it only recognized text and tool_use content blocks. This commit extends the response and SSE parser types to accept reasoning-style content blocks and deltas, with regression coverage for both non-streaming and streaming responses.

Constraint: Keep parsing compatible with existing text and tool-use message flows
Rejected: Deserialize unknown content blocks into an untyped catch-all | would weaken protocol coverage and test precision
Confidence: high
Scope-risk: narrow
Directive: Keep new protocol variants covered at the API boundary so downstream code can make explicit choices about preservation vs. ignoring
Tested: cargo test -p api thinking -- --nocapture
Not-tested: Live API traffic from a real thinking-enabled model
2026-04-01 08:06:10 +00:00
..
client.rs fix: remove debug logs, set model-specific max_tokens (opus=32k, sonnet/haiku=64k) 2026-04-01 02:14:20 +00:00
error.rs Enable Claude OAuth login without requiring API keys 2026-03-31 23:38:05 +00:00
lib.rs Enable real Agent tool delegation in the Rust CLI 2026-04-01 03:10:20 +00:00
sse.rs Accept reasoning-style content blocks in the Rust API parser 2026-04-01 08:06:10 +00:00
types.rs Accept reasoning-style content blocks in the Rust API parser 2026-04-01 08:06:10 +00:00