Skip to content

The agent that grows with you

fix(desktop): no provider picker or free-tier chip over the guided first launch

brooklyn!21bbab3c20a3
diff --git a/apps/desktop/src/app/shell/hooks/use-statusbar-items.tsx b/apps/desktop/src/app/shell/hooks/use-statusbar-items.tsx
index 7b3f7f3b7de..0ca0b90f4fb 100644
--- a/apps/desktop/src/app/shell/hooks/use-statusbar-items.tsx
+++ b/apps/desktop/src/app/shell/hooks/use-statusbar-items.tsx
@@ -37,6 +37,7 @@ import { copyFilePath, revealFile } from '@/store/file-actions'
import { $freeTierStatus, FREE_TIER_MODEL } from '@/store/free-tier'
import { openFreeTierSignIn } from '@/store/free-tier-sign-in'
import { revealFileInTree } from '@/store/layout'
+import { $onboardingGate, guidedOnboardingActive } from '@/store/onboarding-gate'
import { $activeGatewayProfile } from '@/store/profile'
import { $projectTree, projectNameForCwd } from '@/store/projects'
import {
@@ -139,6 +140,11 @@ export function useStatusbarItems({
// Backend truth for the free-tier chip. Refreshed on the ambient status
// cadence (use-status-snapshot), never polled from here.
const freeTier = useStore($freeTierStatus)
+ // The chip is a standing invitation to sign in. During the guided first
+ // launch that invitation lives on the guide's own ready screen; a second
+ // one in the statusbar is a distraction from the chat they are in.
+ const gatePhase = useStore($onboardingGate).phase
+ const guideOwnsSignIn = gatePhase !== 'idle' && guidedOnboardingActive()
const updateStatus = useStore($updateStatus)
const updateApply = useStore($updateApply)
const backendUpdateStatus = useStore($backendUpdateStatus)
@@ -478,7 +484,7 @@ export function useStatusbarItems({
// Shown while a free-tier identity exists and the tier is on: it names the
// identity that carries the connectors (and inference when nothing else
// does), and it is the persistent way in to the sign-in.
- hidden: !freeTier?.available,
+ hidden: !freeTier?.available || guideOwnsSignIn,
icon: <Codicon name="account" size="0.75rem" />,
id: 'free-tier',
label: freeTierCopy.providerName,
@@ -576,6 +582,7 @@ export function useStatusbarItems({
fileMenu.revealInSidebar,
freeTier?.available,
freeTier?.model,
+ guideOwnsSignIn,
gatewayMenuContent,
gatewayClassName,
gatewayDetail,
diff --git a/apps/desktop/src/store/onboarding-gate.ts b/apps/desktop/src/store/onboarding-gate.ts
index d17edbd89f3..1a622212501 100644
--- a/apps/desktop/src/store/onboarding-gate.ts
+++ b/apps/desktop/src/store/onboarding-gate.ts
@@ -40,6 +40,16 @@ function setPhase(phase: OnboardingPhase): void {
$onboardingGate.set({ phase, guideQueued: false })
}
+/** The guided first launch is on screen or mid-handoff. Ambient chrome that
+ * would send the user elsewhere (the provider picker, the free-tier chip)
+ * yields to it: the free tier IS the provider for those phases, and the
+ * guide's ready screen is where sign-in is offered. */
+export function guidedOnboardingActive(): boolean {
+ const { phase } = $onboardingGate.get()
+
+ return isOnboardingEnabled() && (phase === 'cinematic' || phase === 'guided' || phase === 'handoff')
+}
+
export function beginOnboardingFlow(): void {
if (isOnboardingEnabled() && $onboardingGate.get().phase === 'idle' && !hasSeenIntroReveal()) {
setPhase('cinematic')
diff --git a/apps/desktop/src/store/onboarding.ts b/apps/desktop/src/store/onboarding.ts
index 492f186ee30..e54eea2c560 100644
--- a/apps/desktop/src/store/onboarding.ts
+++ b/apps/desktop/src/store/onboarding.ts
@@ -17,6 +17,7 @@ import { evaluateRuntimeReadiness, type RuntimeReadinessResult } from '@/lib/run
import { setMainModelAssignment } from '@/store/cron-model-impact'
import { ackFreeTierNotice, freeTierReadyPending, refreshFreeTierStatus, setFreeTierRoute } from '@/store/free-tier'
import { notify, notifyError } from '@/store/notifications'
+import { guidedOnboardingActive } from '@/store/onboarding-gate'
import type { ModelOptionProvider, OAuthProvider, OAuthStartResponse } from '@/types/hermes'
type PkceStart = Extract<OAuthStartResponse, { flow: 'pkce' }>
@@ -484,6 +485,15 @@ async function refreshProviders() {
}
export function requestDesktopOnboarding(reason = DEFAULT_ONBOARDING_REASON) {
+ // Not during the guided first launch. The free tier carries inference
+ // there, and a credential probe that fires anyway (a free-tier token mid
+ // refresh, a setup-profile session before its runtime settles) would drop
+ // the provider picker over the guide the user is in the middle of. Sign-in
+ // is offered where the guide chooses to, on its own ready screen.
+ if (guidedOnboardingActive()) {
+ return
+ }
+
patch({ reason: reason.trim() || DEFAULT_ONBOARDING_REASON, requested: true })
}
@@ -501,7 +511,7 @@ let pendingCredentialWarning: null | string = null
export function requestDesktopOnboardingForCredentialWarning(reason: null | string | undefined) {
const warning = reason?.trim()
- if (!warning || !isProviderSetupErrorMessage(warning)) {
+ if (!warning || !isProviderSetupErrorMessage(warning) || guidedOnboardingActive()) {
pendingCredentialWarning = null
return