diff --git a/src/bundled/agents/AgentsPage.test.tsx b/src/bundled/agents/AgentsPage.test.tsx index d1f5f21a5a..cb29da7b90 100644 --- a/src/bundled/agents/AgentsPage.test.tsx +++ b/src/bundled/agents/AgentsPage.test.tsx @@ -2504,6 +2504,27 @@ it("offers New team again when the team being edited disappears", async () => { expect(screen.getByRole("button", { name: "New team" })).toBeInTheDocument(); }); +it("explains an unavailable harness without claiming the key is on another device", async () => { + const user = userEvent.setup(); + setup([ + { + ...agent("Starf", 3), + type: "block.builderlab/builderlab", + place: "elsewhere", + }, + ]); + const grid = screen.getByRole("grid", { name: "Agents" }); + expect(within(grid).getByText("Harness unavailable")).toBeInTheDocument(); + expect(screen.queryByText("On another device")).not.toBeInTheDocument(); + + await user.click(within(grid).getByText("Starf")); + expect(screen.getByText(/Check Settings → Plugins/)).toBeInTheDocument(); + expect(screen.queryByText(/another of your devices/)).not.toBeInTheDocument(); + expect( + screen.queryByRole("button", { name: "Delete agent" }), + ).not.toBeInTheDocument(); +}); + it("shows an agent on another device read-only, and offers only Finish setup and Delete for an unfinished hosted one", async () => { const user = userEvent.setup(); const far: Agent = { diff --git a/src/bundled/agents/AgentsPage.tsx b/src/bundled/agents/AgentsPage.tsx index 3aec0afb28..1575648112 100644 --- a/src/bundled/agents/AgentsPage.tsx +++ b/src/bundled/agents/AgentsPage.tsx @@ -120,7 +120,8 @@ const importReminderKey = "agent-community-import:dismissed"; /** The type's one-line summary of an agent; its title when it has none. */ function summaryOf(agent: Agent, type: RegisteredAgentType | undefined) { - if (agent.place === "elsewhere") return "On another device"; + if (agent.place === "elsewhere") + return type && !type.remote ? "On another device" : "Harness unavailable"; if (agent.unfinished) return "Setup unfinished"; if (!type) return "Type unavailable"; try { @@ -1186,8 +1187,17 @@ function AgentPeek({ /> {agent.place === "elsewhere" ? (

- Its key is on another of your devices, which runs it. Open Agents - there to change or delete it. + {type && !type.remote ? ( + <> + Its key is on another of your devices, which runs it. Open Agents + there to change or delete it. + + ) : ( + <> + This agent’s harness is unavailable in this client. Check Settings + → Plugins or use a build with this harness configured. + + )}

) : ( <>