The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(desktop): keep terminal instructions off the provider picker
alt-glitcha34e692d293a
diff --git a/apps/desktop/src/lib/runtime-readiness.ts b/apps/desktop/src/lib/runtime-readiness.tsindex 6909d243941..8a2342845f2 100644--- a/apps/desktop/src/lib/runtime-readiness.ts+++ b/apps/desktop/src/lib/runtime-readiness.ts@@ -52,6 +52,9 @@ export interface RuntimeReadinessResult {ready: booleanreason: null | stringsource: 'fallback' | 'runtime_check' | 'setup_status'+ /** The check failed and setup.status says no provider is set up at all: `reason` is then the+ * check's own sentence for "nothing is set up", not a cause. */+ unconfigured?: true}export type RuntimeReadinessDisplay = 'checking' | 'needs_setup' | 'ready' | 'unavailable'@@ -160,7 +163,8 @@ export function interpretRuntimeReadiness(checksDisagree,ready: false,reason,- source: 'runtime_check'+ source: 'runtime_check',+ ...(setupConfigured === false ? { unconfigured: true as const } : {})}}diff --git a/apps/desktop/src/store/onboarding.test.ts b/apps/desktop/src/store/onboarding.test.tsindex d33117fd94b..3731916cf34 100644--- a/apps/desktop/src/store/onboarding.test.ts+++ b/apps/desktop/src/store/onboarding.test.ts@@ -10,6 +10,7 @@ import {$desktopOnboarding,completeDesktopOnboarding,confirmOnboardingModel,+ DEFAULT_ONBOARDING_REASON,type DesktopOnboardingState,type OnboardingContext,refreshOnboarding,@@ -208,6 +209,23 @@ describe('refreshOnboarding', () => {expect($desktopOnboarding.get().reason).toContain('setup.status reports configured credentials')})+ it('shows no sentence of its own over the picker when nothing is set up', async () => {+ const unconfigured: OnboardingContext['requestGateway'] = async method => {+ if (method === 'setup.status') {+ return { provider_configured: false } as never+ }++ if (method === 'setup.runtime_check') {+ return { ok: false, error: 'Hermes is not connected to any AI provider yet. Run `hermes model` to pick one.' } as never+ }++ throw new Error(`unexpected gateway method: ${method}`)+ }++ expect(await refreshOnboarding(onboardingContext(unconfigured))).toBe(false)+ expect($desktopOnboarding.get()).toMatchObject({ configured: false, reason: DEFAULT_ONBOARDING_REASON })+ })+it('keeps cached providers when onboarding was not re-requested', async () => {const api = vi.fn(async ({ path }: { path: string }) => {if (path === '/api/providers/oauth') {diff --git a/apps/desktop/src/store/onboarding.ts b/apps/desktop/src/store/onboarding.tsindex acf828dff80..9f76296c6f1 100644--- a/apps/desktop/src/store/onboarding.ts+++ b/apps/desktop/src/store/onboarding.ts@@ -818,7 +818,9 @@ export async function refreshOnboarding(ctx: OnboardingContext, stillWanted?: ()return false}- const reason = runtime.reason || state.reason || DEFAULT_ONBOARDING_REASON+ // With nothing set up the check's sentence restates the picker in terminal terms (CLI commands, the+ // home path), so the default stands.+ const reason = (runtime.unconfigured ? null : runtime.reason) || state.reason || DEFAULT_ONBOARDING_REASONif (shouldPreserveConfiguredOnBootRace(runtime, state)) {// The backend answered inside its boot window with a not-ready that is