Skip to content

Commit 9a27318

Browse files
committed
fix tool use hydration
1 parent 26b3672 commit 9a27318

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

crates/chat-cli/src/cli/chat/conversation_state.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ impl ConversationState {
370370
Tool::ToolSpecification(tool_specification) => tool_specification.name.as_str(),
371371
})
372372
})
373+
.filter(|name| *name != DUMMY_TOOL_NAME)
373374
.collect();
374375

375376
for (_, assistant) in &mut self.history {

crates/chat-cli/src/cli/chat/parser.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,14 @@ impl ResponseParser {
244244
// if the tool just does not need any input
245245
_ => serde_json::json!({}),
246246
};
247+
let orig_name = name.clone();
248+
let orig_args = args.clone();
247249
Ok(AssistantToolUse {
248250
id,
249251
name,
252+
orig_name,
250253
args,
251-
..Default::default()
254+
orig_args,
252255
})
253256
}
254257

0 commit comments

Comments
 (0)