diff --git a/.changeset/max-reasoning-effort.md b/.changeset/max-reasoning-effort.md new file mode 100644 index 000000000..842673e4c --- /dev/null +++ b/.changeset/max-reasoning-effort.md @@ -0,0 +1,5 @@ +--- +'@bradygaster/squad-sdk': patch +--- + +Add `"max"` as a valid `SquadReasoningEffort` level to match the Copilot SDK 1.0.9 addition of `ReasoningEffort = "max"`. Unblocks Dependabot PR #1671. diff --git a/packages/squad-sdk/src/adapter/types.ts b/packages/squad-sdk/src/adapter/types.ts index 7a2b14657..5d5e37a55 100644 --- a/packages/squad-sdk/src/adapter/types.ts +++ b/packages/squad-sdk/src/adapter/types.ts @@ -766,7 +766,7 @@ export interface SquadInfiniteSessionConfig { * re-declaring the union inline. The runtime list lives in config/models.ts as * `VALID_REASONING_EFFORTS` (kept in sync via `satisfies`). */ -export type SquadReasoningEffort = "low" | "medium" | "high" | "xhigh"; +export type SquadReasoningEffort = "low" | "medium" | "high" | "xhigh" | "max"; /** * Valid context tiers (context-window sizes) for models that support them. diff --git a/packages/squad-sdk/src/config/models.ts b/packages/squad-sdk/src/config/models.ts index 705fa6e3a..a6c4a6e5f 100644 --- a/packages/squad-sdk/src/config/models.ts +++ b/packages/squad-sdk/src/config/models.ts @@ -817,7 +817,7 @@ export function writeAgentModelOverrides( * Canonical runtime list — import this instead of duplicating. The `satisfies` * clause keeps it in lock-step with the canonical {@link SquadReasoningEffort} type. */ -export const VALID_REASONING_EFFORTS = ['low', 'medium', 'high', 'xhigh'] as const satisfies readonly SquadReasoningEffort[]; +export const VALID_REASONING_EFFORTS = ['low', 'medium', 'high', 'xhigh', 'max'] as const satisfies readonly SquadReasoningEffort[]; /** Canonical reasoning-effort union (alias of {@link SquadReasoningEffort}). */ export type ValidReasoningEffort = SquadReasoningEffort; const VALID_REASONING_EFFORTS_WITH_AUTO: readonly string[] = [...VALID_REASONING_EFFORTS, 'auto']; diff --git a/test/model-preference.test.ts b/test/model-preference.test.ts index 60a69526f..691791b56 100644 --- a/test/model-preference.test.ts +++ b/test/model-preference.test.ts @@ -463,6 +463,13 @@ describe('writeReasoningEffort', () => { const raw = JSON.parse(readFileSync(join(squadDir, 'config.json'), 'utf-8')); expect(raw).not.toHaveProperty('defaultReasoningEffort'); }); + + it('accepts max as a valid effort level', () => { + writeReasoningEffort(squadDir, 'max'); + const raw = JSON.parse(readFileSync(join(squadDir, 'config.json'), 'utf-8')); + expect(raw.defaultReasoningEffort).toBe('max'); + expect(readReasoningEffort(squadDir)).toBe('max'); + }); }); // ============================================================================ @@ -641,6 +648,16 @@ describe('clampReasoningEffort', () => { it('treats max and xhigh as equivalent', () => { // xhigh requested, model supports max expect(clampReasoningEffort('xhigh', ['low', 'medium', 'high', 'max'])).toBe('xhigh'); + // max requested, model supports xhigh + expect(clampReasoningEffort('max', ['low', 'medium', 'high', 'xhigh'])).toBe('xhigh'); + }); + + it('passes through max when model directly supports max', () => { + expect(clampReasoningEffort('max', ['low', 'medium', 'high', 'max'])).toBe('max'); + }); + + it('clamps max to xhigh for models that use that name at the top tier', () => { + expect(clampReasoningEffort('max', ['low', 'medium', 'high', 'xhigh'])).toBe('xhigh'); }); it('returns undefined for unrecognized effort value', () => {