feat(session,llm): restore session runtime on resume; align Responses API details
This commit is contained in:
@@ -441,3 +441,39 @@ providers:
|
||||
t.Fatalf("err = %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoadDefaultsThinkingParamByAPIType(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
t.Setenv("AGENTU_TEST_KEY", "sk-test")
|
||||
path := filepath.Join(dir, "agentu.yaml")
|
||||
if err := os.WriteFile(path, []byte(`
|
||||
providers:
|
||||
chat:
|
||||
api_type: chat
|
||||
base_url: https://chat.example.com
|
||||
api_key: ${AGENTU_TEST_KEY}
|
||||
models:
|
||||
- id: chat-model
|
||||
thinking: none
|
||||
responses:
|
||||
api_type: responses
|
||||
base_url: https://responses.example.com
|
||||
api_key: ${AGENTU_TEST_KEY}
|
||||
models:
|
||||
- id: responses-model
|
||||
thinking: high
|
||||
`), 0o644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
cfg, err := Load(path)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if got := cfg.Providers["chat"].ThinkingParam; got != "thinking" {
|
||||
t.Fatalf("chat thinking param = %q, want %q", got, "thinking")
|
||||
}
|
||||
if got := cfg.Providers["responses"].ThinkingParam; got != "reasoning" {
|
||||
t.Fatalf("responses thinking param = %q, want %q", got, "reasoning")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user