| 226 | } |
| 227 | } |
| 228 | |
| 229 | func TestExecuteBashWrapsResult(t *testing.T) { |
| 230 | call := chmctx.ToolCall{ |
| 231 | ID: "call_1", Name: "bash", |
| 232 | Arguments: map[string]any{"cmd": "echo hi"}, |
| 233 | } |
| 234 | msg := Execute(context.Background(), call) |
| 235 | if msg.Role != chmctx.RoleTool || msg.ToolCallID != "call_1" || msg.ToolName != "bash" { |
| 236 | t.Fatalf("bad message: %+v", msg) |
| 237 | } |
| 238 | if !strings.Contains(msg.Content, "hi") { |
| 239 | t.Fatalf("content missing: %q", msg.Content) |
| 240 | } |
| 241 | } |
| 242 | |
| 243 | func TestExecuteUnknownTool(t *testing.T) { |