Skip to content

Commit 3179b33

Browse files
committed
fix: failing CI tests
- TestConfigDefaultModel: update expected default model from 'deepseek-chat' to 'deepseek-v4-flash' to match the new default in odek.go (changed in 3d74ec3) - TestRunLearn_MultiStepProcedure / TestRunLearn_InteractiveReject: fix multiTurnServer mock to handle /models discovery endpoint. llm.DiscoverModelContext calls GET /models during agent init, consuming the first callCount and causing the first tool call (step 1) to be skipped — leaving only 3 tool calls instead of 4, which failed DetectMultiStepProcedure's len(calls) < 4 guard.
1 parent 02e1a5b commit 3179b33

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

cmd/odek/main_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,10 +1337,19 @@ func TestParseReplFlags_ExtraArgsIgnored(t *testing.T) {
13371337
// multiTurnServer returns an httptest server that simulates a multi-turn
13381338
// conversation: n terminal tool calls followed by a final text response.
13391339
// Each tool call executes echo step N (safe, no side effects).
1340+
// Handles /models discovery requests from llm.DiscoverModelContext.
13401341
func multiTurnServer(t *testing.T, terminalCalls int) *httptest.Server {
13411342
t.Helper()
13421343
callCount := 0
13431344
return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
1345+
w.Header().Set("Content-Type", "application/json")
1346+
1347+
// Handle /models discovery from llm.DiscoverModelContext
1348+
if strings.HasSuffix(r.URL.Path, "/models") {
1349+
w.Write([]byte(`{"object":"list","data":[{"id":"deepseek-v4-flash","context_window":131072}]}`))
1350+
return
1351+
}
1352+
13441353
callCount++
13451354
w.Header().Set("Content-Type", "application/json")
13461355
if callCount <= terminalCalls {

odek_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ func TestConfigDefaultModel(t *testing.T) {
4040
if err != nil {
4141
t.Fatal(err)
4242
}
43-
if agent.config.Model != "deepseek-chat" {
44-
t.Errorf("default model = %q, want %q", agent.config.Model, "deepseek-chat")
43+
if agent.config.Model != "deepseek-v4-flash" {
44+
t.Errorf("default model = %q, want %q", agent.config.Model, "deepseek-v4-flash")
4545
}
4646
}
4747

0 commit comments

Comments
 (0)