(t *testing.T)
| 394 | } |
| 395 | |
| 396 | func TestToolsetInstructions(t *testing.T) { |
| 397 | t.Setenv("OPENAI_API_KEY", "dummy") |
| 398 | |
| 399 | agentSource, err := config.Resolve("testdata/tool-instruction.yaml", nil) |
| 400 | require.NoError(t, err) |
| 401 | |
| 402 | team, err := Load(t.Context(), agentSource, &config.RuntimeConfig{}, withTestProviderRegistry()...) |
| 403 | require.NoError(t, err) |
| 404 | |
| 405 | agent, err := team.Agent("root") |
| 406 | require.NoError(t, err) |
| 407 | |
| 408 | toolsets := agent.ToolSets() |
| 409 | require.Len(t, toolsets, 1) |
| 410 | |
| 411 | instructions := tools.GetInstructions(toolsets[0]) |
| 412 | expected := "Dummy fetch tool instruction" |
| 413 | require.Equal(t, expected, instructions) |
| 414 | } |
| 415 | |
| 416 | // TestInstructionExpansion verifies that ${env.X} placeholders are expanded |
| 417 | // at load time both in agent.instruction and in toolsets[*].instruction. |
nothing calls this directly
no test coverage detected