Skip to content

Commit c810bc5

Browse files
committed
fix: restore claude-opus-4-5-20251101 prompt caching and remove dead code
- Add claude-opus-4-5-20251101 back to switch statements for prompt caching support - Remove unused lastThinkingSignature property and getThinkingSignature() method
1 parent d465146 commit c810bc5

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

src/api/providers/anthropic-vertex.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ function filterNonAnthropicBlocks(messages: Anthropic.Messages.MessageParam[]):
6868
export class AnthropicVertexHandler extends BaseProvider implements SingleCompletionHandler {
6969
protected options: ApiHandlerOptions
7070
private client: AnthropicVertex
71-
private lastThinkingSignature?: string
7271

7372
constructor(options: ApiHandlerOptions) {
7473
super()
@@ -107,9 +106,6 @@ export class AnthropicVertexHandler extends BaseProvider implements SingleComple
107106
messages: Anthropic.Messages.MessageParam[],
108107
metadata?: ApiHandlerCreateMessageMetadata,
109108
): ApiStream {
110-
// Reset thinking signature for this request
111-
this.lastThinkingSignature = undefined
112-
113109
let {
114110
id,
115111
info: { supportsPromptCache },
@@ -274,12 +270,4 @@ export class AnthropicVertexHandler extends BaseProvider implements SingleComple
274270
throw error
275271
}
276272
}
277-
278-
/**
279-
* Returns the thinking signature from the last response, if available.
280-
* This signature is used for multi-turn extended thinking continuity.
281-
*/
282-
public getThinkingSignature(): string | undefined {
283-
return this.lastThinkingSignature
284-
}
285273
}

src/api/providers/anthropic.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ function filterNonAnthropicBlocks(messages: Anthropic.Messages.MessageParam[]):
6666
export class AnthropicHandler extends BaseProvider implements SingleCompletionHandler {
6767
private options: ApiHandlerOptions
6868
private client: Anthropic
69-
private lastThinkingSignature?: string
7069

7170
constructor(options: ApiHandlerOptions) {
7271
super()
@@ -86,9 +85,6 @@ export class AnthropicHandler extends BaseProvider implements SingleCompletionHa
8685
messages: Anthropic.Messages.MessageParam[],
8786
metadata?: ApiHandlerCreateMessageMetadata,
8887
): ApiStream {
89-
// Reset thinking signature for this request
90-
this.lastThinkingSignature = undefined
91-
9288
let stream: AnthropicStream<Anthropic.Messages.RawMessageStreamEvent>
9389
const cacheControl: CacheControlEphemeral = { type: "ephemeral" }
9490
let { id: modelId, betas = [], maxTokens, temperature, reasoning: thinking } = this.getModel()
@@ -107,6 +103,7 @@ export class AnthropicHandler extends BaseProvider implements SingleCompletionHa
107103
switch (modelId) {
108104
case "claude-sonnet-4-5":
109105
case "claude-sonnet-4-20250514":
106+
case "claude-opus-4-5-20251101":
110107
case "claude-opus-4-1-20250805":
111108
case "claude-opus-4-20250514":
112109
case "claude-3-7-sonnet-20250219":
@@ -168,6 +165,7 @@ export class AnthropicHandler extends BaseProvider implements SingleCompletionHa
168165
switch (modelId) {
169166
case "claude-sonnet-4-5":
170167
case "claude-sonnet-4-20250514":
168+
case "claude-opus-4-5-20251101":
171169
case "claude-opus-4-1-20250805":
172170
case "claude-opus-4-20250514":
173171
case "claude-3-7-sonnet-20250219":
@@ -382,12 +380,4 @@ export class AnthropicHandler extends BaseProvider implements SingleCompletionHa
382380
return super.countTokens(content)
383381
}
384382
}
385-
386-
/**
387-
* Returns the thinking signature from the last response, if available.
388-
* This signature is used for multi-turn extended thinking continuity.
389-
*/
390-
public getThinkingSignature(): string | undefined {
391-
return this.lastThinkingSignature
392-
}
393383
}

0 commit comments

Comments
 (0)