mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-30 09:05:15 +01:00
Keep Dot agent grants out of personal assistant connections
The merged Connections entry describes assistants that act as the user. Filter the dedicated agent scope from its status and management list so a paired Dot cannot be presented as personal read-only access. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
1be3f69703
commit
aaddf6b6b0
2 files changed
+17
-1
No files matched your search
@@ -87,6 +87,22 @@ describe("assistant setup from Connections", () => {
|
||||
expect(container.textContent).toContain("Connected as you · Read and write");
|
||||
expect(container.querySelector('[aria-label="Copy first prompt"]')).toBeNull();
|
||||
});
|
||||
it("keeps Dot agent grants out of personal assistant setup and connected status", async () => {
|
||||
const dot = { ...grant, id: "dot", clientName: "Dedicated Dot", scopes: ["paperclip:agent", "offline_access"] };
|
||||
mocks.connections.mockResolvedValue([dot]);
|
||||
await render(<AssistantConnectionCard onNavigate={vi.fn()} />);
|
||||
expect(container.querySelector('[data-connected]')?.getAttribute("data-connected")).toBe("false");
|
||||
expect(container.textContent).not.toContain("Connected as you");
|
||||
await render();
|
||||
expect(container.textContent).toContain("No assistants connected to Butter yet");
|
||||
expect(container.textContent).not.toContain("Dedicated Dot");
|
||||
mocks.connections.mockResolvedValue([dot, grant]);
|
||||
await act(async () => { await client.invalidateQueries({ queryKey: ["mcp-connections"] }); });
|
||||
await flush();
|
||||
expect(container.textContent).toContain("Connected as you · Read and write");
|
||||
expect(container.querySelector('[aria-label="Revoke OpenCode connection"]')).not.toBeNull();
|
||||
expect(container.querySelector('[aria-label="Revoke Dedicated Dot connection"]')).toBeNull();
|
||||
});
|
||||
it("shows a recoverable error instead of pretending setup succeeded", async () => {
|
||||
mocks.setup.mockRejectedValue(new Error("offline"));
|
||||
await render();
|
||||
|
||||
@@ -32,7 +32,7 @@ export function useAssistantConnections(poll = false) {
|
||||
queryKey: connectionsKey, queryFn: publicMcpApi.connections, retry: false,
|
||||
enabled: Boolean(selectedCompanyId), refetchInterval: poll ? 5000 : false,
|
||||
});
|
||||
return { ...query, rows: (query.data ?? []).filter(row => row.companyId === selectedCompanyId) };
|
||||
return { ...query, rows: (query.data ?? []).filter(row => row.companyId === selectedCompanyId && !row.scopes.includes("paperclip:agent")) };
|
||||
}
|
||||
|
||||
/** Inbound assistant access belongs beside the existing outbound connectors. */
|
||||
|
||||
Reference in new issue
Block a user