Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/bundled/agents/AgentsPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
16 changes: 13 additions & 3 deletions src/bundled/agents/AgentsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -1186,8 +1187,17 @@ function AgentPeek({
/>
{agent.place === "elsewhere" ? (
<p className="m-0 text-body-sm text-secondary">
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.
</>
)}
</p>
) : (
<>
Expand Down
Loading