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

推荐订阅源

OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 聂微东
博客园 - 叶小钗
爱范儿
爱范儿
罗磊的独立博客
Hugging Face - Blog
Hugging Face - Blog
阮一峰的网络日志
阮一峰的网络日志
S
SegmentFault 最新的问题
Apple Machine Learning Research
Apple Machine Learning Research
美团技术团队
T
Tailwind CSS Blog
博客园 - 司徒正美
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
宝玉的分享
宝玉的分享
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Cloudflare Blog
人人都是产品经理
人人都是产品经理
小众软件
小众软件
博客园 - 【当耐特】
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
雷峰网
雷峰网
酷 壳 – CoolShell
酷 壳 – CoolShell

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: replay Xiaomi Anthropic reasoning blocks · openclaw/...
steipete · 2026-05-18 · via Recent Commits to openclaw:main

@@ -1027,7 +1027,7 @@ describe("anthropic transport stream", () => {

10271027

]);

10281028

});

102910291030-

it("backfills empty reasoning_content for compatible Anthropic tool-use replays", async () => {

1030+

it("backfills empty reasoning_content thinking blocks for compatible Anthropic tool-use replays", async () => {

10311031

await runTransportStream(

10321032

makeAnthropicTransportModel({

10331033

id: "mimo-v2.6-pro",

@@ -1066,13 +1066,69 @@ describe("anthropic transport stream", () => {

10661066

latestAnthropicRequest().payload.messages,

10671067

(record) => record.role === "assistant",

10681068

);

1069-

expect(assistantMessage.reasoning_content).toBe("");

1069+

expect(assistantMessage).not.toHaveProperty("reasoning_content");

1070+

expect(assistantMessage.content).toEqual([

1071+

{

1072+

type: "thinking",

1073+

thinking: "",

1074+

signature: "reasoning_content",

1075+

},

1076+

{ type: "tool_use", id: "call_1", name: "lookup", input: {} },

1077+

]);

1078+

});

1079+1080+

it("backfills MiMo v2-flash tool-use replay when OpenClaw thinking is off", async () => {

1081+

await runTransportStream(

1082+

makeAnthropicTransportModel({

1083+

id: "mimo-v2-flash",

1084+

name: "MiMo V2 Flash",

1085+

provider: "xiaomi",

1086+

baseUrl: "https://api.xiaomimimo.com/anthropic",

1087+

reasoning: false,

1088+

}),

1089+

{

1090+

messages: [

1091+

{ role: "user", content: "look this up" },

1092+

{

1093+

role: "assistant",

1094+

provider: "xiaomi",

1095+

api: "anthropic-messages",

1096+

model: "mimo-v2-flash",

1097+

stopReason: "toolUse",

1098+

timestamp: 0,

1099+

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

1100+

},

1101+

{

1102+

role: "toolResult",

1103+

toolCallId: "call_1",

1104+

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

1105+

isError: false,

1106+

},

1107+

{ role: "user", content: "continue" },

1108+

],

1109+

} as AnthropicStreamContext,

1110+

{

1111+

apiKey: "sk-xiaomi-test",

1112+

} as AnthropicStreamOptions,

1113+

);

1114+1115+

const assistantMessage = findRecord(

1116+

latestAnthropicRequest().payload.messages,

1117+

(record) => record.role === "assistant",

1118+

);

1119+

expect(latestAnthropicRequest().payload).not.toHaveProperty("thinking");

1120+

expect(assistantMessage).not.toHaveProperty("reasoning_content");

10701121

expect(assistantMessage.content).toEqual([

1122+

{

1123+

type: "thinking",

1124+

thinking: "",

1125+

signature: "reasoning_content",

1126+

},

10711127

{ type: "tool_use", id: "call_1", name: "lookup", input: {} },

10721128

]);

10731129

});

107411301075-

it("backfills empty reasoning_content for compatible Anthropic text replays", async () => {

1131+

it("backfills empty reasoning_content thinking blocks for compatible Anthropic text replays", async () => {

10761132

await runTransportStream(

10771133

makeAnthropicTransportModel({

10781134

id: "mimo-v2.6-pro",

@@ -1105,8 +1161,15 @@ describe("anthropic transport stream", () => {

11051161

latestAnthropicRequest().payload.messages,

11061162

(record) => record.role === "assistant",

11071163

);

1108-

expect(assistantMessage.reasoning_content).toBe("");

1109-

expect(assistantMessage.content).toEqual([{ type: "text", text: "Hello!" }]);

1164+

expect(assistantMessage).not.toHaveProperty("reasoning_content");

1165+

expect(assistantMessage.content).toEqual([

1166+

{

1167+

type: "thinking",

1168+

thinking: "",

1169+

signature: "reasoning_content",

1170+

},

1171+

{ type: "text", text: "Hello!" },

1172+

]);

11101173

});

1111117411121175

it("does not backfill reasoning_content for generic Anthropic-compatible tool-use replays", async () => {

@@ -1154,7 +1217,7 @@ describe("anthropic transport stream", () => {

11541217

]);

11551218

});

115612191157-

it("does not replay reasoning_content when compatible Anthropic thinking is disabled", async () => {

1220+

it("replays observed reasoning_content for compatible Anthropic routes when thinking is disabled", async () => {

11581221

await runTransportStream(

11591222

makeAnthropicTransportModel({

11601223

id: "mimo-v2.6-pro",

@@ -1194,8 +1257,15 @@ describe("anthropic transport stream", () => {

11941257

(record) => record.role === "assistant",

11951258

);

11961259

expect(latestAnthropicRequest().payload.thinking).toEqual({ type: "disabled" });

1197-

expect(assistantMessage).not.toHaveProperty("reasoning_content");

1198-

expect(assistantMessage.content).toEqual([{ type: "text", text: "Hello!" }]);

1260+

expect(assistantMessage.reasoning_content).toBe("Need to answer politely.");

1261+

expect(assistantMessage.content).toEqual([

1262+

{

1263+

type: "thinking",

1264+

thinking: "Need to answer politely.",

1265+

signature: "reasoning_content",

1266+

},

1267+

{ type: "text", text: "Hello!" },

1268+

]);

11991269

});

1200127012011271

it("does not replay synthetic reasoning_content to native Anthropic models", async () => {