use claude_codes::{assert_fully_wrapped, ClaudeOutput};
use serde_json::json;
#[test]
fn assistant_carries_thinking_display() {
let frame = json!({
"type": "assistant",
"message": {
"id": "msg_01",
"type": "message",
"role": "assistant",
"model": "claude-fable-5-1",
"content": [{"type": "thinking", "thinking": "hmm", "signature": "sig"}],
"stop_reason": null,
"stop_sequence": null,
"usage": {"input_tokens": 1, "output_tokens": 1}
},
"parent_tool_use_id": null,
"session_id": "s1",
"uuid": "u1",
"thinking_duration_ms": 1375,
"thinking_display": "omitted"
});
assert_fully_wrapped(&frame);
let ClaudeOutput::Assistant(msg) = serde_json::from_value(frame).unwrap() else {
panic!("expected Assistant");
};
assert_eq!(msg.thinking_display.as_deref(), Some("omitted"));
assert_eq!(msg.thinking_duration_ms, Some(1375));
}
#[test]
fn turn_handoff_available_carries_hydrates_carried_lines() {
let frame = json!({
"type": "system",
"subtype": "turn_handoff_available",
"v": 1,
"tools": ["Write"],
"worker_epoch": 7,
"carried_writes": true,
"hydrates_carried_lines": true,
"uuid": "u1",
"session_id": "s1"
});
assert_fully_wrapped(&frame);
let ClaudeOutput::System(sys) = serde_json::from_value(frame).unwrap() else {
panic!("expected System");
};
let handoff = sys.as_turn_handoff_available().expect("typed accessor");
assert_eq!(handoff.hydrates_carried_lines, Some(true));
assert_eq!(handoff.carried_writes, Some(true));
assert!(handoff.extra.is_empty());
}