TestPrepareUserMessage_CommandResolution tests that commands are resolved correctly before agent switching.
(t *testing.T)
| 460 | // TestPrepareUserMessage_CommandResolution tests that commands are resolved |
| 461 | // correctly before agent switching. |
| 462 | func TestPrepareUserMessage_CommandResolution(t *testing.T) { |
| 463 | t.Parallel() |
| 464 | |
| 465 | rt := &mockRuntimeWithOverrides{ |
| 466 | mockRuntime: &mockRuntime{}, |
| 467 | } |
| 468 | rt.currentAgentInfoFn = func(context.Context) runtime.CurrentAgentInfo { |
| 469 | return runtime.CurrentAgentInfo{ |
| 470 | Name: "test", |
| 471 | Commands: map[string]types.Command{ |
| 472 | "fix": { |
| 473 | Instruction: "Fix the file ${args[0]}", |
| 474 | }, |
| 475 | }, |
| 476 | } |
| 477 | } |
| 478 | |
| 479 | msg, _, err := PrepareUserMessage(t.Context(), rt, "/fix main.go", "") |
| 480 | assert.NilError(t, err) |
| 481 | |
| 482 | assert.Equal(t, "Fix the file main.go", msg.Message.Content, "Command should be resolved with args") |
| 483 | } |
nothing calls this directly
no test coverage detected