From 117de25ce2086015332072edf16d34763c17d56e Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 15 Nov 2026 09:23:55 +0000 Subject: [PATCH] Correct comments that no longer match the code. The unhandled control-plane response includes the S0Api error body, and a session WebSocket error clears history loading for every error, not only a rejected history fetch. Co-authored-by: Jonathan Beckman --- apps/web/src/hooks/use-session-socket.ts | 2 +- packages/api/src/server/effect/handlers/shared/control-plane.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/src/hooks/use-session-socket.ts b/apps/web/src/hooks/use-session-socket.ts index 58981e3..1c93391 100644 --- a/apps/web/src/hooks/use-session-socket.ts +++ b/apps/web/src/hooks/use-session-socket.ts @@ -441,7 +441,7 @@ export function useSessionSocket(sessionId: string): UseSessionSocketReturn { case "error": console.error("Session error:", data) - // Reset loading state if a fetch_history request was rejected + // Any session error ends history pagination loading, including a rejected fetch_history. setLoadingHistory(false) break } diff --git a/packages/api/src/server/effect/handlers/shared/control-plane.ts b/packages/api/src/server/effect/handlers/shared/control-plane.ts index 0c151d8..aa3e607 100644 --- a/packages/api/src/server/effect/handlers/shared/control-plane.ts +++ b/packages/api/src/server/effect/handlers/shared/control-plane.ts @@ -199,7 +199,7 @@ export const logControlPlaneError = Effect.fn("controlPlane.logError")(function* export { describeError } -/** Logs an unhandled control-plane error and renders the legacy 500 response. */ +/** Logs an unhandled error and returns a 500 with the S0Api error body plus the legacy `error` field. */ const respondUnhandledError = Effect.fn("controlPlane.respondUnhandledError")(function* ( cause: unknown, ) {