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

推荐订阅源

Y
Y Combinator Blog
The GitHub Blog
The GitHub Blog
Vercel News
Vercel News
D
DataBreaches.Net
MongoDB | Blog
MongoDB | Blog
H
Help Net Security
小众软件
小众软件
美团技术团队
T
The Blog of Author Tim Ferriss
爱范儿
爱范儿
D
Docker
Martin Fowler
Martin Fowler
大猫的无限游戏
大猫的无限游戏
博客园 - 聂微东
Blog — PlanetScale
Blog — PlanetScale
H
Hackread – Cybersecurity News, Data Breaches, AI and More
罗磊的独立博客
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
V2EX
S
SegmentFault 最新的问题
云风的 BLOG
云风的 BLOG
B
Blog
雷峰网
雷峰网
The Cloudflare 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: restore verbose tool progress in chats (#76716) · op...
jalehman · 2026-05-03 · via Recent Commits to openclaw:main

@@ -28,6 +28,17 @@ vi.mock("./server-chat.load-gateway-session-row.runtime.js", () => ({

2828

loadGatewaySessionRow: vi.fn(),

2929

}));

303031+

vi.mock("./session-utils.js", () => ({

32+

loadSessionEntry: vi.fn(() => ({

33+

cfg: {},

34+

storePath: "/tmp/sessions.json",

35+

store: {},

36+

entry: undefined,

37+

canonicalKey: "session-1",

38+

legacyKey: undefined,

39+

})),

40+

}));

41+3142

import { getRuntimeConfig } from "../config/io.js";

3243

import { resolveHeartbeatVisibility } from "../infra/heartbeat-visibility.js";

3344

import {

@@ -37,6 +48,7 @@ import {

3748

createToolEventRecipientRegistry,

3849

} from "./server-chat.js";

3950

import { loadGatewaySessionRow } from "./server-chat.load-gateway-session-row.runtime.js";

51+

import { loadSessionEntry } from "./session-utils.js";

40524153

describe("agent event handler", () => {

4254

beforeEach(() => {

@@ -46,6 +58,14 @@ describe("agent event handler", () => {

4658

showAlerts: true,

4759

useIndicator: true,

4860

});

61+

vi.mocked(loadSessionEntry).mockReset().mockReturnValue({

62+

cfg: {},

63+

storePath: "/tmp/sessions.json",

64+

store: {},

65+

entry: undefined,

66+

canonicalKey: "session-1",

67+

legacyKey: undefined,

68+

});

4969

vi.mocked(loadGatewaySessionRow).mockReset().mockReturnValue(null);

5070

persistGatewaySessionLifecycleEventMock.mockReset().mockResolvedValue(undefined);

5171

resetAgentRunContextForTest();

@@ -760,6 +780,79 @@ describe("agent event handler", () => {

760780

resetAgentRunContextForTest();

761781

});

762782783+

it("uses newer session verbose state for in-flight tool events", () => {

784+

const { nodeSendToSession, handler } = createHarness({

785+

now: 1_000,

786+

resolveSessionKeyForRun: () => "session-1",

787+

});

788+

vi.mocked(loadSessionEntry).mockReturnValue({

789+

cfg: {},

790+

storePath: "/tmp/sessions.json",

791+

store: {},

792+

entry: { sessionId: "session-1", verboseLevel: "on", updatedAt: 1_500 },

793+

canonicalKey: "session-1",

794+

legacyKey: undefined,

795+

});

796+797+

registerAgentRunContext("run-tool-toggle", {

798+

sessionKey: "session-1",

799+

verboseLevel: "off",

800+

});

801+802+

handler({

803+

runId: "run-tool-toggle",

804+

seq: 1,

805+

stream: "tool",

806+

ts: Date.now(),

807+

data: { phase: "start", name: "read", toolCallId: "t-toggle" },

808+

});

809+810+

const nodeToolCalls = nodeSendToSession.mock.calls.filter(([, event]) => event === "agent");

811+

expect(nodeToolCalls).toHaveLength(1);

812+

expect(nodeToolCalls[0]?.[2]).toEqual(

813+

expect.objectContaining({

814+

stream: "tool",

815+

data: expect.objectContaining({

816+

phase: "start",

817+

name: "read",

818+

}),

819+

}),

820+

);

821+

resetAgentRunContextForTest();

822+

});

823+824+

it("keeps one-shot run verbose over older session state", () => {

825+

const { nodeSendToSession, handler } = createHarness({

826+

now: 2_000,

827+

resolveSessionKeyForRun: () => "session-1",

828+

});

829+

vi.mocked(loadSessionEntry).mockReturnValue({

830+

cfg: {},

831+

storePath: "/tmp/sessions.json",

832+

store: {},

833+

entry: { sessionId: "session-1", verboseLevel: "off", updatedAt: 1_500 },

834+

canonicalKey: "session-1",

835+

legacyKey: undefined,

836+

});

837+838+

registerAgentRunContext("run-tool-inline", {

839+

sessionKey: "session-1",

840+

verboseLevel: "on",

841+

});

842+843+

handler({

844+

runId: "run-tool-inline",

845+

seq: 1,

846+

stream: "tool",

847+

ts: Date.now(),

848+

data: { phase: "start", name: "read", toolCallId: "t-inline" },

849+

});

850+851+

const nodeToolCalls = nodeSendToSession.mock.calls.filter(([, event]) => event === "agent");

852+

expect(nodeToolCalls).toHaveLength(1);

853+

resetAgentRunContextForTest();

854+

});

855+763856

it("mirrors tool events to session subscribers so late-joining operator UIs can render them", () => {

764857

const { broadcastToConnIds, sessionEventSubscribers, handler } = createHarness({

765858

resolveSessionKeyForRun: () => "session-1",