refactor: thread tool schemas through chat tool outputs

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
shern-point
2026-04-28 13:38:57 +08:00
parent 206c3d5479
commit 801b5abce3
7 changed files with 31 additions and 26 deletions

View File

@@ -70,12 +70,13 @@ func FilterIncrementalToolCallDeltasByAllowed(deltas []toolstream.ToolCallDelta,
return out
}
func FormatFinalStreamToolCallsWithStableIDs(calls []toolcall.ParsedToolCall, ids map[int]string) []map[string]any {
func FormatFinalStreamToolCallsWithStableIDs(calls []toolcall.ParsedToolCall, ids map[int]string, toolsRaw any) []map[string]any {
if len(calls) == 0 {
return nil
}
normalizedCalls := toolcall.NormalizeParsedToolCallsForSchemas(calls, toolsRaw)
out := make([]map[string]any, 0, len(calls))
for i, c := range calls {
for i, c := range normalizedCalls {
callID := ""
if ids != nil {
callID = strings.TrimSpace(ids[i])