Skip to content

Commit bcd15f6

Browse files
authored
Restore Goose and Buzz Agent to onboarding harness selection (#2731)
> [!NOTE] > **Part 1 of a multi-PR onboarding rework.** This PR only restores the hidden harnesses, adjusts the card layout, and gates onboarding completion on valid config. A follow-up PR (stacked on this branch) restructures the flow: the harness page becomes a single-choice "pick your default harness" step, and install/sign-in/provider setup moves to the following page. Review this one on its own terms — the flow rework is intentionally not here. ## Summary - Restore **Goose** and **Buzz Agent** to onboarding harness selection, reverting the launch-only restriction from #2233 - The restore is the single centralized allowlist (`ONBOARDING_RUNTIME_ORDER` in `onboardingRuntimeSelection.ts`) that #2233 deliberately set up for this moment — setup cards, readiness handoff, and the defaults harness picker all derive from it - Lay the four harness cards out as a single row at `lg` and above (`lg:grid-cols-4`); below 1024px (including the app's 800px minimum window width) the grid is 2×2, and 1-up on narrow viewports - **Gate onboarding Finish on actual config validity** (review finding): the defaults page rendered provider/model/credential fields for provider-required harnesses but Finish only checked that a harness was selected — a fresh user picking Buzz Agent could persist a default that fails at first spawn. The Finish gate now consumes `AgentConfigFields`' existing `onValidityChange` signal. Baked build env and runtime-file config satisfy the gate, so internal builds and existing Goose users are never blocked - Update the unit + E2E specs that pinned the hidden behavior, plus two new E2E cases pinning the Finish gate (blocked-until-configured, and baked-env never blocked) - AGENTS.md rule 7 updated to document the completion gate ## Testing - `onboardingRuntimeSelection.test.mjs` — 4 passed - `pnpm typecheck` — clean - `pnpm exec playwright test tests/e2e/onboarding-agent-defaults.spec.ts --project=smoke` — 21 passed - `onboarding-docked-cta-screenshots.spec.ts` — 3 passed - Biome — clean ## Known cosmetic issue (deferred to PR 2) At the app's minimum window size (800×500) the 2×2 grid extends past the visible area and the footer CTA overlaps card space. Next still hit-tests correctly. PR 2 redesigns this page entirely (cards become a single-choice chooser with no inline setup), so this is deferred rather than patched twice. --------- Signed-off-by: morgmart <[email protected]>
1 parent 34272e8 commit bcd15f6

6 files changed

Lines changed: 125 additions & 22 deletions

File tree

‎desktop/src/features/agents/AGENTS.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ with a TypeScript lookup table or an id comparison in a component.
6767
7. **Onboarding setup detects readiness; it does not select defaults.** The
6868
setup page derives visible and ready harnesses from the runtime catalog and
6969
only offers install or sign-in actions. The following defaults page is the
70-
sole onboarding surface that chooses and persists `preferred_runtime`.
70+
sole onboarding surface that chooses and persists `preferred_runtime`, and
71+
its Finish gate consumes the shared renderer's `onValidityChange` signal —
72+
a harness selection alone does not complete onboarding when the harness
73+
requires provider/model/credential config (e.g. buzz-agent with no
74+
provider). Baked build env and runtime-file config satisfy the gate.
7175
`onboarding-agent-defaults.spec.ts` is the acceptance gate for anything
7276
touching this flow or the shared renderer.
7377
8. **Omit the Model control only after a confirmed successful empty

‎desktop/src/features/onboarding/ui/DefaultConfigStep.tsx‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ function AgentDefaultsSection({
6868
cancel: () => void;
6969
} | null>(null);
7070
const [isSaving, setIsSaving] = React.useState(false);
71+
const [configIsValid, setConfigIsValid] = React.useState(false);
7172

7273
React.useEffect(() => {
7374
let unmounted = false;
@@ -187,10 +188,19 @@ function AgentDefaultsSection({
187188
);
188189
React.useEffect(() => {
189190
onPersistenceStateChange({
190-
canComplete: selectedRuntimeId.length > 0 && !isSaving,
191+
// configIsValid comes from AgentConfigFields' onValidityChange and
192+
// covers model + provider credentials — a harness selection alone is
193+
// not a working default (e.g. buzz-agent with no provider configured).
194+
canComplete: selectedRuntimeId.length > 0 && configIsValid && !isSaving,
191195
flush: flushPersistence,
192196
});
193-
}, [flushPersistence, isSaving, onPersistenceStateChange, selectedRuntimeId]);
197+
}, [
198+
configIsValid,
199+
flushPersistence,
200+
isSaving,
201+
onPersistenceStateChange,
202+
selectedRuntimeId,
203+
]);
194204

195205
return (
196206
<section className="w-full space-y-4 text-left text-sm">
@@ -239,6 +249,7 @@ function AgentDefaultsSection({
239249
}}
240250
onCustomModelEditingChange={setIsCustomModelEditing}
241251
onIsCustomProviderChange={setIsCustomProvider}
252+
onValidityChange={setConfigIsValid}
242253
placeholderClassName="text-foreground/70"
243254
runtimeFileConfig={runtimeFileConfig}
244255
selectClassName="h-12 rounded-2xl border-foreground/15 bg-white px-4 py-2 text-sm shadow-none hover:bg-white/95"

‎desktop/src/features/onboarding/ui/SetupStep.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ function RuntimeProvidersSection({
615615

616616
<div className="flex w-full flex-1 flex-col items-center justify-center gap-8 py-10">
617617
{orderedItems.length > 0 ? (
618-
<div className="grid min-w-0 w-full max-w-[592px] grid-cols-1 gap-4 md:grid-cols-2">
618+
<div className="grid min-w-0 w-full max-w-[1200px] grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-4">
619619
{orderedItems.map((runtime) => (
620620
<RuntimeCard
621621
installResults={installResults}

‎desktop/src/features/onboarding/ui/onboardingRuntimeSelection.test.mjs‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ function runtime(id, availability, status) {
1212
return { id, availability, authStatus: { status } };
1313
}
1414

15-
test("only Claude Code and Codex are visible in onboarding", () => {
15+
test("all bundled harnesses are visible in onboarding", () => {
1616
assert.equal(runtimeIsVisibleInOnboarding("claude"), true);
1717
assert.equal(runtimeIsVisibleInOnboarding("codex"), true);
18-
assert.equal(runtimeIsVisibleInOnboarding("goose"), false);
19-
assert.equal(runtimeIsVisibleInOnboarding("buzz-agent"), false);
18+
assert.equal(runtimeIsVisibleInOnboarding("goose"), true);
19+
assert.equal(runtimeIsVisibleInOnboarding("buzz-agent"), true);
2020
assert.equal(runtimeIsVisibleInOnboarding("custom"), false);
2121
});
2222

@@ -30,7 +30,7 @@ test("visible onboarding runtimes use the product order", () => {
3030

3131
assert.deepEqual(
3232
getVisibleOnboardingRuntimes(runtimes).map(({ id }) => id),
33-
["claude", "codex"],
33+
["claude", "codex", "goose", "buzz-agent"],
3434
);
3535
});
3636

@@ -55,16 +55,17 @@ test("readiness requires an available and authenticated runtime", () => {
5555
);
5656
});
5757

58-
test("ready onboarding runtimes exclude hidden ready harnesses", () => {
58+
test("ready onboarding runtimes exclude unknown and non-ready harnesses", () => {
5959
const runtimes = [
6060
runtime("goose", "available", "not_applicable"),
6161
runtime("codex", "available", "logged_out"),
6262
runtime("buzz-agent", "available", "not_applicable"),
6363
runtime("claude", "available", "logged_in"),
64+
runtime("custom", "available", "not_applicable"),
6465
];
6566

6667
assert.deepEqual(
6768
getReadyOnboardingRuntimes(runtimes).map(({ id }) => id),
68-
["claude"],
69+
["claude", "goose", "buzz-agent"],
6970
);
7071
});

‎desktop/src/features/onboarding/ui/onboardingRuntimeSelection.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import type { AcpRuntimeCatalogEntry } from "@/shared/api/types";
22

3-
export const ONBOARDING_RUNTIME_ORDER = ["claude", "codex"];
3+
export const ONBOARDING_RUNTIME_ORDER = [
4+
"claude",
5+
"codex",
6+
"goose",
7+
"buzz-agent",
8+
];
49

510
const VISIBLE_ONBOARDING_RUNTIME_IDS = new Set<string>(
611
ONBOARDING_RUNTIME_ORDER,

‎desktop/tests/e2e/onboarding-agent-defaults.spec.ts‎

Lines changed: 93 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ async function readSavedRuntime(page: Parameters<typeof installMockBridge>[0]) {
5757
});
5858
}
5959

60-
test("setup shows only Claude Code and Codex as detected harnesses", async ({
61-
page,
62-
}) => {
60+
test("setup shows all bundled harnesses as detected", async ({ page }) => {
6361
await installMockBridge(
6462
page,
6563
{
@@ -77,10 +75,8 @@ test("setup shows only Claude Code and Codex as detected harnesses", async ({
7775

7876
await expect(page.getByTestId("onboarding-runtime-claude")).toBeVisible();
7977
await expect(page.getByTestId("onboarding-runtime-codex")).toBeVisible();
80-
await expect(page.getByTestId("onboarding-runtime-goose")).toHaveCount(0);
81-
await expect(page.getByTestId("onboarding-runtime-buzz-agent")).toHaveCount(
82-
0,
83-
);
78+
await expect(page.getByTestId("onboarding-runtime-goose")).toBeVisible();
79+
await expect(page.getByTestId("onboarding-runtime-buzz-agent")).toBeVisible();
8480
await expect(page.getByRole("checkbox")).toHaveCount(0);
8581
});
8682

@@ -559,8 +555,8 @@ test("defaults auto-selects the only ready visible harness", async ({
559555
page,
560556
{
561557
acpRuntimesCatalog: [
562-
runtime("buzz-agent", "available", { status: "not_applicable" }),
563-
runtime("goose", "available", { status: "not_applicable" }),
558+
runtime("buzz-agent", "not_installed", { status: "not_applicable" }),
559+
runtime("goose", "not_installed", { status: "not_applicable" }),
564560
runtime("claude", "available", { status: "logged_in" }),
565561
runtime("codex", "available", { status: "logged_out" }),
566562
],
@@ -660,10 +656,10 @@ test("defaults requires a choice when multiple visible harnesses are ready", asy
660656
).toBeVisible();
661657
await expect(
662658
page.getByTestId("global-agent-default-harness-option-goose"),
663-
).toHaveCount(0);
659+
).toBeVisible();
664660
await expect(
665661
page.getByTestId("global-agent-default-harness-option-buzz-agent"),
666-
).toHaveCount(0);
662+
).toBeVisible();
667663
await page.getByTestId("global-agent-default-harness-option-codex").click();
668664
await expect(harness).toHaveText("Codex");
669665
await expect(page.getByTestId("onboarding-finish")).toBeEnabled();
@@ -836,3 +832,89 @@ test("concurrent installs each keep their own state — one fails, one succeeds"
836832
});
837833
expect(hasHorizontalOverflow).toBe(false);
838834
});
835+
836+
test("Finish stays disabled until a provider-required harness is fully configured", async ({
837+
page,
838+
}) => {
839+
await installMockBridge(
840+
page,
841+
{
842+
acpRuntimesCatalog: [
843+
runtime("buzz-agent", "available", { status: "not_applicable" }),
844+
],
845+
discoverAgentModels: {
846+
models: [{ id: "claude-sonnet-4", name: "Claude Sonnet 4" }],
847+
supportsSwitching: true,
848+
},
849+
globalAgentConfig: {
850+
env_vars: {},
851+
provider: null,
852+
model: null,
853+
preferred_runtime: null,
854+
},
855+
},
856+
{ skipCommunitySeed: true, skipOnboardingSeed: true },
857+
);
858+
await page.goto("/");
859+
await navigateToSetupPage(page);
860+
await page.getByTestId("onboarding-setup-next").click();
861+
await expect(page.getByTestId("onboarding-page-config")).toBeVisible();
862+
863+
// buzz-agent auto-selects as the only ready harness, but with no provider
864+
// configured the default is not launchable — Finish must be gated.
865+
await expect(page.getByTestId("global-agent-default-harness")).toHaveText(
866+
"Buzz",
867+
);
868+
const finish = page.getByTestId("onboarding-finish");
869+
await expect(finish).toBeDisabled();
870+
871+
// Configure provider + credential; model resolves via discovery/fallback.
872+
await page.getByTestId("global-agent-provider").click();
873+
await page.getByTestId("global-agent-provider-option-anthropic").click();
874+
await page.getByTestId("persona-provider-api-key").fill("sk-test-key");
875+
876+
await expect(finish).toBeEnabled();
877+
await finish.click();
878+
await expect(page.getByText("Join or create a community")).toBeVisible();
879+
expect(await readSavedRuntime(page)).toBe("buzz-agent");
880+
});
881+
882+
test("baked build config keeps Finish enabled without manual provider setup", async ({
883+
page,
884+
}) => {
885+
await installMockBridge(
886+
page,
887+
{
888+
acpRuntimesCatalog: [
889+
runtime("buzz-agent", "available", { status: "not_applicable" }),
890+
],
891+
bakedBuildEnv: [
892+
{ key: "BUZZ_AGENT_PROVIDER", masked: false, value: "databricks_v2" },
893+
{
894+
key: "DATABRICKS_HOST",
895+
masked: false,
896+
value: "https://example.cloud.databricks.com",
897+
},
898+
{ key: "DATABRICKS_MODEL", masked: false, value: "baked-model" },
899+
],
900+
globalAgentConfig: {
901+
env_vars: {},
902+
provider: null,
903+
model: null,
904+
preferred_runtime: null,
905+
},
906+
},
907+
{ skipCommunitySeed: true, skipOnboardingSeed: true },
908+
);
909+
await page.goto("/");
910+
await navigateToSetupPage(page);
911+
await page.getByTestId("onboarding-setup-next").click();
912+
await expect(page.getByTestId("onboarding-page-config")).toBeVisible();
913+
914+
// Internal builds bake provider/model/credentials — the gate must treat
915+
// baked config as complete and never block Finish.
916+
await expect(page.getByTestId("global-agent-default-harness")).toHaveText(
917+
"Buzz",
918+
);
919+
await expect(page.getByTestId("onboarding-finish")).toBeEnabled();
920+
});

0 commit comments

Comments
 (0)