fix: resolve thinking/streaming/update merge conflicts

This commit is contained in:
Yeachan-Heo
2026-04-01 01:15:30 +00:00
parent bec07658b8
commit 583d191527
2 changed files with 22 additions and 1 deletions

View File

@@ -1666,6 +1666,7 @@ impl ApiClient for AnthropicAgentApiClient {
tools: Some(agent_tool_definitions()),
tool_choice: Some(ToolChoice::Auto),
stream: true,
thinking: None,
};
self.runtime.block_on(async {
@@ -1709,6 +1710,8 @@ impl ApiClient for AnthropicAgentApiClient {
input.push_str(&partial_json);
}
}
ContentBlockDelta::ThinkingDelta { .. }
| ContentBlockDelta::SignatureDelta { .. } => {}
},
ApiStreamEvent::ContentBlockStop(_) => {
if let Some((id, name, input)) = pending_tool.take() {
@@ -1792,6 +1795,7 @@ fn convert_agent_messages(messages: &[ConversationMessage]) -> Vec<InputMessage>
}],
is_error: *is_error,
},
ContentBlock::Thinking { .. } => InputContentBlock::Text { text: String::new() },
})
.collect::<Vec<_>>();
(!content.is_empty()).then(|| InputMessage {
@@ -1829,6 +1833,7 @@ fn push_agent_output_block(
OutputContentBlock::ToolUse { id, name, input } => {
*pending_tool = Some((id, name, input.to_string()));
}
OutputContentBlock::Thinking { .. } => {}
}
}