test: verify model actually reaches provider in WithModel test
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
1b96f79577
commit
d48044e3fb
1 changed files with 5 additions and 0 deletions
|
|
@ -12,6 +12,7 @@ import (
|
||||||
// MockLLMProvider is a test implementation of LLMProvider
|
// MockLLMProvider is a test implementation of LLMProvider
|
||||||
type MockLLMProvider struct {
|
type MockLLMProvider struct {
|
||||||
lastOptions map[string]any
|
lastOptions map[string]any
|
||||||
|
lastModel string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *MockLLMProvider) Chat(
|
func (m *MockLLMProvider) Chat(
|
||||||
|
|
@ -22,6 +23,7 @@ func (m *MockLLMProvider) Chat(
|
||||||
options map[string]any,
|
options map[string]any,
|
||||||
) (*providers.LLMResponse, error) {
|
) (*providers.LLMResponse, error) {
|
||||||
m.lastOptions = options
|
m.lastOptions = options
|
||||||
|
m.lastModel = model
|
||||||
// Find the last user message to generate a response
|
// Find the last user message to generate a response
|
||||||
for i := len(messages) - 1; i >= 0; i-- {
|
for i := len(messages) - 1; i >= 0; i-- {
|
||||||
if messages[i].Role == "user" {
|
if messages[i].Role == "user" {
|
||||||
|
|
@ -381,6 +383,9 @@ func TestSubagentTool_Execute_WithModel(t *testing.T) {
|
||||||
if result.IsError {
|
if result.IsError {
|
||||||
t.Errorf("Expected success, got error: %s", result.ForLLM)
|
t.Errorf("Expected success, got error: %s", result.ForLLM)
|
||||||
}
|
}
|
||||||
|
if provider.lastModel != "custom-model" {
|
||||||
|
t.Errorf("expected model 'custom-model', got %q", provider.lastModel)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSubagentTool_Execute_WithInvalidModel(t *testing.T) {
|
func TestSubagentTool_Execute_WithInvalidModel(t *testing.T) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue