Skip to content

Commit 9e82b2a

Browse files
authored
refactor: remove duplicated Claude model checks (#134842)
1 parent d4575a1 commit 9e82b2a

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

‎src/plugin-sdk/provider-model-shared.test.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ describe("Claude model contracts", () => {
7777
["Anthropic API", { id: "claude-opus-5" }, "claude-opus-5"],
7878
["Anthropic alias", { id: "opus" }, "claude-opus-5"],
7979
["Anthropic version alias", { id: "opus-5" }, "claude-opus-5"],
80-
["Claude CLI", { id: "claude-opus-5" }, "claude-opus-5"],
8180
["Vertex AI", { id: "claude-opus-5@20260701" }, "claude-opus-5@20260701"],
8281
["Amazon Bedrock", { id: "global.anthropic.claude-opus-5" }, "claude-opus-5"],
8382
[
@@ -139,7 +138,7 @@ describe("Claude model contracts", () => {
139138

140139
describe("modelCostsEqual", () => {
141140
it("matches complete flat rates and rejects missing or stale metadata", () => {
142-
expect(modelCostsEqual(EXPECTED_COST, EXPECTED_COST)).toBe(true);
141+
expect(modelCostsEqual({ ...EXPECTED_COST }, EXPECTED_COST)).toBe(true);
143142
expect(modelCostsEqual(undefined, EXPECTED_COST)).toBe(false);
144143
expect(modelCostsEqual({ ...EXPECTED_COST, output: 15 }, EXPECTED_COST)).toBe(false);
145144
});

‎src/plugins/provider-claude-thinking.ts‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,14 @@ export function resolveClaudeThinkingProfile(
4545
if (resolveClaudeFable5ModelIdentity(ref) || resolveClaudeMythos5ModelIdentity(ref)) {
4646
return CLAUDE_FABLE_5_THINKING_PROFILE;
4747
}
48+
// Before the generic xhigh branch: Opus 5 defaults thinking on ("high"),
49+
// unlike Opus 4.7/4.8 whose omitted-thinking default is off.
4850
if (resolveClaudeOpus5ModelIdentity(ref)) {
4951
return CLAUDE_OPUS_5_THINKING_PROFILE;
5052
}
5153
if (resolveClaudeSonnet5ModelIdentity(ref)) {
5254
return CLAUDE_SONNET_5_THINKING_PROFILE;
5355
}
54-
// Before the generic xhigh branch: Opus 5 defaults thinking on ("high"),
55-
// unlike Opus 4.7/4.8 whose omitted-thinking default is off.
56-
if (resolveClaudeOpus5ModelIdentity(ref)) {
57-
return CLAUDE_OPUS_5_THINKING_PROFILE;
58-
}
5956
if (requiresClaudeMandatoryAdaptiveThinking(ref)) {
6057
return {
6158
// Mythos Preview requires adaptive thinking but does not expose the

0 commit comments

Comments
 (0)