From c672db5406c8ec1991f83cb8d283e0101c896e82 Mon Sep 17 00:00:00 2001 From: Brady Gaster <41929050+bradygaster@users.noreply.github.com> Date: Wed, 12 Aug 2026 23:20:54 +0000 Subject: [PATCH] =?UTF-8?q?feat(sdk):=20add=20"max"=20to=20SquadReasoningE?= =?UTF-8?q?ffort=20=E2=80=94=20unblocks=20Dependabot=20PR=20#1671?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Copilot SDK 1.0.9 added ReasoningEffort = "max". Squad's SquadReasoningEffort type and VALID_REASONING_EFFORTS constant previously only permitted low|medium|high|xhigh, causing a type incompatibility when consuming the updated SDK. Changes: - adapter/types.ts: add "max" to SquadReasoningEffort union - config/models.ts: add "max" to VALID_REASONING_EFFORTS const (satisfies clause keeps it in sync with the type automatically) - Clamping logic (EFFORT_RANK, clampReasoningEffort) already handled max/xhigh equivalence — no changes needed - test/model-preference.test.ts: add 3 new tests for max as a first-class value Backwards compatible: existing callers using low/medium/high/xhigh are unaffected. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .changeset/max-reasoning-effort.md | 5 +++++ packages/squad-sdk/src/adapter/types.ts | 2 +- packages/squad-sdk/src/config/models.ts | 2 +- test/model-preference.test.ts | 17 +++++++++++++++++ 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 .changeset/max-reasoning-effort.md 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', () => {