From 64cd41500bb75d8e93767fdb70b4d50677dd539b Mon Sep 17 00:00:00 2001 From: kenny lopez Date: Fri, 24 Jul 2026 10:25:15 -0700 Subject: [PATCH] Filter hidden runtimes from welcome readiness Signed-off-by: kenny lopez --- .../onboarding/welcomeKickoff.test.mjs | 23 +++++++++++++ .../src/features/onboarding/welcomeKickoff.ts | 33 +++++++++++++++++-- 2 files changed, 53 insertions(+), 3 deletions(-) diff --git a/desktop/src/features/onboarding/welcomeKickoff.test.mjs b/desktop/src/features/onboarding/welcomeKickoff.test.mjs index 6f472b806..08d1287dd 100644 --- a/desktop/src/features/onboarding/welcomeKickoff.test.mjs +++ b/desktop/src/features/onboarding/welcomeKickoff.test.mjs @@ -9,6 +9,7 @@ import { classifyWelcomeKickoffResolution, createWelcomeKickoffCoordinator, mergeKickoffEvents, + resolveWelcomeAgentReadiness, resolveWelcomeAgentSet, selectWelcomeKickoffIntroTeammates, waitForWelcomeKickoffBeat, @@ -33,6 +34,28 @@ const fizz = agent("Fizz", "builtin:fizz", "f".repeat(64)); const honey = agent("Honey", "builtin:honey", "h".repeat(64)); const bumble = agent("Bumble", "builtin:bumble", "b".repeat(64)); +test("welcome readiness ignores a hidden logged-in runtime", () => { + const runtimes = [ + { + id: "claude", + label: "Claude", + availability: "available", + authStatus: { status: "logged_in" }, + }, + ]; + const globalConfig = { + env_vars: {}, + provider: null, + model: null, + preferred_runtime: null, + }; + + assert.deepEqual( + resolveWelcomeAgentReadiness(runtimes, globalConfig, ["claude"]), + { ready: false }, + ); +}); + test("resolveWelcomeAgentSet orders agents by stable persona identity", () => { assert.deepEqual(resolveWelcomeAgentSet([bumble, fizz, honey]), { lead: fizz, diff --git a/desktop/src/features/onboarding/welcomeKickoff.ts b/desktop/src/features/onboarding/welcomeKickoff.ts index 93a552001..d89e7247d 100644 --- a/desktop/src/features/onboarding/welcomeKickoff.ts +++ b/desktop/src/features/onboarding/welcomeKickoff.ts @@ -5,6 +5,10 @@ import { useAcpRuntimesQuery, useManagedAgentsQuery, } from "@/features/agents/hooks"; +import { + filterEnabledAcpRuntimes, + useDisabledAcpRuntimeIds, +} from "@/features/agents/lib/runtimeVisibilityPreference"; import { clearActiveTurnsForAgentOnStop } from "@/features/agents/managedAgentRuntimeHooks"; import { useImplicitGlobalAgentConfig } from "@/features/agents/useGlobalAgentConfig"; import { useCommunities } from "@/features/communities/useCommunities"; @@ -27,7 +31,13 @@ import { hasManagedAgentChannelMessageMarker } from "@/shared/api/tauriManagedAg import { sendManagedAgentChannelMessage } from "@/shared/api/tauriManagedAgentMessages"; import { getPresence, listManagedAgents } from "@/shared/api/tauri"; import { getProfile } from "@/shared/api/tauriProfiles"; -import type { Channel, ManagedAgent, RelayEvent } from "@/shared/api/types"; +import type { + AcpRuntimeCatalogEntry, + Channel, + GlobalAgentConfig, + ManagedAgent, + RelayEvent, +} from "@/shared/api/types"; import { normalizePubkey } from "@/shared/lib/pubkey"; import { useQueryClient } from "@tanstack/react-query"; @@ -46,6 +56,17 @@ export const WELCOME_KICKOFF_PROVIDER_MESSAGE = const WELCOME_KICKOFF_CTA = "What can we help you build? Bring us something you're working on, or give us a quick challenge to see how we work together."; +export function resolveWelcomeAgentReadiness( + runtimes: readonly AcpRuntimeCatalogEntry[], + globalConfig: GlobalAgentConfig, + disabledRuntimeIds: readonly string[], +) { + return resolveAgentReadiness( + filterEnabledAcpRuntimes(runtimes, disabledRuntimeIds), + globalConfig, + ); +} + function formatAgentNames(agents: readonly ManagedAgent[]) { if (agents.length === 0) return ""; if (agents.length === 1) return agents[0]?.name ?? ""; @@ -496,6 +517,7 @@ export function useWelcomeKickoff( const { activeCommunity } = useCommunities(); const runtimesQuery = useAcpRuntimesQuery(); const managedAgentsQuery = useManagedAgentsQuery(); + const disabledRuntimeIds = useDisabledAcpRuntimeIds(); const { globalConfig, isLoading: configLoading } = useImplicitGlobalAgentConfig(); const channelId = activeChannel?.id ?? null; @@ -549,8 +571,13 @@ export function useWelcomeKickoff( [activeCommunity?.relayUrl, managedAgentsQuery.data], ); const readiness = React.useMemo( - () => resolveAgentReadiness(runtimesQuery.data ?? [], globalConfig), - [globalConfig, runtimesQuery.data], + () => + resolveWelcomeAgentReadiness( + runtimesQuery.data ?? [], + globalConfig, + disabledRuntimeIds, + ), + [disabledRuntimeIds, globalConfig, runtimesQuery.data], ); React.useEffect(() => { if (