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 dev-docs/specs/model-parameter-ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Runtime then maps preset id to provider request fields (`thinking` + `thinking.b

The Anthropic table must include all ids from `packages/core/src/models/anthropic.ts`:

- `claude-opus-4-8`
- `claude-opus-4-7`
- `claude-opus-4-6`
- `claude-opus-4-5`
Expand Down
5 changes: 3 additions & 2 deletions packages/core/src/models/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ The model list is a snapshot, so check the update date and review it regularly.
- Use `supportsFast: true` only for model ids that support the provider-specific fast path. Runtime maps that flag per provider (for example OpenAI priority service tier, Anthropic fast mode) and leaves unsupported models disabled even when `model.fast` is configured.
- A model is usable only when the effective spec has a positive context budget (`maxInputTokens` or `contextWindow`). If metadata can be missing for a new/latest model that should still work, put the required limits in the static `ModelSpec`.

## Anthropic Claude Opus 4.7
## Anthropic Claude Opus 4.8 / 4.7

- `claude-opus-4-8` is available in the static Anthropic registry with 1M context, 128k max output tokens, and Anthropic fast mode support.
- `claude-opus-4-7` is available in the static Anthropic registry with 1M context and 128k max output tokens.
- Anthropic Opus 4.7 uses adaptive thinking plus `output_config.effort`; do not route it through legacy extended thinking budget requests.
- Anthropic Opus 4.8 and 4.7 use adaptive thinking plus `output_config.effort`; do not route them through legacy extended thinking budget requests.

## OpenAI GPT-5.5

Expand Down
8 changes: 8 additions & 0 deletions packages/core/src/models/anthropic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ export const ANTHROPIC_MODELS: ModelSpec[] = [
provider: "anthropic",
aliases: ["default"],
},
{
id: "claude-opus-4-8",
provider: "anthropic",
contextWindow: 1_000_000,
maxInputTokens: 1_000_000,
maxOutputTokens: 128_000,
supportsFast: true,
},
{
id: "claude-opus-4-7",
provider: "anthropic",
Expand Down
14 changes: 13 additions & 1 deletion packages/runtime/src/model-reasoning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@ const ANTHROPIC_MAX_TOKENS_FALLBACK_HEADROOM = 4_096;
const ANTHROPIC_REASONING_MODEL_TABLE: Readonly<
Record<string, AnthropicReasoningModelProfile>
> = {
"claude-opus-4-8": {
supportedLevels: ["low", "medium", "high", "xhigh"],
budgetPresetByLevel: {
low: "reasoning_low",
medium: "reasoning_medium",
high: "reasoning_high",
xhigh: "reasoning_xhigh",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve xhigh effort for Opus 4.8

When users select model.reasoning=xhigh for this newly added Opus 4.8 profile, resolveAnthropicReasoning keeps applied as xhigh but the adaptive-thinking branch then calls toAnthropicOutputEffort, which converts xhigh to max. Anthropic documents xhigh and max as distinct accepted effort values for Claude Opus 4.8 (https://platform.claude.com/docs/en/build-with-claude/effort), so this makes Codelia's xhigh setting run at the more expensive/deeper max level rather than the requested intermediate level.

Useful? React with 👍 / 👎.

},
},
"claude-opus-4-7": {
supportedLevels: ["low", "medium", "high", "xhigh"],
budgetPresetByLevel: {
Expand Down Expand Up @@ -158,7 +167,10 @@ const ANTHROPIC_REASONING_MODEL_TABLE: Readonly<
},
};

const ANTHROPIC_ADAPTIVE_THINKING_MODELS = new Set<string>(["claude-opus-4-7"]);
const ANTHROPIC_ADAPTIVE_THINKING_MODELS = new Set<string>([
"claude-opus-4-8",
"claude-opus-4-7",
]);

const toAnthropicOutputEffort = (
level: CanonicalReasoningLevel,
Expand Down
7 changes: 7 additions & 0 deletions packages/runtime/tests/model-fast.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ describe("model fast mode resolution", () => {
});

test("enables Anthropic fast mode for supported models only", () => {
expect(
resolveFastMode({
provider: "anthropic",
model: "claude-opus-4-8",
requested: true,
}),
).toEqual({ enabled: true, provider: "anthropic", fastMode: true });
expect(
resolveFastMode({
provider: "anthropic",
Expand Down
12 changes: 12 additions & 0 deletions packages/runtime/tests/model-reasoning.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@ describe("model reasoning mapping", () => {
expect(mapped.usedFallbackModelProfile).toBe(false);
});

test("maps Claude Opus 4.8 to adaptive thinking and output effort", () => {
const mapped = resolveAnthropicReasoning({
model: "claude-opus-4-8",
requested: "high",
});
expect(mapped.applied).toBe("high");
expect(mapped.budgetPreset).toBe("reasoning_high");
expect(mapped.thinking).toEqual({ type: "adaptive" });
expect(mapped.outputConfig).toEqual({ effort: "high" });
expect(mapped.usedFallbackModelProfile).toBe(false);
});

test("uses conservative fallback profile for unknown anthropic model", () => {
const missing: string[] = [];
const mapped = resolveAnthropicReasoning({
Expand Down
Loading