惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
F
Fortinet All Blogs
小众软件
小众软件
人人都是产品经理
人人都是产品经理
The Cloudflare Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Microsoft Azure Blog
Microsoft Azure Blog
J
Java Code Geeks
有赞技术团队
有赞技术团队
D
DataBreaches.Net
Hugging Face - Blog
Hugging Face - Blog
V
Visual Studio Blog
A
About on SuperTechFans
I
InfoQ
The GitHub Blog
The GitHub Blog
Engineering at Meta
Engineering at Meta
雷峰网
雷峰网
H
Hackread – Cybersecurity News, Data Breaches, AI and More
罗磊的独立博客
C
Check Point Blog
大猫的无限游戏
大猫的无限游戏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
酷 壳 – CoolShell
酷 壳 – CoolShell
MyScale Blog
MyScale Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(agents): strip stale Anthropic thinking · openclaw/op...
TurboTheTurt · 2026-05-27 · via Recent Commits to openclaw:main
11

import type { AgentMessage } from "@earendil-works/pi-agent-core";

2-

import type { AssistantMessage, UserMessage, Usage } from "@earendil-works/pi-ai";

2+

import type { AssistantMessage, ThinkingContent, UserMessage, Usage } from "@earendil-works/pi-ai";

33

import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";

44

import {

55

expectOpenAIResponsesStrictSanitizeCall,

@@ -1494,6 +1494,87 @@ describe("sanitizeSessionHistory", () => {

14941494

},

14951495

);

149614961497+

it("strips invalid direct Anthropic thinking signatures from prior assistant turns when a user follows up", async () => {

1498+

setNonGoogleModelApi();

1499+1500+

const messages = castAgentMessages([

1501+

makeUserMessage("first"),

1502+

makeAssistantMessage([

1503+

{

1504+

type: "thinking",

1505+

thinking: "empty signature",

1506+

signature: "",

1507+

} as unknown as ThinkingContent,

1508+

{ type: "thinking", thinking: "blank signature", thinkingSignature: " " },

1509+

]),

1510+

makeUserMessage("second"),

1511+

]);

1512+1513+

const result = await sanitizeAnthropicHistory({

1514+

provider: "anthropic",

1515+

modelApi: "anthropic-messages",

1516+

messages,

1517+

modelId: "claude-sonnet-4-6",

1518+

});

1519+1520+

expect((result[1] as Extract<AgentMessage, { role: "assistant" }>).content).toEqual([

1521+

{ type: "text", text: OMITTED_ASSISTANT_REASONING_TEXT },

1522+

]);

1523+

});

1524+1525+

it.each([

1526+

{

1527+

provider: "anthropic",

1528+

modelApi: "anthropic-messages",

1529+

label: "anthropic",

1530+

},

1531+

{

1532+

provider: "amazon-bedrock",

1533+

modelApi: "bedrock-converse-stream",

1534+

label: "bedrock",

1535+

},

1536+

])(

1537+

"preserves active tool-turn thinking signatures for $label even when a tool result follows",

1538+

async ({ provider, modelApi }) => {

1539+

setNonGoogleModelApi();

1540+1541+

const messages = castAgentMessages([

1542+

makeUserMessage("look up the answer"),

1543+

makeAssistantMessage([

1544+

{

1545+

type: "thinking",

1546+

thinking: "call the tool",

1547+

signature: "",

1548+

} as unknown as ThinkingContent,

1549+

{ type: "toolCall", id: "call_1", name: "lookup", arguments: {} },

1550+

]),

1551+

castAgentMessage({

1552+

role: "toolResult",

1553+

toolCallId: "call_1",

1554+

toolName: "lookup",

1555+

content: [{ type: "text", text: "42" }],

1556+

isError: false,

1557+

}),

1558+

]);

1559+1560+

const result = await sanitizeAnthropicHistory({

1561+

provider,

1562+

modelApi,

1563+

messages,

1564+

modelId: "claude-sonnet-4-6",

1565+

});

1566+1567+

expect((result[1] as Extract<AgentMessage, { role: "assistant" }>).content).toEqual([

1568+

{

1569+

type: "thinking",

1570+

thinking: "call the tool",

1571+

signature: "",

1572+

},

1573+

{ type: "toolCall", id: "call_1", name: "lookup", arguments: {} },

1574+

]);

1575+

},

1576+

);

1577+14971578

it.each([

14981579

{

14991580

provider: "anthropic",