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

推荐订阅源

J
Java Code Geeks
I
InfoQ
阮一峰的网络日志
阮一峰的网络日志
有赞技术团队
有赞技术团队
Vercel News
Vercel News
Engineering at Meta
Engineering at Meta
Hugging Face - Blog
Hugging Face - Blog
G
Google Developers Blog
Stack Overflow Blog
Stack Overflow Blog
aimingoo的专栏
aimingoo的专栏
罗磊的独立博客
Blog — PlanetScale
Blog — PlanetScale
Microsoft Security Blog
Microsoft Security Blog
B
Blog RSS Feed
H
Help Net Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
P
Proofpoint News Feed
MyScale Blog
MyScale Blog
V
Visual Studio Blog
B
Blog
MongoDB | Blog
MongoDB | Blog
T
The Blog of Author Tim Ferriss
L
LangChain Blog
D
Docker

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: preserve queued session recovery diagnostics · openc...
steipete · 2026-05-02 · via Recent Commits to openclaw:main

@@ -24,6 +24,7 @@ import {

2424

} from "./diagnostic-stability.js";

2525

import {

2626

logSessionStateChange,

27+

logMessageQueued,

2728

resetDiagnosticStateForTest,

2829

resolveStuckSessionWarnMs,

2930

startDiagnosticHeartbeat,

@@ -162,6 +163,45 @@ describe("stuck session diagnostics threshold", () => {

162163

});

163164

});

164165166+

it("keeps queued stale sessions eligible for lane recovery", () => {

167+

const events: DiagnosticEventPayload[] = [];

168+

const recoverStuckSession = vi.fn();

169+

const unsubscribe = onDiagnosticEvent((event) => {

170+

events.push(event);

171+

});

172+

try {

173+

startDiagnosticHeartbeat(

174+

{

175+

diagnostics: {

176+

enabled: true,

177+

stuckSessionWarnMs: 30_000,

178+

},

179+

},

180+

{ recoverStuckSession },

181+

);

182+

logMessageQueued({ sessionId: "s1", sessionKey: "main", source: "test" });

183+

logSessionStateChange({ sessionId: "s1", sessionKey: "main", state: "processing" });

184+

vi.advanceTimersByTime(61_000);

185+

} finally {

186+

unsubscribe();

187+

}

188+189+

expect(events.filter((event) => event.type === "session.long_running")).toHaveLength(0);

190+

const stuckEvents = events.filter((event) => event.type === "session.stuck");

191+

expect(stuckEvents).toHaveLength(1);

192+

expect(stuckEvents[0]).toMatchObject({

193+

classification: "stale_session_state",

194+

reason: "queued_work_without_active_run",

195+

queueDepth: 1,

196+

});

197+

expect(recoverStuckSession).toHaveBeenCalledWith({

198+

sessionId: "s1",

199+

sessionKey: "main",

200+

ageMs: expect.any(Number),

201+

queueDepth: 1,

202+

});

203+

});

204+165205

it("reports active sessions as stalled instead of stuck when active work stops progressing", () => {

166206

const events: DiagnosticEventPayload[] = [];

167207

const recoverStuckSession = vi.fn();

@@ -232,6 +272,44 @@ describe("stuck session diagnostics threshold", () => {

232272

expect(recoverStuckSession).not.toHaveBeenCalled();

233273

});

234274275+

it("keeps queued sessions non-recoverable while active work is making progress", () => {

276+

const events: DiagnosticEventPayload[] = [];

277+

const recoverStuckSession = vi.fn();

278+

const unsubscribe = onDiagnosticEvent((event) => {

279+

events.push(event);

280+

});

281+

try {

282+

startDiagnosticHeartbeat(

283+

{

284+

diagnostics: {

285+

enabled: true,

286+

stuckSessionWarnMs: 30_000,

287+

},

288+

},

289+

{ recoverStuckSession },

290+

);

291+

logMessageQueued({ sessionId: "s1", sessionKey: "main", source: "test" });

292+

logSessionStateChange({ sessionId: "s1", sessionKey: "main", state: "processing" });

293+

vi.advanceTimersByTime(45_000);

294+

markDiagnosticEmbeddedRunStarted({ sessionId: "s1", sessionKey: "main" });

295+

vi.advanceTimersByTime(16_000);

296+

} finally {

297+

unsubscribe();

298+

}

299+300+

expect(events.filter((event) => event.type === "session.stuck")).toHaveLength(0);

301+

expect(events.filter((event) => event.type === "session.stalled")).toHaveLength(0);

302+

const longRunningEvents = events.filter((event) => event.type === "session.long_running");

303+

expect(longRunningEvents).toHaveLength(1);

304+

expect(longRunningEvents[0]).toMatchObject({

305+

classification: "long_running",

306+

reason: "queued_behind_active_work",

307+

activeWorkKind: "embedded_run",

308+

queueDepth: 1,

309+

});

310+

expect(recoverStuckSession).not.toHaveBeenCalled();

311+

});

312+235313

it("starts and stops the stability recorder with the heartbeat lifecycle", () => {

236314

startDiagnosticHeartbeat({

237315

diagnostics: {