Preserve hidden Welcome runtime aliases

Signed-off-by: kenny lopez <klopez4212@gmail.com>
This commit is contained in:
kenny lopez
2026-07-27 13:30:07 +01:00
parent 64cd41500b
commit 048d34c526
2 changed files with 34 additions and 2 deletions
@@ -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, [
@@ -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 &&