Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/max-reasoning-effort.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion packages/squad-sdk/src/adapter/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion packages/squad-sdk/src/config/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down
17 changes: 17 additions & 0 deletions test/model-preference.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
});

// ============================================================================
Expand Down Expand Up @@ -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', () => {
Expand Down