assistant2: Persist scripting tool uses in saved threads (#26404)

This PR makes it so the scripting tool uses are persisted to and
restored from saved threads.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-03-10 17:42:23 -04:00 committed by GitHub
parent 6cfc4dc857
commit 082cc6184c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 52 additions and 21 deletions

View file

@ -117,8 +117,10 @@ impl Thread {
.map(|message| message.id.0 + 1)
.unwrap_or(0),
);
let tool_use = ToolUseState::from_saved_messages(&saved.messages);
let scripting_tool_use = ToolUseState::new();
let tool_use =
ToolUseState::from_saved_messages(&saved.messages, |name| name != ScriptingTool::NAME);
let scripting_tool_use =
ToolUseState::from_saved_messages(&saved.messages, |name| name == ScriptingTool::NAME);
Self {
id,