diff --git a/desktop/src/features/onboarding/welcomeGuide.test.mjs b/desktop/src/features/onboarding/welcomeGuide.test.mjs index 2fe0bc1b3..bd009bd71 100644 --- a/desktop/src/features/onboarding/welcomeGuide.test.mjs +++ b/desktop/src/features/onboarding/welcomeGuide.test.mjs @@ -321,6 +321,36 @@ test("existing Welcome starter keeps its runtime when that harness is hidden", ( ); }); +test("existing Welcome starter keeps an aliased runtime when that harness is hidden", () => { + const existing = makeAgent({ + personaId: WELCOME_GUIDE_PERSONA_ID, + agentCommand: "claude-code-acp", + agentArgs: [], + }); + + assert.equal( + welcomeStarterRuntimeUpdate( + existing, + { + name: "Fizz", + agentCommand: "goose", + agentArgs: [], + mcpCommand: "", + model: null, + provider: null, + }, + { + runtimes: [ + { id: "claude", command: "claude-agent-acp" }, + { id: "goose", command: "goose" }, + ], + disabledRuntimeIds: ["claude"], + }, + ), + null, + ); +}); + test("welcome team starter definitions and role identities are stable", () => { assert.equal(WELCOME_TEAM_ID, "builtin-team:welcome"); assert.deepEqual(WELCOME_TEAM_STARTERS, [ diff --git a/desktop/src/features/onboarding/welcomeGuide.ts b/desktop/src/features/onboarding/welcomeGuide.ts index f1f9f274d..91de5d8d7 100644 --- a/desktop/src/features/onboarding/welcomeGuide.ts +++ b/desktop/src/features/onboarding/welcomeGuide.ts @@ -1,3 +1,4 @@ +import { commandsMatch } from "@/features/agents/agentReuse"; import { buildInstanceInputForDefinition, resolveStartRuntimeForDefinition, @@ -246,8 +247,9 @@ export function welcomeStarterRuntimeUpdate( const existingRuntime = visibility?.runtimes.find( (runtime) => - runtime.command?.trim() === existing.agentCommand.trim() || - runtime.id.trim() === existing.agentCommand.trim(), + (runtime.command + ? commandsMatch(existing.agentCommand, runtime.command) + : false) || commandsMatch(existing.agentCommand, runtime.id), ); if ( existingRuntime &&