From 732db752790e36c824f14f0e0684f510b3cbf544 Mon Sep 17 00:00:00 2001 From: Ivan Fofanov Date: Wed, 15 Apr 2026 02:31:55 -0400 Subject: [PATCH] fix: classify "No conversation found" as session_expired (#65028) Merged via squash. Prepared head SHA: f429ba2de08ce5ebc76e161ddc6d58450b53c761 Co-authored-by: Ivan-Fn <1247214+Ivan-Fn@users.noreply.github.com> Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com> Reviewed-by: @altaywtf --- CHANGELOG.md | 1 + .../pi-embedded-helpers.isbillingerrormessage.test.ts | 6 ++++++ src/agents/pi-embedded-helpers/errors.ts | 1 + 3 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa0b3dce56b..2cf420bf540 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ Docs: https://docs.openclaw.ai - Audio/self-hosted STT: restore `models.providers.*.request.allowPrivateNetwork` for audio transcription so private or LAN speech-to-text endpoints stop tripping SSRF blocks after the v2026.4.14 regression. (#66692) Thanks @jhsmith409. - QQBot/cron: guard against undefined `event.content` in `parseFaceTags` and `filterInternalMarkers` so cron-triggered agent turns with no content payload no longer crash with `TypeError: Cannot read properties of undefined (reading 'startsWith')`. (#66302) Thanks @xinmotlanthua. - CLI/plugins: stop `--dangerously-force-unsafe-install` plugin installs from falling back to hook-pack installs after security scan failures, while still preserving non-security fallback behavior for real hook packs. (#58909) Thanks @hxy91819. +- Claude CLI/sessions: classify `No conversation found with session ID` as `session_expired` so expired CLI-backed conversations clear the stale binding and recover on the next turn. (#65028) thanks @Ivan-Fn. ## 2026.4.14 diff --git a/src/agents/pi-embedded-helpers.isbillingerrormessage.test.ts b/src/agents/pi-embedded-helpers.isbillingerrormessage.test.ts index 7dfe826e158..a78cf977729 100644 --- a/src/agents/pi-embedded-helpers.isbillingerrormessage.test.ts +++ b/src/agents/pi-embedded-helpers.isbillingerrormessage.test.ts @@ -648,6 +648,12 @@ describe("classifyFailoverReason", () => { expect(classifyFailoverReason("410 conversation expired")).toBe("session_expired"); }); + it("classifies 'No conversation found' from Claude CLI as session_expired", () => { + expect(classifyFailoverReason("No conversation found with session ID: abc123")).toBe( + "session_expired", + ); + }); + it("keeps explicit billing and auth signals on 410 text", () => { expect(classifyFailoverReason("HTTP 410: invalid_api_key")).toBe("auth"); expect(classifyFailoverReason("HTTP 410: authentication failed")).toBe("auth"); diff --git a/src/agents/pi-embedded-helpers/errors.ts b/src/agents/pi-embedded-helpers/errors.ts index e81407f6e9c..68deb227ae0 100644 --- a/src/agents/pi-embedded-helpers/errors.ts +++ b/src/agents/pi-embedded-helpers/errors.ts @@ -1109,6 +1109,7 @@ function isCliSessionExpiredErrorMessage(raw: string): boolean { lower.includes("session expired") || lower.includes("session invalid") || lower.includes("conversation not found") || + lower.includes("no conversation found") || lower.includes("conversation does not exist") || lower.includes("conversation expired") || lower.includes("conversation invalid") ||