@@ -4,6 +4,8 @@ import (
|
4 | 4 | "context" |
5 | 5 | "encoding/json" |
6 | 6 | "iter" |
| 7 | +"maps" |
| 8 | +"slices" |
7 | 9 | |
8 | 10 | "github.com/sourcegraph/src-cli/internal/api" |
9 | 11 | |
@@ -71,9 +73,10 @@ func (r *ToolRegistry) CallTool(ctx context.Context, client api.Client, name str
|
71 | 73 | |
72 | 74 | // All returns an iterator that yields the name and Tool definition of all registered tools |
73 | 75 | func (r *ToolRegistry) All() iter.Seq2[string, *ToolDef] { |
| 76 | +keys := slices.Sorted(maps.Keys(r.tools)) |
74 | 77 | return func(yield func(string, *ToolDef) bool) { |
75 | | -for name, def := range r.tools { |
76 | | -if !yield(name, def) { |
| 78 | +for _, key := range keys { |
| 79 | +if !yield(key, r.tools[key]) { |
77 | 80 | return |
78 | 81 | } |
79 | 82 | } |
|