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

推荐订阅源

腾讯CDC
N
Netflix TechBlog - Medium
aimingoo的专栏
aimingoo的专栏
P
Proofpoint News Feed
F
Fortinet All Blogs
大猫的无限游戏
大猫的无限游戏
I
InfoQ
V
V2EX
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
有赞技术团队
有赞技术团队
G
Google Developers Blog
L
LangChain Blog
博客园_首页
M
MIT News - Artificial intelligence
H
Hackread – Cybersecurity News, Data Breaches, AI and More
月光博客
月光博客
IT之家
IT之家
量子位
宝玉的分享
宝玉的分享
S
SegmentFault 最新的问题
Stack Overflow Blog
Stack Overflow Blog
V
Visual Studio Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
雷峰网
雷峰网

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): resync streaming watchdog after reconnect (#742...
rogerdigital · 2026-04-29 · via Recent Commits to openclaw:main

@@ -1004,6 +1004,149 @@ describe("tui-event-handlers: streaming watchdog", () => {

10041004

handlers.dispose?.();

10051005

});

100610061007+

it("rearms the watchdog on active-run tool events even when tool verbosity is off", () => {

1008+

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

1009+

streamingWatchdogMs: 5_000,

1010+

});

1011+

state.sessionInfo.verboseLevel = "off";

1012+1013+

handlers.handleChatEvent({

1014+

runId: "run-tools",

1015+

sessionKey: state.currentSessionKey,

1016+

state: "delta",

1017+

message: { content: "first" },

1018+

} satisfies ChatEvent);

1019+1020+

vi.advanceTimersByTime(3_000);

1021+1022+

handlers.handleAgentEvent({

1023+

runId: "run-tools",

1024+

stream: "tool",

1025+

data: { phase: "start", toolCallId: "tool-1", name: "read" },

1026+

} satisfies AgentEvent);

1027+1028+

vi.advanceTimersByTime(3_000);

1029+1030+

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

1031+

expect(state.activeChatRunId).toBe("run-tools");

1032+1033+

vi.advanceTimersByTime(2_001);

1034+1035+

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

1036+

expect(state.activeChatRunId).toBeNull();

1037+1038+

handlers.dispose?.();

1039+

});

1040+1041+

it("pauses the watchdog while disconnected and rearms it on reconnect without clearing the active run", () => {

1042+

const { state, setActivityStatus, loadHistory, handlers } = createHarness({

1043+

streamingWatchdogMs: 5_000,

1044+

});

1045+1046+

handlers.handleChatEvent({

1047+

runId: "run-reconnect",

1048+

sessionKey: state.currentSessionKey,

1049+

state: "delta",

1050+

message: { content: "hello" },

1051+

} satisfies ChatEvent);

1052+1053+

handlers.pauseStreamingWatchdog();

1054+

vi.advanceTimersByTime(10_000);

1055+1056+

expect(state.activeChatRunId).toBe("run-reconnect");

1057+

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

1058+1059+

handlers.reconnectStreamingWatchdog();

1060+1061+

expect(setActivityStatus).toHaveBeenCalledWith("streaming");

1062+

expect(state.activeChatRunId).toBe("run-reconnect");

1063+1064+

vi.advanceTimersByTime(5_001);

1065+1066+

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

1067+

expect(state.activeChatRunId).toBeNull();

1068+

expect(loadHistory).toHaveBeenCalledTimes(1);

1069+1070+

handlers.dispose?.();

1071+

});

1072+1073+

it("reloads history only once when reconnect recovery and deferred history refresh overlap", () => {

1074+

const { state, loadHistory, noteLocalRunId, handlers } = createHarness({

1075+

streamingWatchdogMs: 5_000,

1076+

});

1077+1078+

handlers.handleChatEvent({

1079+

runId: "run-reconnect",

1080+

sessionKey: state.currentSessionKey,

1081+

state: "delta",

1082+

message: { content: "hello" },

1083+

} satisfies ChatEvent);

1084+1085+

noteLocalRunId("run-local-empty");

1086+

handlers.handleChatEvent({

1087+

runId: "run-local-empty",

1088+

sessionKey: state.currentSessionKey,

1089+

state: "final",

1090+

} satisfies ChatEvent);

1091+1092+

handlers.pauseStreamingWatchdog();

1093+

handlers.reconnectStreamingWatchdog();

1094+

vi.advanceTimersByTime(5_001);

1095+1096+

expect(loadHistory).toHaveBeenCalledTimes(1);

1097+1098+

handlers.dispose?.();

1099+

});

1100+1101+

it("resets to idle when reconnect drops an active run that is no longer tracked", () => {

1102+

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

1103+

streamingWatchdogMs: 5_000,

1104+

});

1105+

state.activeChatRunId = "run-stale";

1106+

state.activityStatus = "streaming";

1107+1108+

handlers.reconnectStreamingWatchdog();

1109+1110+

expect(state.activeChatRunId).toBeNull();

1111+

expect(state.activityStatus).toBe("idle");

1112+

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

1113+1114+

handlers.dispose?.();

1115+

});

1116+1117+

it("keeps reconnect recovery armed when only terminal lifecycle arrives after reconnect", () => {

1118+

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

1119+

streamingWatchdogMs: 5_000,

1120+

});

1121+1122+

handlers.handleChatEvent({

1123+

runId: "run-lifecycle-only",

1124+

sessionKey: state.currentSessionKey,

1125+

state: "delta",

1126+

message: { content: "hello" },

1127+

} satisfies ChatEvent);

1128+1129+

handlers.pauseStreamingWatchdog();

1130+

handlers.reconnectStreamingWatchdog();

1131+1132+

handlers.handleAgentEvent({

1133+

runId: "run-lifecycle-only",

1134+

stream: "lifecycle",

1135+

data: { phase: "end" },

1136+

} satisfies AgentEvent);

1137+1138+

vi.advanceTimersByTime(5_001);

1139+1140+

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

1141+

expect(state.activeChatRunId).toBeNull();

1142+

expect(loadHistory).toHaveBeenCalledTimes(1);

1143+

expect(chatLog.addSystem).not.toHaveBeenCalledWith(

1144+

expect.stringContaining("streaming watchdog"),

1145+

);

1146+1147+

handlers.dispose?.();

1148+

});

1149+10071150

it("cancels the watchdog when the run finalizes normally", () => {

10081151

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

10091152

streamingWatchdogMs: 5_000,