mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 08:50:43 +00:00
fix: classify "No conversation found" as session_expired
Claude CLI returns "No conversation found with session ID: <id>" when resuming an expired session. The existing error classifier checks for "conversation not found" but misses the "no conversation found" phrasing, so the session-expired recovery path (clear stale binding, retry with fresh session) never fires. This causes follow-up messages in CLI-backend conversations to fail permanently instead of transparently creating a new session. Added "no conversation found" to isCliSessionExpiredErrorMessage() alongside the existing "conversation not found" pattern.
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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") ||
|
||||
|
||||
Reference in New Issue
Block a user