Add persistent local agent tools

This commit is contained in:
Georg Bauer
2026-07-25 14:57:17 +02:00
parent 668d8b787e
commit 4a45735072
20 changed files with 3139 additions and 37 deletions

View File

@@ -132,7 +132,11 @@ impl ToolProjector {
self.state = ToolProjectionState::Failed;
break;
};
let id = random_tool_id(prefix);
let id = if prefix.is_empty() {
String::new()
} else {
random_tool_id(prefix)
};
self.ids.push(id.clone());
events.push(ToolProjectionEvent::Start {
index: self.index,
@@ -370,6 +374,7 @@ pub(super) fn render_messages(
}
"user" => turns.push(ChatTurn {
user: true,
tool: false,
skip_previous_eos: false,
reasoning: None,
reasoning_complete: true,
@@ -388,6 +393,7 @@ pub(super) fn render_messages(
} else {
turns.push(ChatTurn {
user: true,
tool: false,
skip_previous_eos: protocol == Protocol::Responses,
reasoning: None,
reasoning_complete: true,
@@ -403,6 +409,7 @@ pub(super) fn render_messages(
let reasoning = content_text(&message.reasoning_content);
turns.push(ChatTurn {
user: false,
tool: false,
skip_previous_eos: false,
reasoning: (preserve_reasoning && !reasoning.is_empty()).then_some(reasoning),
reasoning_complete: true,