feat: add claude-opus-4-6[1m] model with 1M context window (#288)

Add the 1M context variant of Claude Opus 4.6 to the model registry
and fix model resolver to try exact match before glob detection, so
model IDs containing bracket characters (like [1m]) are not
misinterpreted as glob patterns.
This commit is contained in:
Juan Francisco Lebrero 2026-03-13 19:25:45 -03:00 committed by GitHub
parent d23b77ff32
commit 5ff362ed0e
2 changed files with 29 additions and 0 deletions

View file

@ -1724,6 +1724,23 @@ export const MODELS = {
contextWindow: 200000,
maxTokens: 128000,
} satisfies Model<"anthropic-messages">,
"claude-opus-4-6[1m]": {
id: "claude-opus-4-6[1m]",
name: "Claude Opus 4.6 (1M)",
api: "anthropic-messages",
provider: "anthropic",
baseUrl: "https://api.anthropic.com",
reasoning: true,
input: ["text", "image"],
cost: {
input: 5,
output: 25,
cacheRead: 0.5,
cacheWrite: 6.25,
},
contextWindow: 1000000,
maxTokens: 128000,
} satisfies Model<"anthropic-messages">,
"claude-sonnet-4-0": {
id: "claude-sonnet-4-0",
name: "Claude Sonnet 4 (latest)",

View file

@ -214,6 +214,18 @@ export async function resolveModelScope(patterns: string[], modelRegistry: Model
const scopedModels: ScopedModel[] = [];
for (const pattern of patterns) {
// Try exact match first (handles model IDs containing glob chars like [1m])
const exactResult = parseModelPattern(pattern, availableModels);
if (exactResult.model) {
if (exactResult.warning) {
console.warn(chalk.yellow(`Warning: ${exactResult.warning}`));
}
if (!scopedModels.find((sm) => modelsAreEqual(sm.model, exactResult.model!))) {
scopedModels.push({ model: exactResult.model, thinkingLevel: exactResult.thinkingLevel });
}
continue;
}
// Check if pattern contains glob characters
if (pattern.includes("*") || pattern.includes("?") || pattern.includes("[")) {
// Extract optional thinking level suffix (e.g., "provider/*:high")