Skip to content

Commit f592e48

Browse files
remote-swe-userremote-swe-app[bot]
andauthored
Add support for Claude Opus 4.1 model (#302)
## Description This PR adds support for the Claude Opus 4.1 model (model ID: `us.anthropic.claude-opus-4-1-20250805-v1:0`). ## Changes - Added `'opus4.1'` to the model type enum in `modelTypeSchema` - Added configuration for Opus 4.1 in `modelConfigs` based on existing Opus 4 settings - Added case for Opus 4.1 in `chooseModelAndRegion` function with the specified model ID ## Testing No changes to default behavior. The model can now be selected as an available option when choosing models. ## Notes The configuration for Opus 4.1 is based on the existing Opus 4 configuration, as specified in the requirements. <!-- DO NOT EDIT: System generated metadata --> <!-- WORKER_ID:webapp-1754626803463 --> --- **Open in Web UI**: https://d2c09i1k2ray87.cloudfront.net/sessions/webapp-1754626803463 --------- Co-authored-by: remote-swe-app[bot] <123456+remote-swe-app[bot]@users.noreply.github.com>
1 parent 3497a5f commit f592e48

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

packages/agent-core/src/lib/converse.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,16 @@ const ULTRA_THINKING_KEYWORD = 'ultrathink';
2222

2323
const defaultOutputTokenCount = 8192;
2424

25-
const modelTypeSchema = z.enum(['sonnet3.5v1', 'sonnet3.5', 'sonnet3.7', 'haiku3.5', 'nova-pro', 'opus4', 'sonnet4']);
25+
const modelTypeSchema = z.enum([
26+
'sonnet3.5v1',
27+
'sonnet3.5',
28+
'sonnet3.7',
29+
'haiku3.5',
30+
'nova-pro',
31+
'opus4',
32+
'opus4.1',
33+
'sonnet4',
34+
]);
2635
type ModelType = z.infer<typeof modelTypeSchema>;
2736

2837
const modelConfigSchema = z.object({
@@ -69,6 +78,13 @@ const modelConfigs: Record<ModelType, Partial<z.infer<typeof modelConfigSchema>>
6978
reasoningSupport: true,
7079
toolChoiceSupport: ['any', 'auto', 'tool'],
7180
},
81+
'opus4.1': {
82+
maxOutputTokens: 32_000,
83+
maxInputTokens: 200_000,
84+
cacheSupport: ['system', 'message', 'tool'],
85+
reasoningSupport: true,
86+
toolChoiceSupport: ['any', 'auto', 'tool'],
87+
},
7288
sonnet4: {
7389
maxOutputTokens: 64_000,
7490
maxInputTokens: 200_000,
@@ -293,6 +309,9 @@ const chooseModelAndRegion = (modelType: ModelType) => {
293309
case 'opus4':
294310
modelId = 'anthropic.claude-opus-4-20250514-v1:0';
295311
break;
312+
case 'opus4.1':
313+
modelId = 'anthropic.claude-opus-4-1-20250805-v1:0';
314+
break;
296315
case 'sonnet4':
297316
modelId = 'anthropic.claude-sonnet-4-20250514-v1:0';
298317
break;

0 commit comments

Comments
 (0)