assistant2: Rework how tool results are stored and referred to (#25817)

This PR reworks how we store tool results and refer to them later.

We now maintain a mapping of the tool uses to their corresponding
results, with separate mappings for the messages and the tool uses they
correspond to.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-02-28 11:33:08 -05:00 committed by GitHub
parent 508b581215
commit b445e4ce24
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 56 additions and 64 deletions

View file

@ -255,12 +255,7 @@ impl ActiveThread {
let task = tool.run(tool_use.input, self.workspace.clone(), window, cx);
self.thread.update(cx, |thread, cx| {
thread.insert_tool_output(
tool_use.assistant_message_id,
tool_use.id.clone(),
task,
cx,
);
thread.insert_tool_output(tool_use.id.clone(), task, cx);
});
}
}