diff options
| author | adamdottv <[email protected]> | 2025-06-19 13:56:02 -0500 |
|---|---|---|
| committer | adamdottv <[email protected]> | 2025-06-19 13:56:09 -0500 |
| commit | 72108c02964f1e1309e5192e081f44643f3a0c17 (patch) | |
| tree | 9415f91d3f63d7664576830f76f85cb14130f79a /packages/tui/internal/components | |
| parent | ec1c9f8cd14e2359816dbe0a9003e244023a0b53 (diff) | |
| download | opencode-72108c02964f1e1309e5192e081f44643f3a0c17.tar.gz opencode-72108c02964f1e1309e5192e081f44643f3a0c17.zip | |
fix(tui): sorted tool arg maps
Diffstat (limited to 'packages/tui/internal/components')
| -rw-r--r-- | packages/tui/internal/components/chat/message.go | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/packages/tui/internal/components/chat/message.go b/packages/tui/internal/components/chat/message.go index 0176e49b6..3fa013e3b 100644 --- a/packages/tui/internal/components/chat/message.go +++ b/packages/tui/internal/components/chat/message.go @@ -305,14 +305,15 @@ func renderToolInvocation( toolArgsMap := make(map[string]any) if toolCall.Args != nil { value := *toolCall.Args - m, ok := value.(map[string]any) - if ok { + if m, ok := value.(map[string]any); ok { toolArgsMap = m + firstKey := "" for key := range toolArgsMap { firstKey = key break } + toolArgs = renderArgs(&toolArgsMap, firstKey) } } @@ -589,9 +590,17 @@ func renderArgs(args *map[string]any, titleKey string) string { if args == nil || len(*args) == 0 { return "" } + + keys := make([]string, 0, len(*args)) + for key := range *args { + keys = append(keys, key) + } + slices.Sort(keys) + title := "" parts := []string{} - for key, value := range *args { + for _, key := range keys { + value := (*args)[key] if value == nil { continue } |
