fix: skip thinking param injection for GLM models in sisyphus-junior (#2967)
GLM-5 has native reasoning built-in. Injecting thinking: {type: 'enabled'}
causes a param conflict (400 error). Add isGlmModel() check to return base
config without thinking/reasoningEffort for GLM models.
- Add isGlmModel() helper to types.ts
- Early return in createSisyphusJuniorAgentWithOverrides for GLM models
- Add tests for isGlmModel and GLM reasoning config behavior
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { describe, test, expect } from "bun:test";
|
||||
import { isGptModel, isGeminiModel, isGpt5_4Model, isMiniMaxModel } from "./types";
|
||||
import { isGptModel, isGeminiModel, isGlmModel, isGpt5_4Model, isMiniMaxModel } from "./types";
|
||||
|
||||
describe("isGpt5_4Model", () => {
|
||||
test("detects gpt-5.4 models", () => {
|
||||
@@ -101,6 +101,26 @@ describe("isMiniMaxModel", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("isGlmModel", () => {
|
||||
test("#given GLM models with provider prefix #then returns true", () => {
|
||||
expect(isGlmModel("z-ai/glm-5")).toBe(true);
|
||||
expect(isGlmModel("opencode/glm-5")).toBe(true);
|
||||
expect(isGlmModel("opencode-go/glm-5-turbo")).toBe(true);
|
||||
expect(isGlmModel("opencode/glm-4.6v")).toBe(true);
|
||||
});
|
||||
|
||||
test("#given GLM models without provider prefix #then returns true", () => {
|
||||
expect(isGlmModel("glm-5")).toBe(true);
|
||||
expect(isGlmModel("glm-5-turbo")).toBe(true);
|
||||
});
|
||||
|
||||
test("#given non-GLM models #then returns false", () => {
|
||||
expect(isGlmModel("openai/gpt-5.4")).toBe(false);
|
||||
expect(isGlmModel("anthropic/claude-opus-4-6")).toBe(false);
|
||||
expect(isGlmModel("google/gemini-3.1-pro")).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("isGeminiModel", () => {
|
||||
test("#given google provider models #then returns true", () => {
|
||||
expect(isGeminiModel("google/gemini-3.1-pro")).toBe(true);
|
||||
|
||||
Reference in New Issue
Block a user