diff --git a/apps/nextjs/src/components/assistant/assistant-provider.tsx b/apps/nextjs/src/components/assistant/assistant-provider.tsx index 4657bccce..f68a69380 100644 --- a/apps/nextjs/src/components/assistant/assistant-provider.tsx +++ b/apps/nextjs/src/components/assistant/assistant-provider.tsx @@ -126,6 +126,7 @@ const createAssistantAttachmentAdapter = (allowImages: boolean): AttachmentAdapt }; const AssistantPreferencesProvider = ({ children }: PropsWithChildren) => { + const t = useScopedI18n("common.assistant"); const { data, isLoading } = clientApi.assistant.getRuntimeOptions.useQuery(undefined, { staleTime: 10 * 60_000, }); @@ -192,9 +193,9 @@ const AssistantPreferencesProvider = ({ children }: PropsWithChildren) => { try { const nextQuota = await workshopClient.getAssistantUsage(controller.signal); if (quotaRequestRef.current === controller && !controller.signal.aborted) setQuota(nextQuota); - } catch (error) { + } catch { if (quotaRequestRef.current === controller && !controller.signal.aborted) { - setQuotaError(error instanceof Error ? error.message : "The Homarr provider allowance could not be loaded."); + setQuotaError(t("providerQuota.loadError")); } } finally { if (quotaRequestRef.current === controller) { @@ -202,7 +203,7 @@ const AssistantPreferencesProvider = ({ children }: PropsWithChildren) => { setQuotaLoading(false); } } - }, [data?.provider, workshopClient]); + }, [data?.provider, t, workshopClient]); const signInToProvider = useCallback(async () => { setQuotaLoading(true); setQuotaError(null); @@ -211,12 +212,12 @@ const AssistantPreferencesProvider = ({ children }: PropsWithChildren) => { setProviderUser(user); await refreshQuota(); } catch (error) { - setQuotaError(error instanceof Error ? error.message : "GitHub sign-in failed."); + setQuotaError(t("providerQuota.signInError")); throw error; } finally { setQuotaLoading(false); } - }, [refreshQuota, workshopClient]); + }, [refreshQuota, t, workshopClient]); useEffect(() => { if (!data) return; diff --git a/apps/workshop/test.sh b/apps/workshop/test.sh index 067cb8eed..826920b4b 100644 --- a/apps/workshop/test.sh +++ b/apps/workshop/test.sh @@ -62,7 +62,7 @@ for client_id in workshop-test-client workshop-rotated-client; do node apps/workshop/tests/oauth-sync.integration.mjs done -OPENROUTER_API_KEY= PB_EXPOSE_PORT="$WORKSHOP_TEST_PORT" docker compose -p "$WORKSHOP_TEST_PROJECT" \ +OPENROUTER_API_KEY="" PB_EXPOSE_PORT="$WORKSHOP_TEST_PORT" docker compose -p "$WORKSHOP_TEST_PROJECT" \ -f apps/workshop/docker-compose.yml up -d --force-recreate workshop for attempt in $(seq 1 60); do if curl --fail --silent "http://127.0.0.1:$WORKSHOP_TEST_PORT/api/health" >/dev/null; then diff --git a/packages/translation/src/lang/en.json b/packages/translation/src/lang/en.json index c926b64c3..594482ef0 100644 --- a/packages/translation/src/lang/en.json +++ b/packages/translation/src/lang/en.json @@ -2094,6 +2094,8 @@ "exhaustedDescription": "Your Homarr provider allowance is used for today. It resets at midnight UTC.", "unavailableDescription": "Sign in to the Workshop or wait for your Homarr provider allowance to reset.", "signIn": "Sign in with GitHub", + "signInError": "GitHub sign-in failed. Try again in a moment.", + "loadError": "The Homarr provider allowance could not be loaded.", "reset": "Resets {relative} at ", "toolCalls": "Each model request and completed tool call uses one request.", "retry": "Reload allowance",