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

推荐订阅源

Engineering at Meta
Engineering at Meta
D
Docker
IT之家
IT之家
博客园_首页
罗磊的独立博客
V
V2EX
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
美团技术团队
Y
Y Combinator Blog
博客园 - 聂微东
量子位
阮一峰的网络日志
阮一峰的网络日志
GbyAI
GbyAI
Microsoft Security Blog
Microsoft Security Blog
博客园 - Franky
Martin Fowler
Martin Fowler
Jina AI
Jina AI
大猫的无限游戏
大猫的无限游戏
C
Check Point Blog
月光博客
月光博客
G
Google Developers Blog
B
Blog
T
The Blog of Author Tim Ferriss
爱范儿
爱范儿

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(tui): dismiss watchdog notice when response actually ...
RomneyDa · 2026-05-23 · via Recent Commits to openclaw:main

@@ -8,6 +8,8 @@ type HandlerChatLog = {

88

startTool: (...args: unknown[]) => void;

99

updateToolResult: (...args: unknown[]) => void;

1010

addSystem: (...args: unknown[]) => void;

11+

addPendingSystem: (...args: unknown[]) => void;

12+

dismissPendingSystem: (...args: unknown[]) => void;

1113

updateAssistant: (...args: unknown[]) => void;

1214

finalizeAssistant: (...args: unknown[]) => void;

1315

dropAssistant: (...args: unknown[]) => void;

@@ -21,6 +23,8 @@ type MockChatLog = {

2123

startTool: MockFn;

2224

updateToolResult: MockFn;

2325

addSystem: MockFn;

26+

addPendingSystem: MockFn;

27+

dismissPendingSystem: MockFn;

2428

updateAssistant: MockFn;

2529

finalizeAssistant: MockFn;

2630

dropAssistant: MockFn;

@@ -36,6 +40,8 @@ function createMockChatLog(): MockChatLog & HandlerChatLog {

3640

startTool: vi.fn(),

3741

updateToolResult: vi.fn(),

3842

addSystem: vi.fn(),

43+

addPendingSystem: vi.fn(),

44+

dismissPendingSystem: vi.fn(),

3945

updateAssistant: vi.fn(),

4046

finalizeAssistant: vi.fn(),

4147

dropAssistant: vi.fn(),

@@ -1178,7 +1184,7 @@ describe("tui-event-handlers: streaming watchdog", () => {

1178118411791185

expect(setActivityStatus).toHaveBeenLastCalledWith("idle");

11801186

expect(state.activeChatRunId).toBeNull();

1181-

expect(chatLog.addSystem).toHaveBeenCalledWith(expectedTimeoutMessage);

1187+

expect(chatLog.addPendingSystem).toHaveBeenCalledWith("run-stuck", expectedTimeoutMessage);

1182118811831189

handlers.dispose?.();

11841190

});

@@ -1384,7 +1390,7 @@ describe("tui-event-handlers: streaming watchdog", () => {

13841390

expect(setActivityStatus).toHaveBeenLastCalledWith("idle");

13851391

expect(state.activeChatRunId).toBeNull();

13861392

expect(loadHistory).toHaveBeenCalledTimes(1);

1387-

expect(chatLog.addSystem).not.toHaveBeenCalledWith(expectedTimeoutMessage);

1393+

expect(chatLog.addPendingSystem).not.toHaveBeenCalled();

1388139413891395

handlers.dispose?.();

13901396

});

@@ -1410,8 +1416,8 @@ describe("tui-event-handlers: streaming watchdog", () => {

14101416

vi.advanceTimersByTime(10_000);

1411141714121418

const statusCalls = setActivityStatus.mock.calls.map((c) => c[0]);

1413-

expect(statusCalls.reduce((count, s) => count + (s === "idle" ? 1 : 0), 0)).toBe(1);

1414-

expect(chatLog.addSystem).not.toHaveBeenCalledWith(expectedTimeoutMessage);

1419+

expect(statusCalls.filter((s) => s === "idle").length).toBe(1);

1420+

expect(chatLog.addPendingSystem).not.toHaveBeenCalled();

14151421

expect(state.activeChatRunId).toBeNull();

1416142214171423

handlers.dispose?.();

@@ -1432,7 +1438,7 @@ describe("tui-event-handlers: streaming watchdog", () => {

14321438

vi.advanceTimersByTime(60_000);

1433143914341440

expect(setActivityStatus).not.toHaveBeenCalledWith("idle");

1435-

expect(chatLog.addSystem).not.toHaveBeenCalled();

1441+

expect(chatLog.addPendingSystem).not.toHaveBeenCalled();

14361442

expect(state.activeChatRunId).toBe("run-no-watchdog");

1437144314381444

handlers.dispose?.();

@@ -1474,7 +1480,7 @@ describe("tui-event-handlers: streaming watchdog", () => {

1474148014751481

expect(setActivityStatus).toHaveBeenLastCalledWith("idle");

14761482

expect(state.activeChatRunId).toBeNull();

1477-

expect(chatLog.addSystem).toHaveBeenCalledTimes(2);

1483+

expect(chatLog.addPendingSystem).toHaveBeenCalledTimes(2);

1478148414791485

handlers.dispose?.();

14801486

});

@@ -1495,6 +1501,60 @@ describe("tui-event-handlers: streaming watchdog", () => {

14951501

vi.advanceTimersByTime(10_000);

1496150214971503

expect(setActivityStatus).not.toHaveBeenCalledWith("idle");

1498-

expect(chatLog.addSystem).not.toHaveBeenCalled();

1504+

expect(chatLog.addPendingSystem).not.toHaveBeenCalled();

1505+

});

1506+1507+

it("dismisses the watchdog notice when a delta arrives after the watchdog fires", () => {

1508+

const { state, chatLog, handlers } = createHarness({

1509+

streamingWatchdogMs: 5_000,

1510+

});

1511+1512+

handlers.handleChatEvent({

1513+

runId: "run-late",

1514+

sessionKey: state.currentSessionKey,

1515+

state: "delta",

1516+

message: { content: "starting" },

1517+

} satisfies ChatEvent);

1518+1519+

vi.advanceTimersByTime(5_001);

1520+

expect(chatLog.addPendingSystem).toHaveBeenCalledWith("run-late", expectedTimeoutMessage);

1521+1522+

handlers.handleChatEvent({

1523+

runId: "run-late",

1524+

sessionKey: state.currentSessionKey,

1525+

state: "delta",

1526+

message: { content: "actually here" },

1527+

} satisfies ChatEvent);

1528+1529+

expect(chatLog.dismissPendingSystem).toHaveBeenCalledWith("run-late");

1530+1531+

handlers.dispose?.();

1532+

});

1533+1534+

it("dismisses the watchdog notice when the final arrives after the watchdog fires", () => {

1535+

const { state, chatLog, handlers } = createHarness({

1536+

streamingWatchdogMs: 5_000,

1537+

});

1538+1539+

handlers.handleChatEvent({

1540+

runId: "run-final-late",

1541+

sessionKey: state.currentSessionKey,

1542+

state: "delta",

1543+

message: { content: "starting" },

1544+

} satisfies ChatEvent);

1545+1546+

vi.advanceTimersByTime(5_001);

1547+

expect(chatLog.addPendingSystem).toHaveBeenCalledWith("run-final-late", expectedTimeoutMessage);

1548+1549+

handlers.handleChatEvent({

1550+

runId: "run-final-late",

1551+

sessionKey: state.currentSessionKey,

1552+

state: "final",

1553+

message: { content: [{ type: "text", text: "done" }], stopReason: "stop" },

1554+

} satisfies ChatEvent);

1555+1556+

expect(chatLog.dismissPendingSystem).toHaveBeenCalledWith("run-final-late");

1557+1558+

handlers.dispose?.();

14991559

});

15001560

});