From e7316c3518a998fa38e4ff912a8d76fbf7028e12 Mon Sep 17 00:00:00 2001 From: Matt Toohey Date: Mon, 9 Nov 2026 20:01:18 +1100 Subject: [PATCH 1/4] fix(agents): say why Import an agent can't import here, and link Manage plugins MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both Import dialogs (Agents → New agent → Import an agent, and a shared agent's Import) said only "Enable an agent type plugin to import agents." In a browser no type can ever register, because Agents is unavailable outside the desktop app, so the advice could not help; on desktop nothing linked to where plugins are turned on. NoImportTypes in AgentBrowse.tsx now owns that empty state for both dialogs, by the Agents snapshot's status: - unavailable: "Agents runs in the desktop app. Open Buzz there to import one.", worded as the Agents page's own empty state. - error: "Agents could not load." with the snapshot's error, or the page's "Try again." fallback. - loading: types may not have registered yet, so a delayed "Loading agent types…" status through LoadingRegion instead of plugin advice. - otherwise: "No agent plugin is turned on. Turn one on in Manage plugins." with Manage plugins as a SettingsSectionLink to Settings → Plugins. Only the last has a link. The Agents page passes its existing openSettings to ImportAgents and to the Marketplace's shared agent panel. An agent card in a conversation renders the same shared Import dialog, so it opens Settings through the navigator it already uses to open an imported agent. Each dialog closes before Settings opens, so Settings never opens over it. Bestie's Remembers you row told people to clear memory in the Memory tab, which only reads. It now ends "To clear a memory, ask Bestie to forget it." Forgetting comes from the Buzz base prompt, not from the Remembers you section, so it works whether Remembers you is on or off: the base prompt has an agent update a memory with mem_set or delete it with mem_rm once the owner approves. Claude Code, Codex and Goose all build their system prompt from that base prompt and get mem_rm from the shared Buzz tool list. A hosted Bestie's prompt and tools belong to its provider and could not be checked here; the sentence says what to do rather than promising a result. The Bestie README and the help guide say the same, and the help notes that Import works only in the desktop app and links Manage plugins when no agent type plugin that runs agents on this computer is on. Checked in the browser build against the fixture relay, with main and this change side by side: the browser Import dialog, the Bestie row, and, with the fixture's only agent type plugin turned off, the Manage plugins link opening Settings → Manage plugins. Co-Authored-By: Claude Opus 5.5 Co-Authored-By: Claude Fable 5.1 Signed-off-by: mtoohey Signed-off-by: Matt Toohey --- docs/buzz-help.md | 6 +- src/bundled/agents/AgentBrowse.test.tsx | 82 ++++++++++- src/bundled/agents/AgentBrowse.tsx | 53 ++++++- .../agents/AgentCardAttachment.test.tsx | 39 +++++ src/bundled/agents/AgentCardAttachment.tsx | 5 +- src/bundled/agents/AgentsPage.test.tsx | 135 ++++++++++++++++++ src/bundled/agents/AgentsPage.tsx | 18 ++- src/bundled/bestie/BestieTab.test.tsx | 6 +- src/bundled/bestie/README.md | 4 +- src/bundled/bestie/features.ts | 2 +- 10 files changed, 331 insertions(+), 19 deletions(-) diff --git a/docs/buzz-help.md b/docs/buzz-help.md index c21c1b0ddc..92616bbf69 100644 --- a/docs/buzz-help.md +++ b/docs/buzz-help.md @@ -1216,8 +1216,8 @@ available rather than silently discarding it. owner, must not disclose it elsewhere, and must not treat quoted, forwarded, or other people's text as facts about the owner. - Turning **Remembers you** off removes that guidance but does not delete stored - memory; the agent's core memory can still be included in every prompt. Clear - stored memory in the agent's **Memory** tab. If someone edited the guidance's + memory; the agent's core memory can still be included in every prompt. To + clear a memory, ask Bestie to forget it. If someone edited the guidance's section markers in Instructions, the Bestie tab says it was edited instead of adding a duplicate. **Restore** can put the standard guidance back when the remaining markers still identify the section. @@ -1672,7 +1672,7 @@ even when no session is connected; it asks you to confirm first. Full access req ### Reconnecting an old agent in a DM -On desktop, **Connect [agent name]** may appear inside a DM with an old agent you own that is available to import from this computer. It preselects compatible saved harness, provider and model choices, and preserves saved effort settings. Choose another harness if the old type is unavailable or does not support inline connection setup; settings that were not saved use the selected type’s defaults. Review the inline controls; **Connect** stays disabled until the harness has a resolved model and provider, including usable defaults. If a saved Codex model is unavailable, choose another model or harness to continue. Complete installation or sign-in if prompted, stop the agent in old Buzz, then choose **Connect**. Your agent keeps its identity and conversation. This does not resend earlier messages. The same private card can appear in a channel or thread after you send a new mention of an eligible agent you own while that conversation is open, if that agent is still a member of the channel. Loading older mentions does not show cards, and known-archived agents are excluded. Only you see it, once per agent in the loaded conversation. Choose the **X** in the card’s top-right corner to hide that agent’s card in this conversation; the dismissal survives reopening and reloads. After connecting, **Ask the agent to respond** explicitly queues a follow-up addressed only to that agent in the original message’s thread; it does not automatically replay your request. If no prompt appears, use **Agents → New agent → Import an agent**. +On desktop, **Connect [agent name]** may appear inside a DM with an old agent you own that is available to import from this computer. It preselects compatible saved harness, provider and model choices, and preserves saved effort settings. Choose another harness if the old type is unavailable or does not support inline connection setup; settings that were not saved use the selected type’s defaults. Review the inline controls; **Connect** stays disabled until the harness has a resolved model and provider, including usable defaults. If a saved Codex model is unavailable, choose another model or harness to continue. Complete installation or sign-in if prompted, stop the agent in old Buzz, then choose **Connect**. Your agent keeps its identity and conversation. This does not resend earlier messages. The same private card can appear in a channel or thread after you send a new mention of an eligible agent you own while that conversation is open, if that agent is still a member of the channel. Loading older mentions does not show cards, and known-archived agents are excluded. Only you see it, once per agent in the loaded conversation. Choose the **X** in the card’s top-right corner to hide that agent’s card in this conversation; the dismissal survives reopening and reloads. After connecting, **Ask the agent to respond** explicitly queues a follow-up addressed only to that agent in the original message’s thread; it does not automatically replay your request. If no prompt appears, use **Agents → New agent → Import an agent**. Import works only in the desktop app. If no agent type plugin that runs agents on this computer is on (a hosted type such as Builderlab doesn’t count), the dialog says no agent plugin is turned on and links to **Manage plugins** to turn one on. ## Choosing a channel for a workflow diff --git a/src/bundled/agents/AgentBrowse.test.tsx b/src/bundled/agents/AgentBrowse.test.tsx index d92ddb3086..b40c7fa5c1 100644 --- a/src/bundled/agents/AgentBrowse.test.tsx +++ b/src/bundled/agents/AgentBrowse.test.tsx @@ -18,6 +18,7 @@ import type { ReadTransport } from "../../features/relay/transport"; import type { Agent, Agents, + AgentsSnapshot, RegisteredAgentType, } from "../../features/agents/service"; import type { Profile } from "../../features/relay/contracts"; @@ -32,6 +33,7 @@ function AgentBrowse( props: ReturnType & { relay: RelayData; onOpen?: (agent: Agent) => void; + openSettings?: (section: string) => void; }, ) { const [selection, setSelection] = useState(); @@ -72,13 +74,15 @@ const echo = { } as RegisteredAgentType; const notes = { key: "test/notes", title: "Notes" } as RegisteredAgentType; const imported = { pubkey: "e".repeat(64), name: "Shared helper" } as Agent; -/** Import's props: one type, and an `agents` holding `own` whose `port` - * resolves. */ +/** Import's props: one type, and an `agents` in `status` (with `error`) + * holding `own` whose `port` resolves. */ const importing = ( types: readonly RegisteredAgentType[] = [echo], own: readonly Agent[] = [], + status: AgentsSnapshot["status"] = "ready", + error?: string, ) => { - const snapshot = { agents: own }; + const snapshot = { status, error, agents: own }; return { agents: { subscribe: () => () => {}, @@ -530,6 +534,78 @@ it("does not silently replace an unavailable shared runtime", async () => { expect(props.agents.port).not.toHaveBeenCalled(); }); +/** Opens a shared agent's Import dialog with no type to import as, while + * Agents is in `status`. */ +async function noTypes( + status: AgentsSnapshot["status"], + openSettings = vi.fn(), + error?: string, +) { + const read = vi.fn().mockResolvedValue([shared]); + const props = importing([], [], status, error); + render( + , + ); + fireEvent.click(await screen.findByRole("button", { name: "Shared helper" })); + fireEvent.click(screen.getByRole("button", { name: "Import" })); + return screen.getByRole("dialog", { name: "Shared helper" }); +} + +// Desktop with no local agent type plugin on. +it("says why a shared agent can't be imported here, and links Manage plugins", async () => { + const openSettings = vi.fn(); + const dialog = await noTypes("ready", openSettings); + expect( + within(dialog).getByText(/No agent plugin is turned on/), + ).toHaveTextContent( + "No agent plugin is turned on. Turn one on in Manage plugins.", + ); + expect(within(dialog).getByRole("button", { name: "Import" })).toBeDisabled(); + fireEvent.click( + within(dialog).getByRole("button", { name: "Manage plugins" }), + ); + expect(openSettings).toHaveBeenCalledExactlyOnceWith("plugins"); + // Settings opens in place of the dialog, not over it. + expect( + screen.queryByRole("dialog", { name: "Shared helper" }), + ).not.toBeInTheDocument(); +}); + +it("tells a browser that shared agents import only in the desktop app", async () => { + // Outside the desktop app Agents is unavailable and no type registers. + const dialog = await noTypes("unavailable"); + expect( + within(dialog).getByText( + "Agents runs in the desktop app. Open Buzz there to import one.", + ), + ).toBeVisible(); + expect(within(dialog).queryByText(/Manage plugins/)).not.toBeInTheDocument(); +}); + +it("says a shared agent can't be imported while Agents could not load", async () => { + const dialog = await noTypes("error", vi.fn(), "Keychain is locked."); + expect( + within(dialog).getByText("Agents could not load. Keychain is locked."), + ).toBeVisible(); + expect(within(dialog).queryByText(/Manage plugins/)).not.toBeInTheDocument(); +}); + +it("waits for agent types to register instead of asking for a plugin", async () => { + const dialog = await noTypes("loading"); + // Loading feedback is delayed a second, as LoadingRegion does everywhere. + expect( + await within(dialog).findByRole("status", undefined, { timeout: 2000 }), + ).toHaveTextContent("Loading agent types…"); + expect( + within(dialog).queryByText(/No agent plugin is turned on/), + ).not.toBeInTheDocument(); + expect(within(dialog).queryByText(/Manage plugins/)).not.toBeInTheDocument(); +}); + it("collapses long instructions and expands them on request", async () => { const read = vi.fn().mockResolvedValue([ { diff --git a/src/bundled/agents/AgentBrowse.tsx b/src/bundled/agents/AgentBrowse.tsx index 847873d3be..db399ecf8d 100644 --- a/src/bundled/agents/AgentBrowse.tsx +++ b/src/bundled/agents/AgentBrowse.tsx @@ -51,7 +51,9 @@ import { SurfaceButton } from "../../shared/design-system/ui/SurfaceButton"; import { PreferenceRow } from "../../shared/design-system/ui/PreferenceRow"; import { SettingsGroup } from "../../shared/design-system/ui/SettingsGroup"; import { InlineHeader } from "../../shared/design-system/ui/Header"; +import { LoadingRegion } from "../../shared/design-system/ui/LoadingRegion"; import { AgentInstructions } from "../../features/agents/AgentInstructions"; +import { SettingsSectionLink } from "../../features/navigation/SettingsSectionLink"; import { ProfileBackdrop } from "../../features/profiles/ProfileBackdrop"; import { agentAvatars } from "../../features/agents/avatar-packs"; import hero from "../../features/profiles/ProfileHero.module.css"; @@ -68,6 +70,8 @@ type Importing = Readonly<{ onImported(agent: Agent): void; /** Opens an agent of yours that an import would only copy. */ onOpen?: ((agent: Agent) => void) | undefined; + /** Opens a Settings section, such as Manage plugins. */ + openSettings?: ((section: string) => void) | undefined; }>; export type SharedAgentSelection = { @@ -446,12 +450,47 @@ function copies( } } +/** Why Import has no type to import as: agents run only in the desktop app, + * they could not load, their types are still registering, or no agent type + * plugin is on. Only the last has a fix in Settings. */ +export function NoImportTypes({ + agents, + openSettings, +}: Pick) { + const { snapshot } = useAgents(agents); + if (snapshot.status === "loading") + return ( + + {null} + + ); + return ( +

+ {snapshot.status === "unavailable" ? ( + // As the Agents page's own empty state words it. + "Agents runs in the desktop app. Open Buzz there to import one." + ) : snapshot.status === "error" ? ( + `Agents could not load. ${snapshot.error ?? "Try again."}` + ) : ( + <> + No agent plugin is turned on. Turn one on in{" "} + + Manage plugins + + . + + )} +

+ ); +} + export function SharedImportDialog({ shared, agents, types, onImported, onOpen, + openSettings, onClose, finalFocus, }: Importing & { @@ -586,9 +625,17 @@ export function SharedImportDialog({ {/* Laid out as the agent's Identity tab will show it once imported. */}
{types.length === 0 ? ( -

- Enable an agent type plugin to import agents. -

+ { + onClose(); + openSettings(section); + }) + } + /> ) : ( { ); }); +it("links Manage plugins from a card while no agent type plugin is on", async () => { + const user = userEvent.setup(); + await serve(ada()); + const none: RegisteredAgentType[] = []; + const navigator = { open: vi.fn(async () => ({})) }; + render( + none }} + relay={relay} + navigator={navigator as unknown as Navigation} + canOpen={() => false} + open={() => false} + />, + ); + const button = await screen.findByRole("button", { + name: "Ada, shared agent", + }); + await vi.waitFor(() => expect(button).toBeEnabled()); + await user.click(button); + const dialog = screen.getByRole("dialog", { name: "Ada" }); + expect( + within(dialog).getByText(/No agent plugin is turned on/), + ).toHaveTextContent( + "No agent plugin is turned on. Turn one on in Manage plugins.", + ); + await user.click( + within(dialog).getByRole("button", { name: "Manage plugins" }), + ); + expect(navigator.open).toHaveBeenCalledExactlyOnceWith({ + version: 1, + kind: "settings", + section: "plugins", + }); + // Settings opens in place of the dialog, not over it. + expect(screen.queryByRole("dialog", { name: "Ada" })).not.toBeInTheDocument(); +}); + it("refuses a card larger than the limit without reading it all", async () => { const chunk = new Uint8Array(1024 * 1024); const chunks = Array.from({ length: 20 }, () => chunk); diff --git a/src/bundled/agents/AgentCardAttachment.tsx b/src/bundled/agents/AgentCardAttachment.tsx index 83df2a6c93..94a78bd014 100644 --- a/src/bundled/agents/AgentCardAttachment.tsx +++ b/src/bundled/agents/AgentCardAttachment.tsx @@ -59,7 +59,8 @@ export function AgentCardAttachment({ }: AttachmentRendererProps & { agents: Agents; relay: RelayData; - /** Opens an agent of yours on the Agents page; absent, nothing offers to. */ + /** Opens an agent of yours on the Agents page, or a Settings section; + * absent, nothing offers to. */ navigator?: Navigation | undefined; }) { const connection = useRelayConnection(relay); @@ -157,6 +158,8 @@ export function AgentCardAttachment({ setAdding(false); opener(agent)?.(); }, + openSettings: (section: string) => + void navigator.open({ version: 1, kind: "settings", section }), })} onClose={() => setAdding(false)} finalFocus={trigger} diff --git a/src/bundled/agents/AgentsPage.test.tsx b/src/bundled/agents/AgentsPage.test.tsx index eb02fee0fd..097208877d 100644 --- a/src/bundled/agents/AgentsPage.test.tsx +++ b/src/bundled/agents/AgentsPage.test.tsx @@ -3914,6 +3914,141 @@ it.each(["error", "unavailable"] as const)( }, ); +it("tells a browser's Import an agent that agents run in the desktop app", async () => { + const user = userEvent.setup(); + const navigator = { + open: vi.fn(async () => ({ status: "opened" as const })), + } as unknown as Navigation; + // Outside the desktop app no agent type registers. + const { agents } = setup([], { status: "unavailable", page: { navigator } }); + const none: RegisteredAgentType[] = []; + agents.types = () => none; + await user.click(screen.getByRole("button", { name: "New agent" })); + await user.click( + await screen.findByRole("menuitem", { name: "Import an agent" }), + ); + const dialog = await screen.findByRole("dialog", { name: "Import an agent" }); + expect( + within(dialog).getByText( + "Agents runs in the desktop app. Open Buzz there to import one.", + ), + ).toBeVisible(); + // The page behind it says the same. + expect( + screen.getByText("Agents runs in the desktop app", { exact: true }), + ).toBeInTheDocument(); + expect(within(dialog).queryByText(/Manage plugins/)).not.toBeInTheDocument(); +}); + +it("tells Import an agent that agents could not load, as the page does", async () => { + const user = userEvent.setup(); + const navigator = { + open: vi.fn(async () => ({ status: "opened" as const })), + } as unknown as Navigation; + const { agents } = setup([], { status: "error", page: { navigator } }); + const none: RegisteredAgentType[] = []; + agents.types = () => none; + await user.click(screen.getByRole("button", { name: "New agent" })); + await user.click( + await screen.findByRole("menuitem", { name: "Import an agent" }), + ); + const dialog = await screen.findByRole("dialog", { name: "Import an agent" }); + // Without a reason, the page's own fallback. + expect( + within(dialog).getByText("Agents could not load. Try again."), + ).toBeVisible(); + expect(within(dialog).queryByText(/Manage plugins/)).not.toBeInTheDocument(); +}); + +it("links Import an agent to Manage plugins while no agent type plugin is on", async () => { + const user = userEvent.setup(); + const navigator = { + open: vi.fn(async () => ({ status: "opened" as const })), + } as unknown as Navigation; + const { agents } = setup([agent("Ada", 1)], { page: { navigator } }); + const none: RegisteredAgentType[] = []; + agents.types = () => none; + await user.click(screen.getByRole("button", { name: "New agent" })); + await user.click( + await screen.findByRole("menuitem", { name: "Import an agent" }), + ); + const dialog = await screen.findByRole("dialog", { name: "Import an agent" }); + expect( + within(dialog).getByText(/No agent plugin is turned on/), + ).toHaveTextContent( + "No agent plugin is turned on. Turn one on in Manage plugins.", + ); + await user.click( + within(dialog).getByRole("button", { name: "Manage plugins" }), + ); + expect(navigator.open).toHaveBeenCalledExactlyOnceWith({ + version: 1, + kind: "settings", + section: "plugins", + }); + // Settings opens in place of the dialog, not over it. + expect( + screen.queryByRole("dialog", { name: "Import an agent" }), + ).not.toBeInTheDocument(); +}); + +it("links a Marketplace agent's Import to Manage plugins while no agent type plugin is on", async () => { + const user = userEvent.setup(); + const navigator = { + open: vi.fn(async () => ({ status: "opened" as const })), + } as unknown as Navigation; + const view = setup([], { page: { navigator } }); + const none: RegisteredAgentType[] = []; + view.agents.types = () => none; + const owner = createRelaySession(null); + const session = { + ...owner.session, + read: vi.fn().mockResolvedValue([ + { + id: "ab".repeat(32), + pubkey: "cd".repeat(32), + kind: 30175, + created_at: 1, + tags: [ + ["d", "helper"], + ["shared", "true"], + ], + content: JSON.stringify({ + display_name: "Marketplace helper", + system_prompt: "Help with tasks.", + }), + }, + ]), + }; + const snapshot = { status: "ready" as const, generation: 1, session }; + const relay = { ...view.relay, snapshot: () => snapshot }; + try { + view.rerender( + , + ); + await user.click(screen.getByRole("tab", { name: "Marketplace" })); + await user.click( + await screen.findByRole("button", { name: "Marketplace helper" }), + ); + await user.click(screen.getByRole("button", { name: "Import" })); + const dialog = screen.getByRole("dialog", { name: "Marketplace helper" }); + await user.click( + within(dialog).getByRole("button", { name: "Manage plugins" }), + ); + expect(navigator.open).toHaveBeenCalledExactlyOnceWith({ + version: 1, + kind: "settings", + section: "plugins", + }); + expect( + screen.queryByRole("dialog", { name: "Marketplace helper" }), + ).not.toBeInTheDocument(); + } finally { + view.unmount(); + owner.dispose(); + } +}); + it("says in Settings where an agent's config lives, and why it is only here", async () => { const user = userEvent.setup(); const { agents, notify } = setup([agent("Ada", 1)]); diff --git a/src/bundled/agents/AgentsPage.tsx b/src/bundled/agents/AgentsPage.tsx index 123b4bcedb..fc5576ed2b 100644 --- a/src/bundled/agents/AgentsPage.tsx +++ b/src/bundled/agents/AgentsPage.tsx @@ -41,6 +41,7 @@ import styles from "./AgentsPage.module.css"; import cardStyles from "./AgentCard.module.css"; import { AgentBrowse, + NoImportTypes, SharedAgentPanel, type SharedAgentSelection, SharedImportDialog, @@ -926,6 +927,7 @@ export function AgentsPage({ onImported={leaveListing} // Stays on the listing if an unsaved draft is kept. onOpen={(agent) => browse(agent.pubkey, leaveListing)} + openSettings={openSettings} /> ), }, @@ -988,6 +990,14 @@ export function AgentsPage({ flow === "import" ? () => changeTab("yours") : returnTo("teams") } onPendingChange={setImporting} + // Settings opens in place of the dialog, not over it. + openSettings={ + openSettings && + ((section) => { + setFlow(undefined); + openSettings(section); + }) + } /> )} @@ -1788,6 +1798,7 @@ function ImportAgents({ only, onImported, onPendingChange, + openSettings, }: { agents: Agents; community: string | undefined; @@ -1798,6 +1809,7 @@ function ImportAgents({ only: "agents" | "teams"; onImported(): void; onPendingChange(pending: boolean): void; + openSettings: ((section: string) => void) | undefined; }) { const [found, setFound] = useState(); const [confirming, setConfirming] = useState(); @@ -1990,11 +2002,7 @@ function ImportAgents({ }); }, [agents, snapshot]); if (!types.length) - return ( -

- Enable an agent type plugin to import agents. -

- ); + return ; const elsewhere = only === "agents" ? offered : []; const teamsElsewhere = only === "teams" ? teamsToJoin(snapshot.teams, agents.joinable()) : []; diff --git a/src/bundled/bestie/BestieTab.test.tsx b/src/bundled/bestie/BestieTab.test.tsx index b0455fd507..51c2c57563 100644 --- a/src/bundled/bestie/BestieTab.test.tsx +++ b/src/bundled/bestie/BestieTab.test.tsx @@ -516,8 +516,12 @@ it("turns memory on and off as a marked section of the instructions", async () = const { rerender } = render(); const remembers = screen.getByRole("switch", { name: "Remembers you" }); expect(remembers).not.toBeChecked(); + // The Memory tab only reads, so the row says how to clear a memory instead. + expect(remembers).toHaveAccessibleDescription( + "Adds memory rules to Bestie's instructions. Off removes them. Nothing Bestie remembered is deleted, and its core memory still goes into every prompt. To clear a memory, ask Bestie to forget it.", + ); expect( - screen.getByText(/Nothing Bestie remembered is deleted/), + screen.getByText(/To clear a memory, ask Bestie to forget it\./), ).toBeVisible(); await user.click(remembers); diff --git a/src/bundled/bestie/README.md b/src/bundled/bestie/README.md index e13eb2f9a6..7297467c5d 100644 --- a/src/bundled/bestie/README.md +++ b/src/bundled/bestie/README.md @@ -93,8 +93,8 @@ markers, the row says the section was edited instead of showing a switch, so it never adds a second one. **Restore** puts back the original section in place of its two markers and what lies between them, when they still show where it starts and ends; otherwise fix its markers in Instructions. Off -deletes no memory, and the agent's core memory is still in every prompt; -clear memory in the Memory tab. +deletes no memory, and the agent's core memory is still in every prompt; to +clear a memory, ask Bestie to forget it. **Private channels Bestie can read** lists the private channels you share with Bestie, each with **Remove**, which asks first, as the Members dialog does. diff --git a/src/bundled/bestie/features.ts b/src/bundled/bestie/features.ts index 52bc41cd78..d4f42859d0 100644 --- a/src/bundled/bestie/features.ts +++ b/src/bundled/bestie/features.ts @@ -27,7 +27,7 @@ export const memory: Feature = { id: "memory", title: "Remembers you", description: - "Adds memory rules to Bestie's instructions. Off removes them. Nothing Bestie remembered is deleted, and its core memory still goes into every prompt. Clear memory in the Memory tab.", + "Adds memory rules to Bestie's instructions. Off removes them. Nothing Bestie remembered is deleted, and its core memory still goes into every prompt. To clear a memory, ask Bestie to forget it.", version: 1, text: `# Memory Your owner turned on "Remembers you": keep memory about them, so your help gets better over time. That is their approval to save what they tell you by these rules; still ask before you change or remove something they told you before. Call mem_get mem/user when the answer depends on who the owner is or what they asked for before. Save only what will improve future help, and say something is saved only after the tool confirms it. From 0a58706b805a324518c40164e0414d00ebbb5854 Mon Sep 17 00:00:00 2001 From: Matt Toohey Date: Tue, 10 Nov 2026 00:05:34 +1100 Subject: [PATCH 2/4] fix(agents): keep Manage plugins plain text while an import is pending Addresses wesbillman's review comment on PR 3073 at AgentsPage.tsx:973. If the last runnable agent plugin is turned off while an import is in flight or queued, its type unregisters and both Import dialogs show NoImportTypes. Its Manage plugins link closed the dialog directly, bypassing the dialog's preventClose guard: unmounting marked the import dialog closed, dropped queued imports silently and hid the in-flight result or error. Import an agent now passes no Settings callback while an import is pending, and the shared agent's Import dialog while its own import is pending, so SettingsSectionLink renders plain text until the import settles. Tests in both files start a deferred import, unregister the last type, check the link is plain text and the dialog stays open, then settle the import and check the link and the outcome come back. Signed-off-by: Matt Toohey Co-Authored-By: Claude Fable 5.1 Signed-off-by: Matt Toohey --- src/bundled/agents/AgentBrowse.test.tsx | 61 +++++++++++++++++++++++++ src/bundled/agents/AgentBrowse.tsx | 14 +++--- src/bundled/agents/AgentsPage.test.tsx | 50 ++++++++++++++++++++ src/bundled/agents/AgentsPage.tsx | 14 +++--- 4 files changed, 127 insertions(+), 12 deletions(-) diff --git a/src/bundled/agents/AgentBrowse.test.tsx b/src/bundled/agents/AgentBrowse.test.tsx index b40c7fa5c1..70298e46b6 100644 --- a/src/bundled/agents/AgentBrowse.test.tsx +++ b/src/bundled/agents/AgentBrowse.test.tsx @@ -575,6 +575,67 @@ it("says why a shared agent can't be imported here, and links Manage plugins", a ).not.toBeInTheDocument(); }); +it("keeps Manage plugins plain text while a shared agent is still importing", async () => { + const read = vi.fn().mockResolvedValue([shared]); + const props = importing(); + let fail = () => {}; + props.agents.port.mockImplementationOnce( + () => + new Promise((_, reject) => { + fail = () => reject(new Error("Keychain access was denied")); + }), + ); + const openSettings = vi.fn(); + const view = render( + , + ); + fireEvent.click(await screen.findByRole("button", { name: "Shared helper" })); + fireEvent.click(screen.getByRole("button", { name: "Import" })); + const dialog = screen.getByRole("dialog", { name: "Shared helper" }); + fireEvent.click(within(dialog).getByRole("button", { name: "Import" })); + expect(props.agents.port).toHaveBeenCalledTimes(1); + // The last agent plugin goes off while the import is still running. + const gone = importing([]); + view.rerender( + , + ); + expect( + within(dialog).getByText(/No agent plugin is turned on/), + ).toHaveTextContent( + "No agent plugin is turned on. Turn one on in Manage plugins.", + ); + // Opening Settings would close the dialog over the import, which Close + // may not do either, so the link waits as plain text. + expect( + within(dialog).queryByRole("button", { name: "Manage plugins" }), + ).not.toBeInTheDocument(); + expect(within(dialog).getByRole("button", { name: "Close" })).toBeDisabled(); + await act(async () => { + fail(); + }); + // The import's outcome still lands in the dialog, and the link is back. + expect(within(dialog).getByRole("alert")).toHaveTextContent( + "Keychain access was denied", + ); + fireEvent.click( + within(dialog).getByRole("button", { name: "Manage plugins" }), + ); + expect(openSettings).toHaveBeenCalledExactlyOnceWith("plugins"); + expect( + screen.queryByRole("dialog", { name: "Shared helper" }), + ).not.toBeInTheDocument(); +}); + it("tells a browser that shared agents import only in the desktop app", async () => { // Outside the desktop app Agents is unavailable and no type registers. const dialog = await noTypes("unavailable"); diff --git a/src/bundled/agents/AgentBrowse.tsx b/src/bundled/agents/AgentBrowse.tsx index db399ecf8d..1deedfe13b 100644 --- a/src/bundled/agents/AgentBrowse.tsx +++ b/src/bundled/agents/AgentBrowse.tsx @@ -627,13 +627,15 @@ export function SharedImportDialog({ {types.length === 0 ? ( { - onClose(); - openSettings(section); - }) + openSettings && !pending + ? (section) => { + onClose(); + openSettings(section); + } + : undefined } /> ) : ( diff --git a/src/bundled/agents/AgentsPage.test.tsx b/src/bundled/agents/AgentsPage.test.tsx index 097208877d..6fc9ea1fba 100644 --- a/src/bundled/agents/AgentsPage.test.tsx +++ b/src/bundled/agents/AgentsPage.test.tsx @@ -3992,6 +3992,56 @@ it("links Import an agent to Manage plugins while no agent type plugin is on", a ).not.toBeInTheDocument(); }); +it("keeps Manage plugins plain text while an import is still running", async () => { + const user = userEvent.setup(); + const navigator = { + open: vi.fn(async () => ({ status: "opened" as const })), + } as unknown as Navigation; + const { agents, change } = setup([], { page: { navigator } }); + let finish = () => {}; + agents.port.mockImplementationOnce( + () => + new Promise((resolve) => { + finish = () => resolve({ agent: agent("Ada", 1), notes: [] }); + }), + ); + await user.click( + await screen.findByRole("button", { name: /Import them now/ }), + ); + const dialog = screen.getByRole("dialog", { name: "Import an agent" }); + await user.click( + await within(dialog).findByRole("button", { name: "Import as Echo, Ada" }), + ); + // The last agent plugin goes off while Ada is still importing. + const none: RegisteredAgentType[] = []; + agents.types = () => none; + act(() => change({})); + expect( + within(dialog).getByText(/No agent plugin is turned on/), + ).toHaveTextContent( + "No agent plugin is turned on. Turn one on in Manage plugins.", + ); + // Opening Settings would close the dialog over the import, which Close + // and Escape may not do either, so the link waits as plain text. + expect( + within(dialog).queryByRole("button", { name: "Manage plugins" }), + ).not.toBeInTheDocument(); + await user.keyboard("{Escape}"); + expect(screen.getByRole("dialog", { name: "Import an agent" })).toBeVisible(); + finish(); + await user.click( + await within(dialog).findByRole("button", { name: "Manage plugins" }), + ); + expect(navigator.open).toHaveBeenCalledExactlyOnceWith({ + version: 1, + kind: "settings", + section: "plugins", + }); + expect( + screen.queryByRole("dialog", { name: "Import an agent" }), + ).not.toBeInTheDocument(); +}); + it("links a Marketplace agent's Import to Manage plugins while no agent type plugin is on", async () => { const user = userEvent.setup(); const navigator = { diff --git a/src/bundled/agents/AgentsPage.tsx b/src/bundled/agents/AgentsPage.tsx index fc5576ed2b..88fbbef3aa 100644 --- a/src/bundled/agents/AgentsPage.tsx +++ b/src/bundled/agents/AgentsPage.tsx @@ -990,13 +990,15 @@ export function AgentsPage({ flow === "import" ? () => changeTab("yours") : returnTo("teams") } onPendingChange={setImporting} - // Settings opens in place of the dialog, not over it. + // Settings opens in place of the dialog, not over it, so while + // an import keeps the dialog open the link is plain text. openSettings={ - openSettings && - ((section) => { - setFlow(undefined); - openSettings(section); - }) + openSettings && !importing + ? (section) => { + setFlow(undefined); + openSettings(section); + } + : undefined } /> From 1c10cff25c02a2818f2525bde5909804bec86a77 Mon Sep 17 00:00:00 2001 From: Matt Toohey Date: Tue, 10 Nov 2026 03:10:28 +1100 Subject: [PATCH 3/4] fix(agents): name the missing harness in Import, not a plugin that is off Addresses kalvinnchau's review comment on PR 3073 at AgentBrowse.tsx:475. Both Import dialogs' ready state said "No agent plugin is turned on. Turn one on in Manage plugins." That is false in two states Manage plugins shows a plugin enabled: only a hosted type such as Builderlab is on, which the Agents page keeps out of Import because an imported agent needs a key on this computer; and a plugin that is on but failed to activate, which registers no type. NoImportTypes keys off the Agents snapshot, whose ready status says the inventory loaded, not that any plugin activated, so it cannot tell those apart from every plugin off. It now names what is missing rather than why, as AgentPeek does for an agent whose harness is unavailable: "No harness that runs agents on this computer is available. Check Manage plugins." Manage plugins stays the link, since turning a harness plugin on and retrying a failed one both live there. The help guide says the same. Tests in both dialogs cover a hosted-only type inventory and keep the no-type case, now described as every plugin off or one failed to activate; the component sees the same inputs for both. Signed-off-by: Matt Toohey Co-Authored-By: Claude Fable 5.1 Signed-off-by: Matt Toohey --- docs/buzz-help.md | 2 +- src/bundled/agents/AgentBrowse.test.tsx | 47 ++++++++++++++--- src/bundled/agents/AgentBrowse.tsx | 11 ++-- .../agents/AgentCardAttachment.test.tsx | 4 +- src/bundled/agents/AgentsPage.test.tsx | 50 +++++++++++++++++-- 5 files changed, 97 insertions(+), 17 deletions(-) diff --git a/docs/buzz-help.md b/docs/buzz-help.md index 92616bbf69..799249ace9 100644 --- a/docs/buzz-help.md +++ b/docs/buzz-help.md @@ -1672,7 +1672,7 @@ even when no session is connected; it asks you to confirm first. Full access req ### Reconnecting an old agent in a DM -On desktop, **Connect [agent name]** may appear inside a DM with an old agent you own that is available to import from this computer. It preselects compatible saved harness, provider and model choices, and preserves saved effort settings. Choose another harness if the old type is unavailable or does not support inline connection setup; settings that were not saved use the selected type’s defaults. Review the inline controls; **Connect** stays disabled until the harness has a resolved model and provider, including usable defaults. If a saved Codex model is unavailable, choose another model or harness to continue. Complete installation or sign-in if prompted, stop the agent in old Buzz, then choose **Connect**. Your agent keeps its identity and conversation. This does not resend earlier messages. The same private card can appear in a channel or thread after you send a new mention of an eligible agent you own while that conversation is open, if that agent is still a member of the channel. Loading older mentions does not show cards, and known-archived agents are excluded. Only you see it, once per agent in the loaded conversation. Choose the **X** in the card’s top-right corner to hide that agent’s card in this conversation; the dismissal survives reopening and reloads. After connecting, **Ask the agent to respond** explicitly queues a follow-up addressed only to that agent in the original message’s thread; it does not automatically replay your request. If no prompt appears, use **Agents → New agent → Import an agent**. Import works only in the desktop app. If no agent type plugin that runs agents on this computer is on (a hosted type such as Builderlab doesn’t count), the dialog says no agent plugin is turned on and links to **Manage plugins** to turn one on. +On desktop, **Connect [agent name]** may appear inside a DM with an old agent you own that is available to import from this computer. It preselects compatible saved harness, provider and model choices, and preserves saved effort settings. Choose another harness if the old type is unavailable or does not support inline connection setup; settings that were not saved use the selected type’s defaults. Review the inline controls; **Connect** stays disabled until the harness has a resolved model and provider, including usable defaults. If a saved Codex model is unavailable, choose another model or harness to continue. Complete installation or sign-in if prompted, stop the agent in old Buzz, then choose **Connect**. Your agent keeps its identity and conversation. This does not resend earlier messages. The same private card can appear in a channel or thread after you send a new mention of an eligible agent you own while that conversation is open, if that agent is still a member of the channel. Loading older mentions does not show cards, and known-archived agents are excluded. Only you see it, once per agent in the loaded conversation. Choose the **X** in the card’s top-right corner to hide that agent’s card in this conversation; the dismissal survives reopening and reloads. After connecting, **Ask the agent to respond** explicitly queues a follow-up addressed only to that agent in the original message’s thread; it does not automatically replay your request. If no prompt appears, use **Agents → New agent → Import an agent**. Import works only in the desktop app. If no harness that runs agents on this computer is available (a hosted type such as Builderlab doesn’t count, and a plugin that is on but failed to activate registers none), the dialog says so and links to **Manage plugins** to turn one on or retry it. ## Choosing a channel for a workflow diff --git a/src/bundled/agents/AgentBrowse.test.tsx b/src/bundled/agents/AgentBrowse.test.tsx index 70298e46b6..cbc2d71e97 100644 --- a/src/bundled/agents/AgentBrowse.test.tsx +++ b/src/bundled/agents/AgentBrowse.test.tsx @@ -555,14 +555,16 @@ async function noTypes( return screen.getByRole("dialog", { name: "Shared helper" }); } -// Desktop with no local agent type plugin on. +// Desktop where no plugin registered a type that runs agents here: every +// agent plugin off, or one on that failed to activate. The component cannot +// tell these apart, so it names what is missing, not why. it("says why a shared agent can't be imported here, and links Manage plugins", async () => { const openSettings = vi.fn(); const dialog = await noTypes("ready", openSettings); expect( - within(dialog).getByText(/No agent plugin is turned on/), + within(dialog).getByText(/No harness that runs agents on this computer/), ).toHaveTextContent( - "No agent plugin is turned on. Turn one on in Manage plugins.", + "No harness that runs agents on this computer is available. Check Manage plugins.", ); expect(within(dialog).getByRole("button", { name: "Import" })).toBeDisabled(); fireEvent.click( @@ -575,6 +577,39 @@ it("says why a shared agent can't be imported here, and links Manage plugins", a ).not.toBeInTheDocument(); }); +// Only a hosted type is on, so Manage plugins shows a plugin enabled. The +// page keeps hosted types out of Import, since an imported agent needs a key +// here, and the dialog must not claim no plugin is on. +it("does not say no plugin is on when only a hosted type is", async () => { + const read = vi.fn().mockResolvedValue([shared]); + const props = importing([], [], "ready"); + const hosted = [ + { ...echo, key: "test/cloud", title: "Cloud", remote: {} }, + ] as unknown as RegisteredAgentType[]; + props.agents.types = () => hosted; + const openSettings = vi.fn(); + render( + , + ); + fireEvent.click(await screen.findByRole("button", { name: "Shared helper" })); + fireEvent.click(screen.getByRole("button", { name: "Import" })); + const dialog = screen.getByRole("dialog", { name: "Shared helper" }); + expect( + within(dialog).getByText(/No harness that runs agents on this computer/), + ).toHaveTextContent( + "No harness that runs agents on this computer is available. Check Manage plugins.", + ); + expect(within(dialog).queryByText(/plugin is turned on/)).toBeNull(); + fireEvent.click( + within(dialog).getByRole("button", { name: "Manage plugins" }), + ); + expect(openSettings).toHaveBeenCalledExactlyOnceWith("plugins"); +}); + it("keeps Manage plugins plain text while a shared agent is still importing", async () => { const read = vi.fn().mockResolvedValue([shared]); const props = importing(); @@ -610,9 +645,9 @@ it("keeps Manage plugins plain text while a shared agent is still importing", as />, ); expect( - within(dialog).getByText(/No agent plugin is turned on/), + within(dialog).getByText(/No harness that runs agents on this computer/), ).toHaveTextContent( - "No agent plugin is turned on. Turn one on in Manage plugins.", + "No harness that runs agents on this computer is available. Check Manage plugins.", ); // Opening Settings would close the dialog over the import, which Close // may not do either, so the link waits as plain text. @@ -662,7 +697,7 @@ it("waits for agent types to register instead of asking for a plugin", async () await within(dialog).findByRole("status", undefined, { timeout: 2000 }), ).toHaveTextContent("Loading agent types…"); expect( - within(dialog).queryByText(/No agent plugin is turned on/), + within(dialog).queryByText(/No harness that runs agents on this computer/), ).not.toBeInTheDocument(); expect(within(dialog).queryByText(/Manage plugins/)).not.toBeInTheDocument(); }); diff --git a/src/bundled/agents/AgentBrowse.tsx b/src/bundled/agents/AgentBrowse.tsx index 1deedfe13b..276f71927b 100644 --- a/src/bundled/agents/AgentBrowse.tsx +++ b/src/bundled/agents/AgentBrowse.tsx @@ -451,8 +451,13 @@ function copies( } /** Why Import has no type to import as: agents run only in the desktop app, - * they could not load, their types are still registering, or no agent type - * plugin is on. Only the last has a fix in Settings. */ + * they could not load, their types are still registering, or no harness that + * runs agents on this computer is available. Only the last has a remedy in + * Settings, and it has more than one cause: every agent plugin is off, only a + * hosted type (one its provider runs, so it cannot take an imported key) is + * on, or a plugin that is on failed to activate. The snapshot being ready + * says the inventory loaded, not that a plugin activated, so this names what + * is missing rather than why. */ export function NoImportTypes({ agents, openSettings, @@ -473,7 +478,7 @@ export function NoImportTypes({ `Agents could not load. ${snapshot.error ?? "Try again."}` ) : ( <> - No agent plugin is turned on. Turn one on in{" "} + No harness that runs agents on this computer is available. Check{" "} Manage plugins diff --git a/src/bundled/agents/AgentCardAttachment.test.tsx b/src/bundled/agents/AgentCardAttachment.test.tsx index 7ef7c2a924..33b12cad64 100644 --- a/src/bundled/agents/AgentCardAttachment.test.tsx +++ b/src/bundled/agents/AgentCardAttachment.test.tsx @@ -226,9 +226,9 @@ it("links Manage plugins from a card while no agent type plugin is on", async () await user.click(button); const dialog = screen.getByRole("dialog", { name: "Ada" }); expect( - within(dialog).getByText(/No agent plugin is turned on/), + within(dialog).getByText(/No harness that runs agents on this computer/), ).toHaveTextContent( - "No agent plugin is turned on. Turn one on in Manage plugins.", + "No harness that runs agents on this computer is available. Check Manage plugins.", ); await user.click( within(dialog).getByRole("button", { name: "Manage plugins" }), diff --git a/src/bundled/agents/AgentsPage.test.tsx b/src/bundled/agents/AgentsPage.test.tsx index 6fc9ea1fba..93df86016c 100644 --- a/src/bundled/agents/AgentsPage.test.tsx +++ b/src/bundled/agents/AgentsPage.test.tsx @@ -3960,7 +3960,9 @@ it("tells Import an agent that agents could not load, as the page does", async ( expect(within(dialog).queryByText(/Manage plugins/)).not.toBeInTheDocument(); }); -it("links Import an agent to Manage plugins while no agent type plugin is on", async () => { +// No plugin registered a type that runs agents here: every agent plugin off, +// or one on that failed to activate. The dialog names what is missing. +it("links Import an agent to Manage plugins while no type runs agents here", async () => { const user = userEvent.setup(); const navigator = { open: vi.fn(async () => ({ status: "opened" as const })), @@ -3974,9 +3976,9 @@ it("links Import an agent to Manage plugins while no agent type plugin is on", a ); const dialog = await screen.findByRole("dialog", { name: "Import an agent" }); expect( - within(dialog).getByText(/No agent plugin is turned on/), + within(dialog).getByText(/No harness that runs agents on this computer/), ).toHaveTextContent( - "No agent plugin is turned on. Turn one on in Manage plugins.", + "No harness that runs agents on this computer is available. Check Manage plugins.", ); await user.click( within(dialog).getByRole("button", { name: "Manage plugins" }), @@ -3992,6 +3994,44 @@ it("links Import an agent to Manage plugins while no agent type plugin is on", a ).not.toBeInTheDocument(); }); +// Only a hosted type is on. Import keeps it out, since an imported agent +// needs a key here, and must not claim no plugin is on: Manage plugins shows +// one enabled. +it("does not say no plugin is on when only a hosted type is", async () => { + const user = userEvent.setup(); + const navigator = { + open: vi.fn(async () => ({ status: "opened" as const })), + } as unknown as Navigation; + const { agents, types } = setup([agent("Ada", 1)], { page: { navigator } }); + const cloud = { + ...types[0], + key: "test/cloud", + title: "Cloud", + remote: {}, + } as unknown as RegisteredAgentType; + const hosted = [cloud]; + agents.types = () => hosted; + await user.click(screen.getByRole("button", { name: "New agent" })); + await user.click( + await screen.findByRole("menuitem", { name: "Import an agent" }), + ); + const dialog = await screen.findByRole("dialog", { name: "Import an agent" }); + expect( + within(dialog).getByText(/No harness that runs agents on this computer/), + ).toHaveTextContent( + "No harness that runs agents on this computer is available. Check Manage plugins.", + ); + expect(within(dialog).queryByText(/plugin is turned on/)).toBeNull(); + await user.click( + within(dialog).getByRole("button", { name: "Manage plugins" }), + ); + expect(navigator.open).toHaveBeenCalledExactlyOnceWith({ + version: 1, + kind: "settings", + section: "plugins", + }); +}); + it("keeps Manage plugins plain text while an import is still running", async () => { const user = userEvent.setup(); const navigator = { @@ -4017,9 +4057,9 @@ it("keeps Manage plugins plain text while an import is still running", async () agents.types = () => none; act(() => change({})); expect( - within(dialog).getByText(/No agent plugin is turned on/), + within(dialog).getByText(/No harness that runs agents on this computer/), ).toHaveTextContent( - "No agent plugin is turned on. Turn one on in Manage plugins.", + "No harness that runs agents on this computer is available. Check Manage plugins.", ); // Opening Settings would close the dialog over the import, which Close // and Escape may not do either, so the link waits as plain text. From c4c23deb82a3702df69beabb0c06c8db9fa428b5 Mon Sep 17 00:00:00 2001 From: Matt Toohey Date: Tue, 10 Nov 2026 14:54:18 +1100 Subject: [PATCH 4/4] test(agents): open the card's Import dialog through Add agent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The card test this branch added for the Manage plugins link looked for the card's old trigger, a button named "Ada, shared agent". Show Add agent button on shared agent previews (#3131) replaced that with an Add agent button named "Add agent: Ada", so after the rebase onto main the test could not find the button and failed on every run. The test now opens the dialog through Add agent, as the file's other tests do. Its assertions are unchanged: with no agent type registered, the card's Import dialog says no harness that runs agents on this computer is available, its Manage plugins link opens Settings → Plugins through the navigator, and the dialog closes rather than staying open under Settings. The card's wiring needed no change: it still passes openSettings to SharedImportDialog, which closes before calling it. Signed-off-by: Matt Toohey Co-Authored-By: Claude Opus 5.5 Signed-off-by: Matt Toohey --- src/bundled/agents/AgentCardAttachment.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bundled/agents/AgentCardAttachment.test.tsx b/src/bundled/agents/AgentCardAttachment.test.tsx index 33b12cad64..0a91a656ca 100644 --- a/src/bundled/agents/AgentCardAttachment.test.tsx +++ b/src/bundled/agents/AgentCardAttachment.test.tsx @@ -220,7 +220,7 @@ it("links Manage plugins from a card while no agent type plugin is on", async () />, ); const button = await screen.findByRole("button", { - name: "Ada, shared agent", + name: "Add agent: Ada", }); await vi.waitFor(() => expect(button).toBeEnabled()); await user.click(button);