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

推荐订阅源

博客园 - 叶小钗
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Security Blog
Microsoft Security Blog
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
美团技术团队
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
aimingoo的专栏
aimingoo的专栏
腾讯CDC
WordPress大学
WordPress大学
Apple Machine Learning Research
Apple Machine Learning Research
F
Fortinet All Blogs
G
Google Developers Blog
MongoDB | Blog
MongoDB | Blog
Microsoft Azure Blog
Microsoft Azure Blog
小众软件
小众软件
Engineering at Meta
Engineering at Meta
博客园_首页
B
Blog RSS Feed
D
Docker
M
MIT News - Artificial intelligence
爱范儿
爱范儿
I
InfoQ

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(responses): drop orphaned assistant msg_* id when rea...
BSG2000 · 2026-05-31 · via Recent Commits to openclaw:main
11

import type { AgentMessage } from "openclaw/plugin-sdk/agent-core";

2-

import type { AssistantMessage, ThinkingContent, UserMessage, Usage } from "openclaw/plugin-sdk/llm";

2+

import type {

3+

AssistantMessage,

4+

ThinkingContent,

5+

UserMessage,

6+

Usage,

7+

} from "openclaw/plugin-sdk/llm";

38

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

49

import {

510

expectOpenAIResponsesStrictSanitizeCall,

@@ -978,6 +983,114 @@ describe("sanitizeSessionHistory", () => {

978983

]);

979984

});

980985986+

it("drops the paired assistant message id when reasoning is dropped after a model switch", async () => {

987+

// Regression for issue #88019: a fallback from azure-openai-responses to a

988+

// non-Responses model and back must not leave an orphaned msg_* id (its

989+

// paired rs_* reasoning is dropped), which Azure Responses would reject.

990+

const sessionEntries = [

991+

makeModelSnapshotEntry({

992+

provider: "anthropic",

993+

modelApi: "anthropic-messages",

994+

modelId: "claude-3-7",

995+

}),

996+

];

997+

const sessionManager = makeInMemorySessionManager(sessionEntries);

998+

const messages = [

999+

{

1000+

role: "assistant",

1001+

content: [

1002+

{

1003+

type: "thinking",

1004+

thinking: "reasoning",

1005+

thinkingSignature: JSON.stringify({ id: "rs_test", type: "reasoning" }),

1006+

},

1007+

{

1008+

type: "text",

1009+

text: "answer",

1010+

textSignature: JSON.stringify({ v: 1, id: "msg_test" }),

1011+

},

1012+

],

1013+

},

1014+

] as unknown as AgentMessage[];

1015+1016+

const result = await sanitizeWithOpenAIResponses({

1017+

sanitizeSessionHistory,

1018+

messages,

1019+

modelId: "gpt-5.4",

1020+

sessionManager,

1021+

});

1022+1023+

expect(result).toEqual([

1024+

{

1025+

role: "assistant",

1026+

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

1027+

usage: makeZeroUsageSnapshot(),

1028+

},

1029+

]);

1030+

});

1031+1032+

it("preserves phase metadata when dropping the paired message id after a model switch", async () => {

1033+

// Regression for issue #88019 review: dropping the orphaned msg_* id must not

1034+

// discard the Responses phase (commentary/final_answer) carried in the same

1035+

// textSignature, otherwise commentary would replay as user-visible output.

1036+

const sessionEntries = [

1037+

makeModelSnapshotEntry({

1038+

provider: "anthropic",

1039+

modelApi: "anthropic-messages",

1040+

modelId: "claude-3-7",

1041+

}),

1042+

];

1043+

const sessionManager = makeInMemorySessionManager(sessionEntries);

1044+

const messages = [

1045+

{

1046+

role: "assistant",

1047+

content: [

1048+

{

1049+

type: "thinking",

1050+

thinking: "reasoning",

1051+

thinkingSignature: JSON.stringify({ id: "rs_test", type: "reasoning" }),

1052+

},

1053+

{

1054+

type: "text",

1055+

text: "thinking out loud",

1056+

textSignature: JSON.stringify({ v: 1, id: "msg_commentary", phase: "commentary" }),

1057+

},

1058+

{

1059+

type: "text",

1060+

text: "final answer",

1061+

textSignature: JSON.stringify({ v: 1, id: "msg_final", phase: "final_answer" }),

1062+

},

1063+

],

1064+

},

1065+

] as unknown as AgentMessage[];

1066+1067+

const result = await sanitizeWithOpenAIResponses({

1068+

sanitizeSessionHistory,

1069+

messages,

1070+

modelId: "gpt-5.4",

1071+

sessionManager,

1072+

});

1073+1074+

expect(result).toEqual([

1075+

{

1076+

role: "assistant",

1077+

content: [

1078+

{

1079+

type: "text",

1080+

text: "thinking out loud",

1081+

textSignature: JSON.stringify({ v: 1, phase: "commentary" }),

1082+

},

1083+

{

1084+

type: "text",

1085+

text: "final answer",

1086+

textSignature: JSON.stringify({ v: 1, phase: "final_answer" }),

1087+

},

1088+

],

1089+

usage: makeZeroUsageSnapshot(),

1090+

},

1091+

]);

1092+

});

1093+9811094

it("keeps paired openai reasoning when the model snapshot stays the same", async () => {

9821095

const sessionEntries = [

9831096

makeModelSnapshotEntry({