Skip to content
Closed
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
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,21 @@ Add the plugin to your `opencode.json` or `opencode.jsonc`:
"max": { "thinkingConfig": { "thinkingBudget": 32768 } }
}
},
"claude-opus-5": {
"name": "Claude Opus 5",
"limit": { "context": 1000000, "output": 64000 },
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
},
"claude-opus-5-thinking": {
"name": "Claude Opus 5 Thinking",
"limit": { "context": 1000000, "output": 64000 },
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
"variants": {
"low": { "thinkingConfig": { "thinkingBudget": 8192 } },
"medium": { "thinkingConfig": { "thinkingBudget": 16384 } },
"max": { "thinkingConfig": { "thinkingBudget": 32768 } }
}
},
"claude-sonnet-4-5-1m": {
"name": "Claude Sonnet 4.5 (1M Context)",
"limit": { "context": 1000000, "output": 64000 },
Expand Down
8 changes: 7 additions & 1 deletion src/__tests__/effort.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ describe('effort module', () => {
expect(supportsEffort('claude-sonnet-4.6-1m')).toBe(true)
expect(supportsEffort('claude-sonnet-5')).toBe(true)
expect(supportsEffort('claude-sonnet-5-1m')).toBe(true)
expect(supportsEffort('claude-opus-5')).toBe(true)
})

test('returns false for unsupported models', () => {
Expand All @@ -25,9 +26,10 @@ describe('effort module', () => {
})

describe('supportsXHighEffort', () => {
test('returns true for opus 4.7 and 4.8', () => {
test('returns true for opus 4.7, 4.8 and 5', () => {
expect(supportsXHighEffort('claude-opus-4.8')).toBe(true)
expect(supportsXHighEffort('claude-opus-4.7')).toBe(true)
expect(supportsXHighEffort('claude-opus-5')).toBe(true)
})

test('returns false for other models', () => {
Expand All @@ -45,6 +47,8 @@ describe('effort module', () => {
expect(resolveEffort('claude-opus-4.8', 'low')).toBe('low')
expect(resolveEffort('claude-opus-4.8', 'max')).toBe('max')
expect(resolveEffort('claude-opus-4.8', 'xhigh')).toBe('xhigh')
expect(resolveEffort('claude-opus-5', 'xhigh')).toBe('xhigh')
expect(resolveEffort('claude-opus-5', 'max')).toBe('max')
})

test('clamps xhigh to max for models without xhigh support', () => {
Expand Down Expand Up @@ -88,6 +92,8 @@ describe('effort module', () => {
test('uses budget mapping when thinking and auto-mapping enabled', () => {
expect(getEffectiveEffort('claude-opus-4.8', true, 128000, undefined, true)).toBe('max')
expect(getEffectiveEffort('claude-opus-4.8', true, 20000, undefined, true)).toBe('medium')
expect(getEffectiveEffort('claude-opus-5', true, 32768, undefined, true)).toBe('max')
expect(getEffectiveEffort('claude-opus-5', true, 8192, undefined, true)).toBe('low')
})

test('falls back to medium when auto-mapping disabled', () => {
Expand Down
2 changes: 2 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ export const MODEL_MAPPING: Record<string, string> = {
'claude-opus-4-7-thinking': 'claude-opus-4.7',
'claude-opus-4-8': 'claude-opus-4.8',
'claude-opus-4-8-thinking': 'claude-opus-4.8',
'claude-opus-5': 'claude-opus-5',
'claude-opus-5-thinking': 'claude-opus-5',
// Auto
auto: 'auto',
// Open weight models
Expand Down
2 changes: 1 addition & 1 deletion src/plugin/effort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const EFFORT_LEVELS: readonly Effort[] = ['low', 'medium', 'high', 'xhigh
* Models that support the 5-value effort enum (including xhigh).
* These models support up to 128k thinking tokens with max effort.
*/
const XHIGH_CAPABLE_MODELS = new Set(['claude-opus-4.7', 'claude-opus-4.8'])
const XHIGH_CAPABLE_MODELS = new Set(['claude-opus-4.7', 'claude-opus-4.8', 'claude-opus-5'])

/**
* Models that support the 4-value effort enum (no xhigh).
Expand Down