From 367403bc1daf867e189c37239d8bd28b75a5ff72 Mon Sep 17 00:00:00 2001 From: Mahmoud Mabrouk Date: Thu, 30 Jul 2026 16:35:51 +0200 Subject: [PATCH] fix(frontend): skip the sessions query on the onboarding scope (#5580) The playground onboarding view fired POST /sessions/query with the synthetic reference id "onboarding", which is not a UUID, so the API answered 422 and the console logged an error on every landing. Add ONBOARDING_SCOPE_KEY to the existing isQueryableScope gate so TanStack Query stays disabled during onboarding. With a real agent selected the scope key is the app UUID and the query behaves exactly as before. Claude-Session: https://claude.ai/code/session_01Qitvc9dCiunLishsJYRzbp --- .../components/AgentChatSlice/state/projectSessions.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/web/oss/src/components/AgentChatSlice/state/projectSessions.ts b/web/oss/src/components/AgentChatSlice/state/projectSessions.ts index c5ba06b222..376ab4d0ef 100644 --- a/web/oss/src/components/AgentChatSlice/state/projectSessions.ts +++ b/web/oss/src/components/AgentChatSlice/state/projectSessions.ts @@ -7,6 +7,7 @@ import {atomWithQuery} from "jotai-tanstack-query" import {projectIdAtom} from "@/oss/state/project" +import {ONBOARDING_SCOPE_KEY} from "./scope" import { GLOBAL_APP_KEY, reconcileServerSessionsAtomFamily, @@ -21,10 +22,14 @@ import { * * Mirrors `liveness.ts`: ONE low-priority query per agent backs the whole list, revalidated on tab * refocus and on a slow interval, so it stays out of the live conversation's way. Disabled for the - * non-agent scopes (`__global__`, the revision drawer) where there is no artifact id to match. + * non-agent scopes (`__global__`, the revision drawer, the pre-commit onboarding) where there is no + * artifact id to match — a synthetic key sent as a reference id would just 422 on the API. */ const isQueryableScope = (appId: string): boolean => - Boolean(appId) && appId !== GLOBAL_APP_KEY && !appId.startsWith("drawer:") + Boolean(appId) && + appId !== GLOBAL_APP_KEY && + appId !== ONBOARDING_SCOPE_KEY && + !appId.startsWith("drawer:") export const projectSessionsQueryAtomFamily = atomFamily((appId: string) => atomWithQuery((get) => {