feat: update Claude model to Opus 4.6 and enhance adaptive thinking support

- Changed model identifier from `claude-opus-4-5-20251101` to `claude-opus-4-6` across various files, including documentation and code references.
- Updated the SDK to support adaptive thinking for Opus 4.6, allowing the model to determine its own reasoning depth.
- Enhanced the thinking level options to include 'adaptive' and adjusted related components to reflect this change.
- Updated tests to ensure compatibility with the new model and its features.

These changes improve the model's capabilities and user experience by leveraging adaptive reasoning.
This commit is contained in:
Kacper
2026-02-05 22:43:22 +01:00
parent 3b361cb0b9
commit 835ffe3185
25 changed files with 178 additions and 71 deletions

View File

@@ -30,15 +30,15 @@ const model2 = resolveModelString('haiku');
// Returns: 'claude-haiku-4-5'
const model3 = resolveModelString('opus');
// Returns: 'claude-opus-4-5-20251101'
// Returns: 'claude-opus-4-6'
// Use with custom default
const model4 = resolveModelString(undefined, 'claude-sonnet-4-20250514');
// Returns: 'claude-sonnet-4-20250514' (default)
// Direct model ID passthrough
const model5 = resolveModelString('claude-opus-4-5-20251101');
// Returns: 'claude-opus-4-5-20251101' (unchanged)
const model5 = resolveModelString('claude-opus-4-6');
// Returns: 'claude-opus-4-6' (unchanged)
```
### Get Effective Model
@@ -72,7 +72,7 @@ console.log(DEFAULT_MODELS.chat); // 'claude-sonnet-4-20250514'
// Model alias mappings
console.log(CLAUDE_MODEL_MAP.haiku); // 'claude-haiku-4-5'
console.log(CLAUDE_MODEL_MAP.sonnet); // 'claude-sonnet-4-20250514'
console.log(CLAUDE_MODEL_MAP.opus); // 'claude-opus-4-5-20251101'
console.log(CLAUDE_MODEL_MAP.opus); // 'claude-opus-4-6'
```
## Usage Example
@@ -103,7 +103,7 @@ const feature: Feature = {
};
prepareFeatureExecution(feature);
// Output: Executing feature with model: claude-opus-4-5-20251101
// Output: Executing feature with model: claude-opus-4-6
```
## Supported Models
@@ -112,7 +112,7 @@ prepareFeatureExecution(feature);
- `haiku``claude-haiku-4-5`
- `sonnet``claude-sonnet-4-20250514`
- `opus``claude-opus-4-5-20251101`
- `opus``claude-opus-4-6`
### Model Selection Guide

View File

@@ -484,12 +484,12 @@ describe('model-resolver', () => {
it('should handle full Claude model string in entry', () => {
const entry: PhaseModelEntry = {
model: 'claude-opus-4-5-20251101',
model: 'claude-opus-4-6',
thinkingLevel: 'high',
};
const result = resolvePhaseModel(entry);
expect(result.model).toBe('claude-opus-4-5-20251101');
expect(result.model).toBe('claude-opus-4-6');
expect(result.thinkingLevel).toBe('high');
});
});

View File

@@ -196,6 +196,8 @@ export {
PROJECT_SETTINGS_VERSION,
THINKING_TOKEN_BUDGET,
getThinkingTokenBudget,
isAdaptiveThinkingModel,
getThinkingLevelsForModel,
// Event hook constants
EVENT_HOOK_TRIGGER_LABELS,
// Claude-compatible provider templates (new)

View File

@@ -149,6 +149,7 @@ export const THINKING_LEVELS: ThinkingLevelOption[] = [
{ id: 'medium', label: 'Medium' },
{ id: 'high', label: 'High' },
{ id: 'ultrathink', label: 'Ultrathink' },
{ id: 'adaptive', label: 'Adaptive' },
];
/**
@@ -162,6 +163,7 @@ export const THINKING_LEVEL_LABELS: Record<ThinkingLevel, string> = {
medium: 'Med',
high: 'High',
ultrathink: 'Ultra',
adaptive: 'Adaptive',
};
/**

View File

@@ -18,7 +18,7 @@ export type ClaudeCanonicalId = 'claude-haiku' | 'claude-sonnet' | 'claude-opus'
export const CLAUDE_CANONICAL_MAP: Record<ClaudeCanonicalId, string> = {
'claude-haiku': 'claude-haiku-4-5-20251001',
'claude-sonnet': 'claude-sonnet-4-5-20250929',
'claude-opus': 'claude-opus-4-5-20251101',
'claude-opus': 'claude-opus-4-6',
} as const;
/**
@@ -29,7 +29,7 @@ export const CLAUDE_CANONICAL_MAP: Record<ClaudeCanonicalId, string> = {
export const CLAUDE_MODEL_MAP: Record<string, string> = {
haiku: 'claude-haiku-4-5-20251001',
sonnet: 'claude-sonnet-4-5-20250929',
opus: 'claude-opus-4-5-20251101',
opus: 'claude-opus-4-6',
} as const;
/**
@@ -99,7 +99,7 @@ export function getAllCodexModelIds(): CodexModelId[] {
* Uses canonical prefixed IDs for consistent routing.
*/
export const DEFAULT_MODELS = {
claude: 'claude-opus-4-5-20251101',
claude: 'claude-opus-4-6',
cursor: 'cursor-auto', // Cursor's recommended default (with prefix)
codex: CODEX_MODEL_MAP.gpt52Codex, // GPT-5.2-Codex is the most advanced agentic coding model
} as const;

View File

@@ -213,7 +213,7 @@ export type PlanningMode = 'skip' | 'lite' | 'spec' | 'full';
export type ServerLogLevel = 'error' | 'warn' | 'info' | 'debug';
/** ThinkingLevel - Extended thinking levels for Claude models (reasoning intensity) */
export type ThinkingLevel = 'none' | 'low' | 'medium' | 'high' | 'ultrathink';
export type ThinkingLevel = 'none' | 'low' | 'medium' | 'high' | 'ultrathink' | 'adaptive';
/**
* SidebarStyle - Sidebar layout style options
@@ -237,6 +237,7 @@ export const THINKING_TOKEN_BUDGET: Record<ThinkingLevel, number | undefined> =
medium: 10000, // Light reasoning
high: 16000, // Complex tasks (recommended starting point)
ultrathink: 32000, // Maximum safe (above this risks timeouts)
adaptive: undefined, // Adaptive thinking (Opus 4.6) - SDK handles token allocation
};
/**
@@ -247,6 +248,26 @@ export function getThinkingTokenBudget(level: ThinkingLevel | undefined): number
return THINKING_TOKEN_BUDGET[level];
}
/**
* Check if a model uses adaptive thinking (Opus 4.6+)
* Adaptive thinking models let the SDK decide token allocation automatically.
*/
export function isAdaptiveThinkingModel(model: string): boolean {
return model.includes('opus-4-6') || model === 'claude-opus';
}
/**
* Get the available thinking levels for a given model.
* - Opus 4.6: Only 'none' and 'adaptive' (SDK handles token allocation)
* - Others: Full range of manual thinking levels
*/
export function getThinkingLevelsForModel(model: string): ThinkingLevel[] {
if (isAdaptiveThinkingModel(model)) {
return ['none', 'adaptive'];
}
return ['none', 'low', 'medium', 'high', 'ultrathink'];
}
/** ModelProvider - AI model provider for credentials and API key management */
export type ModelProvider = 'claude' | 'cursor' | 'codex' | 'opencode' | 'gemini' | 'copilot';