diff --git a/studio/frontend/src/features/chat/chat-settings-sheet.tsx b/studio/frontend/src/features/chat/chat-settings-sheet.tsx index dc57de469f..f954670c42 100644 --- a/studio/frontend/src/features/chat/chat-settings-sheet.tsx +++ b/studio/frontend/src/features/chat/chat-settings-sheet.tsx @@ -633,7 +633,8 @@ export function ChatSettingsPanel({ activeExternalProvider.baseUrl, ) && activeExternalProvider.providerType === "openai"; - const activeThreadId = useChatRuntimeStore((s) => s.activeThreadId); + // (activeThreadId is declared earlier in this component — see the + // RAG retrieval-section block above.) const openAiApiKeyForSection = activeExternalProvider ? getExternalProviderApiKey(activeExternalProvider.id) || null : null; diff --git a/studio/frontend/src/features/rag/stores/rag-store.ts b/studio/frontend/src/features/rag/stores/rag-store.ts index 02d6422748..a0434c448f 100644 --- a/studio/frontend/src/features/rag/stores/rag-store.ts +++ b/studio/frontend/src/features/rag/stores/rag-store.ts @@ -322,8 +322,10 @@ export const useRagStore = create((set, get) => ({ }, subscribeJob(jobId, onComplete) { - const existing = get().jobUnsubscribers[jobId]; - if (existing) return; + // Object indexing in TS returns V (not V|undefined) without + // noUncheckedIndexedAccess, so we test membership explicitly to + // avoid the "always-truthy function reference" lint. + if (jobId in get().jobUnsubscribers) return; const unsubscribe = subscribeToJobEvents(jobId, { onEvent: (event) => { set((state) => ({ jobs: { ...state.jobs, [jobId]: event } }));