Skip to content

Commit 09084c5

Browse files
committed
test(diagnostics): cover stale active run recovery
1 parent b4eb023 commit 09084c5

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Docs: https://docs.openclaw.ai
3939
- Tests: give the memory fallback QA scenario enough turn budget to exercise native Windows gateway runs instead of failing on the client timeout while the mock agent is still dispatching.
4040
- Tests: collect QA gateway CPU/RSS metrics on native Windows and give the channel baseline enough turn budget to report slow gateway runs instead of timing out before proof.
4141
- Install/update: bypass npm `min-release-age` policies with `--min-release-age=0` instead of `--before` so hosted installers keep working on npm versions that reject the combined config. (#84749) Thanks @TeodoroRodrigo.
42+
- Diagnostics: reclaim wedged session lanes when stale active-run bookkeeping blocks queued work despite no forward progress. Fixes #85639. Thanks @openperf.
4243
- WebChat: keep message-tool replies visible in the chat while still summarizing internal tool results for the model. Fixes #86347. Thanks @shakkernerd.
4344
- Gateway/perf: fail startup benchmark samples when the Gateway process exits before benchmark teardown, including signal deaths after readiness probes.
4445
- Gateway/perf: fail restart benchmark samples when the Gateway exits before benchmark teardown, including clean exits and signal deaths after successful restart probes.

src/logging/diagnostic-stuck-session-recovery.runtime.test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,26 @@ describe("stuck session recovery", () => {
130130
]);
131131
});
132132

133+
it("reclaims a stale active embedded run with queued work and no forward progress (#85639)", async () => {
134+
mocks.resolveActiveEmbeddedRunHandleSessionId.mockReturnValue("session-1");
135+
mocks.getDiagnosticSessionActivitySnapshot.mockReturnValue({
136+
lastProgressAgeMs: 10 * 60_000,
137+
});
138+
mocks.abortEmbeddedPiRun.mockReturnValue(true);
139+
mocks.waitForEmbeddedPiRunEnd.mockResolvedValue(true);
140+
141+
const outcome = await recoverStuckDiagnosticSession({
142+
sessionId: "session-1",
143+
sessionKey: "agent:main:main",
144+
ageMs: 180_000,
145+
queueDepth: 1,
146+
});
147+
148+
expect(mocks.abortEmbeddedPiRun).toHaveBeenCalledWith("session-1");
149+
expect(outcome.status).toBe("aborted");
150+
expect(warnLogMessages().some((m) => m.includes("reclaiming stale active run"))).toBe(true);
151+
});
152+
133153
it("aborts an active embedded run when active abort recovery is enabled", async () => {
134154
mocks.resolveActiveEmbeddedRunHandleSessionId.mockReturnValue("session-1");
135155
mocks.abortEmbeddedPiRun.mockReturnValue(true);

0 commit comments

Comments
 (0)