fix(ui): load the full MCP tool catalog in the permissions editor

Co-Authored-By: bot_apk <apk@cognition.ai>
This commit is contained in:
Devin AI 2026-09-25 02:42:42 +00:00
parent 94362273fe
commit 0a69a19155
2 changed files with 6 additions and 5 deletions

View file

@ -84,8 +84,9 @@ describe("MCPToolPermissions", () => {
// Verify API calls
// Note: useMCPServers uses useAuthorized() internally, which returns "123" from global mock
expect(networking.fetchMCPServers).toHaveBeenCalledWith("123", undefined);
// listMCPTools uses the accessToken prop directly
expect(networking.listMCPTools).toHaveBeenCalledWith(mockAccessToken, mockServerId);
// listMCPTools uses the accessToken prop directly and requests the full
// catalog (includeDisabledTools) so delete-classified tools stay editable
expect(networking.listMCPTools).toHaveBeenCalledWith(mockAccessToken, mockServerId, undefined, true);
});
it("should select all tools when Select All button is clicked", async () => {
@ -221,7 +222,7 @@ describe("MCPToolPermissions", () => {
expect(await screen.findByText("Group Server")).toBeInTheDocument();
expect(await screen.findByText("list_issues")).toBeInTheDocument();
expect(screen.getByText("delete_issue")).toBeInTheDocument();
expect(networking.listMCPTools).toHaveBeenCalledWith(mockAccessToken, groupServer.server_id);
expect(networking.listMCPTools).toHaveBeenCalledWith(mockAccessToken, groupServer.server_id, undefined, true);
});
it("shows non-delete tools checked and the delete unchecked in flat view for an unrestricted access-group server", async () => {
@ -712,7 +713,7 @@ describe("MCPToolPermissions", () => {
expect(await screen.findByText("github_mcp")).toBeInTheDocument();
expect(await screen.findByText("list_issues")).toBeInTheDocument();
expect(screen.getByText("delete_issue")).toBeInTheDocument();
expect(networking.listMCPTools).toHaveBeenCalledWith(mockAccessToken, namedServer.server_id);
expect(networking.listMCPTools).toHaveBeenCalledWith(mockAccessToken, namedServer.server_id, undefined, true);
});
it("writes an edit back to the name key instead of adding a second id-keyed entry", async () => {

View file

@ -102,7 +102,7 @@ const MCPToolPermissions: React.FC<MCPToolPermissionsProps> = ({
setToolErrors((prev) => ({ ...prev, [serverId]: "" }));
try {
const response = await listMCPTools(token, serverId);
const response = await listMCPTools(token, serverId, undefined, true);
if (response.error) {
setToolErrors((prev) => ({ ...prev, [serverId]: response.message || "Failed to fetch tools" }));