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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This repo is a CortexKit-maintained Anthropic auth monorepo for OpenCode and Pi.

## Unreleased

- Adds Claude Fable 5.2 (`claude-fable-5-2`) on OpenCode 1, OpenCode 2 and Pi, sent the way Claude Code sends it: adaptive thinking, medium default effort, per-message effort and Anthropic's safety fallback. Fast mode stays off for Fable 5.2 until Anthropic enables it for subscription accounts.
- Claude subscription requests no longer carry a `service_tier` field a host adds, keeping them in the shape Claude Code sends; API-key requests keep it.
## 2.7.3

Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/mid-conversation-output-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function usesPerTurnControl(model: unknown): boolean {

/**
* Models whose OAuth requests carry `PER_TURN_CONTROL_BETA`: those whose
* Claude Code main beta list includes it (Opus 5.5, Sonnet 5.5, Fable 5.1 and
* Claude Code main beta list includes it (Opus 5.5, Sonnet 5.5, Fable 5.1/5.2 and
* Haiku 5.5 in Claude Code 2.1.302). Sending the beta does not by itself make
* a model eligible for effort markers; `supportsPerMessageEffort` decides that.
*/
Expand All @@ -69,7 +69,7 @@ export function sendsPerTurnControlBeta(model: unknown): boolean {
/**
* Whether a request may move effort changes into empty system messages.
*
* Models with `effortMarkers: "always"` (Fable 5.1) are always eligible,
* Models with `effortMarkers: "always"` (Fable 5.1/5.2) are always eligible,
* whatever the thinking field says. Models with `"with-adaptive-thinking"`
* (Opus 5.5, Sonnet 5.5) qualify only with adaptive thinking: Anthropic
* rejects a differing per-message effort with HTTP 400 on Sonnet 5.5
Expand Down Expand Up @@ -135,7 +135,7 @@ export function applyMidConversationOutputConfig(
}

const compacted = compactTransitions(transitions)
// Models with `effortMarkers: "always"` (Fable 5.1) always pin top-level
// Models with `effortMarkers: "always"` (Fable 5.1/5.2) always pin top-level
// effort. The other models leave a request without an effort change exactly
// as the host built it.
const pinsEveryRequest = pinsEffortOnEveryRequest(body.model)
Expand Down
35 changes: 35 additions & 0 deletions packages/core/src/model-capabilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ export type ClaudeModelCatalogue = {
export type ClaudeRefusalRecoveryFamily =
| 'fable-5'
| 'fable-5-1'
| 'fable-5-2'
| 'opus-5'
| 'opus-5-5'

Expand Down Expand Up @@ -246,6 +247,20 @@ const FABLE_MYTHOS_5_1_CATALOGUE: ClaudeModelCatalogue = {
},
}

const FABLE_5_2_CATALOGUE: ClaudeModelCatalogue = {
releaseDate: '2026-11-09',
contextWindow: 1_000_000,
maxOutputTokens: 128_000,
pricing: {
input: 8,
output: 40,
// Anthropic's Claude Fable 5.2 model page lists cache reads at $0.20/M.
cacheRead: 0.2,
cacheWrite5m: 10,
cacheWrite1h: 16,
},
}

export const CLAUDE_MODEL_CAPABILITIES: readonly ClaudeModelCapabilities[] = [
{
id: 'claude-fable-5',
Expand Down Expand Up @@ -319,6 +334,26 @@ export const CLAUDE_MODEL_CAPABILITIES: readonly ClaudeModelCapabilities[] = [
scopedQuota: 'mythos',
fastMode: false,
},
{
id: 'claude-fable-5-2',
name: 'Claude Fable 5.2',
family: 'fable',
idSuffixes: 'any',
catalogue: FABLE_5_2_CATALOGUE,
thinkingModes: ['adaptive'],
rejectsForcedToolChoice: true,
efforts: { variants: ALL_ADAPTIVE_EFFORTS, default: 'medium' },
effortMarkers: 'always',
turnEndNote: true,
thinkingBindingControls: true,
claudeCodeBetas: claudeCodeBetaLists({ perTurnControl: true }),
serverSideFallback: true,
refusalRecoveryFamily: 'fable-5-2',
scopedQuota: 'fable',
// Claude Code's runtime capability list for 5.2 lacks fast_mode today, so
// we don't send speed: fast until a real request proves subscription accounts accept it.
fastMode: false,
},
{
id: 'claude-opus-5',
name: 'Claude Opus 5',
Expand Down
13 changes: 10 additions & 3 deletions packages/core/src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export { normalizeAnthropicModelId }
export const CLAUDE_FABLE_5_MODEL_ID = 'claude-fable-5'
export const CLAUDE_MYTHOS_5_MODEL_ID = 'claude-mythos-5'
export const CLAUDE_FABLE_5_1_MODEL_ID = 'claude-fable-5-1'
export const CLAUDE_FABLE_5_2_MODEL_ID = 'claude-fable-5-2'
export const CLAUDE_MYTHOS_5_1_MODEL_ID = 'claude-mythos-5-1'

/**
Expand Down Expand Up @@ -43,6 +44,7 @@ export const CLAUDE_FABLE_MYTHOS_5_MODEL_IDS = [
CLAUDE_FABLE_5_MODEL_ID,
CLAUDE_MYTHOS_5_MODEL_ID,
...CLAUDE_FABLE_MYTHOS_5_1_MODEL_IDS,
CLAUDE_FABLE_5_2_MODEL_ID,
] as const

export type ClaudeFableMythos5ModelId =
Expand All @@ -55,9 +57,12 @@ export const CLAUDE_FABLE_MYTHOS_5_SUMMARIZED_THINKING = {

const FABLE_5_CATALOGUE = getClaudeModelCatalogue(CLAUDE_FABLE_5_MODEL_ID)
const FABLE_5_1_CATALOGUE = getClaudeModelCatalogue(CLAUDE_FABLE_5_1_MODEL_ID)
const FABLE_5_2_CATALOGUE = getClaudeModelCatalogue(CLAUDE_FABLE_5_2_MODEL_ID)

export const CLAUDE_FABLE_MYTHOS_5_PRICING = FABLE_5_CATALOGUE.pricing
export const CLAUDE_FABLE_MYTHOS_5_1_PRICING = FABLE_5_1_CATALOGUE.pricing
export const CLAUDE_FABLE_5_2_PRICING = FABLE_5_2_CATALOGUE.pricing
export const CLAUDE_FABLE_5_2_RELEASE_DATE = FABLE_5_2_CATALOGUE.releaseDate

export const CLAUDE_FABLE_MYTHOS_5_CONTEXT_WINDOW =
FABLE_5_CATALOGUE.contextWindow
Expand Down Expand Up @@ -118,9 +123,11 @@ export function isClaudeFable51Model(model: unknown) {
}

export function getClaudeFableMythos5ReleaseDate(model: unknown) {
return isClaudeFableOrMythos51Model(model)
? CLAUDE_FABLE_MYTHOS_5_1_RELEASE_DATE
: CLAUDE_FABLE_MYTHOS_5_RELEASE_DATE
const row = resolveClaudeModelCapabilities(model)
return (
(isFableOrMythosRow(row) && row?.catalogue?.releaseDate) ||
CLAUDE_FABLE_MYTHOS_5_RELEASE_DATE
)
}

export const CLAUDE_SONNET_5_MODEL_ID = 'claude-sonnet-5'
Expand Down
Loading
Loading