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

推荐订阅源

Recent Announcements
Recent Announcements
爱范儿
爱范儿
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
博客园_首页
IT之家
IT之家
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 三生石上(FineUI控件)
有赞技术团队
有赞技术团队
大猫的无限游戏
大猫的无限游戏
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 司徒正美
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
人人都是产品经理
人人都是产品经理
Jina AI
Jina AI
月光博客
月光博客
小众软件
小众软件
S
SegmentFault 最新的问题
量子位
阮一峰的网络日志
阮一峰的网络日志
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知

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(gateway): hide duplicate ACP chat replies (#85775) · ...
giodl73-repo · 2026-05-24 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -83,6 +83,7 @@ Docs: https://docs.openclaw.ai

8383

- CLI/plugins: tighten timeout, numeric option, media payload, permission, profile/TLS, plugin metadata, JSON, and remote URL handling; prevent stuck progress/app-server/IRC/Synology/Twitch waits; and keep imported chat history ordering stable.

8484

- Telegram/config: suppress the missing `accounts.default` warning when `channels.telegram.defaultAccount` names a configured account that also sorts first. Fixes #83948. Thanks @crypto86m.

8585

- WebChat: summarize internal message-tool source replies so tool cards no longer duplicate the visible reply body. (#84773) Thanks @jason-allen-oneal.

86+

- Gateway/WebChat: hide duplicate `gateway-injected` assistant rows when Cursor ACP already persisted the same `acp-runtime` reply. Fixes #85741. Thanks @lxf-lxf.

8687

- WebChat: scope the visible attachment button to its own composer file input so clicking Upload reliably opens the file picker. (#83952, fixes #47983) Thanks @jason-allen-oneal.

8788

- Gateway: preserve deferred lifecycle-error cleanup across later non-terminal events so provider timeouts can persist failed session state instead of leaving sessions stuck running. (#85256, fixes #63819) Thanks @samzong.

8889

- Agents/subagents: report tool-only child progress during timeout summaries instead of showing no visible output.

Original file line numberDiff line numberDiff line change

@@ -1130,6 +1130,40 @@ function shouldHideProjectedHistoryMessage(message: Record<string, unknown>): bo

11301130

return isHeartbeatOkResponse(roleContent);

11311131

}

11321132
1133+

function openclawAssistantModel(message: Record<string, unknown>): string | undefined {

1134+

return message.role === "assistant" &&

1135+

message.provider === "openclaw" &&

1136+

typeof message.model === "string"

1137+

? message.model

1138+

: undefined;

1139+

}

1140+
1141+

function displayTextForDuplicateCheck(message: Record<string, unknown>): string | undefined {

1142+

const text = extractProjectedText(message.content ?? message.text).trim();

1143+

return text ? text : undefined;

1144+

}

1145+
1146+

function isDuplicateAcpGatewayInjectedMessage(

1147+

current: Record<string, unknown>,

1148+

previousVisible: Record<string, unknown> | undefined,

1149+

): boolean {

1150+

if (!previousVisible) {

1151+

return false;

1152+

}

1153+

if (

1154+

openclawAssistantModel(previousVisible) !== "acp-runtime" ||

1155+

openclawAssistantModel(current) !== "gateway-injected"

1156+

) {

1157+

return false;

1158+

}

1159+

if (hasAssistantNonTextContent(previousVisible) || hasAssistantNonTextContent(current)) {

1160+

return false;

1161+

}

1162+

const previousText = displayTextForDuplicateCheck(previousVisible);

1163+

const currentText = displayTextForDuplicateCheck(current);

1164+

return Boolean(previousText && currentText && previousText === currentText);

1165+

}

1166+
11331167

function toProjectedMessages(messages: unknown[]): Array<Record<string, unknown>> {

11341168

return messages.filter(

11351169

(message): message is Record<string, unknown> =>

@@ -1167,6 +1201,10 @@ function filterVisibleProjectedHistoryMessages(

11671201

changed = true;

11681202

continue;

11691203

}

1204+

if (isDuplicateAcpGatewayInjectedMessage(current, visible.at(-1))) {

1205+

changed = true;

1206+

continue;

1207+

}

11701208

visible.push(current);

11711209

}

11721210

return changed ? visible : messages;

Original file line numberDiff line numberDiff line change

@@ -710,6 +710,82 @@ describe("projectRecentChatDisplayMessages", () => {

710710

]);

711711

});

712712
713+

it("drops duplicate ACP gateway-injected assistant replies from chat history", () => {

714+

const result = projectRecentChatDisplayMessages([

715+

{

716+

role: "user",

717+

content: [{ type: "text", text: "good morning" }],

718+

timestamp: 1,

719+

},

720+

{

721+

role: "assistant",

722+

provider: "openclaw",

723+

model: "acp-runtime",

724+

content: [{ type: "text", text: "Good morning." }],

725+

timestamp: 2,

726+

},

727+

{

728+

role: "assistant",

729+

provider: "openclaw",

730+

model: "gateway-injected",

731+

content: [{ type: "text", text: "Good morning." }],

732+

idempotencyKey: "run-1",

733+

timestamp: 3,

734+

},

735+

]);

736+
737+

expect(result).toEqual([

738+

{

739+

role: "user",

740+

content: [{ type: "text", text: "good morning" }],

741+

timestamp: 1,

742+

},

743+

{

744+

role: "assistant",

745+

provider: "openclaw",

746+

model: "acp-runtime",

747+

content: [{ type: "text", text: "Good morning." }],

748+

timestamp: 2,

749+

},

750+

]);

751+

});

752+
753+

it("keeps gateway-injected assistant replies when they are not duplicate ACP text", () => {

754+

const result = projectRecentChatDisplayMessages([

755+

{

756+

role: "assistant",

757+

provider: "openclaw",

758+

model: "acp-runtime",

759+

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

760+

timestamp: 1,

761+

},

762+

{

763+

role: "assistant",

764+

provider: "openclaw",

765+

model: "gateway-injected",

766+

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

767+

timestamp: 2,

768+

},

769+

]);

770+
771+

expect(result).toEqual([

772+

{

773+

role: "assistant",

774+

provider: "openclaw",

775+

model: "acp-runtime",

776+

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

777+

timestamp: 1,

778+

},

779+

{

780+

role: "assistant",

781+

provider: "openclaw",

782+

model: "gateway-injected",

783+

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

784+

timestamp: 2,

785+

},

786+

]);

787+

});

788+
713789

it("applies history limits after dropping display-hidden messages", () => {

714790

const result = projectRecentChatDisplayMessages(

715791

[