Skip to content

Commit 6cf7882

Browse files
committed
v0.6.43
- Add Anthropic request signature parameter padding strategy
1 parent 6b27069 commit 6cf7882

4 files changed

Lines changed: 15 additions & 11 deletions

File tree

.github/workflows/publish.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,7 @@ jobs:
5858
5959
### What's New
6060
61-
- Add the /copy-last command to copy the last Assistant response to the clipboard
62-
- Optimize some UI display effects
63-
- Enhance the compatibility of Usage information acquisition
61+
- Add Anthropic request signature parameter padding strategy
6462
6563
### Installation
6664
```bash

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "snow-ai",
3-
"version": "0.6.42",
3+
"version": "0.6.43",
44
"description": "Agentic coding in your terminal",
55
"license": "MIT",
66
"bin": {

source/api/anthropic.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,11 @@ function convertToAnthropicMessages(
338338
// When thinking is enabled, thinking block must come first
339339
// Skip thinking block when disableThinking is true
340340
if (msg.thinking && !disableThinking) {
341-
// Use the complete thinking block object (includes signature)
342-
content.push(msg.thinking);
341+
// Ensure signature is always present (required by Anthropic API)
342+
content.push({
343+
...msg.thinking,
344+
signature: msg.thinking.signature || '',
345+
});
343346
}
344347

345348
if (msg.content) {
@@ -371,8 +374,11 @@ function convertToAnthropicMessages(
371374
if (msg.role === 'assistant' && msg.thinking && !disableThinking) {
372375
const content: any[] = [];
373376

374-
// Thinking block must come first - use complete block object (includes signature)
375-
content.push(msg.thinking);
377+
// Thinking block must come first - ensure signature is always present
378+
content.push({
379+
...msg.thinking,
380+
signature: msg.thinking.signature || '',
381+
});
376382

377383
// Then text content
378384
if (msg.content) {
@@ -1019,7 +1025,7 @@ export async function* createStreamingAnthropicCompletion(
10191025
? {
10201026
type: 'thinking' as const,
10211027
thinking: thinkingTextBuffer,
1022-
signature: thinkingSignature || undefined,
1028+
signature: thinkingSignature || '',
10231029
}
10241030
: undefined;
10251031

0 commit comments

Comments
 (0)