Skip to content

Commit f61ec3a

Browse files
fix(diagnostics): keep recovery scheduling out of the stuck-session warning backoff
1 parent 2f37d07 commit f61ec3a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/logging/diagnostic.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,8 @@ describe("stuck session diagnostics threshold", () => {
484484
});
485485

486486
it("keeps scheduling recovery for a recovery-eligible stuck session while warnings are throttled", () => {
487-
const stuckEvents: DiagnosticEventPayload[] = [];
488-
const recoveryRequests: DiagnosticEventPayload[] = [];
487+
const stuckEvents: Array<{ ageMs?: number }> = [];
488+
const recoveryRequests: Array<{ ageMs?: number }> = [];
489489
const recoverStuckSession = vi.fn();
490490
const unsubscribe = onDiagnosticEvent((event) => {
491491
if (event.type === "session.stuck") {
@@ -521,9 +521,11 @@ describe("stuck session diagnostics threshold", () => {
521521

522522
// Warning stays throttled: still only the single 60s warning.
523523
expect(stuckEvents).toHaveLength(1);
524+
expect(stuckEvents.map((event) => event.ageMs)).toEqual([60_000]);
524525
// Recovery was not suppressed by the warning backoff on the 90s tick.
525526
expect(recoverStuckSession).toHaveBeenCalledTimes(2);
526527
expect(recoveryRequests).toHaveLength(2);
528+
expect(recoveryRequests.map((event) => event.ageMs)).toEqual([60_000, 90_000]);
527529
});
528530

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

0 commit comments

Comments
 (0)