Skip to content

MCP-level resolution failures - #3190

Open
ckelly17 wants to merge 4 commits into
devfrom
claude/editworkspace-tool-access-bug-pflbec
Open

ckelly17 wants to merge 4 commits into
devfrom
claude/editworkspace-tool-access-bug-pflbec

Conversation

@ckelly17

@ckelly17 ckelly17 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Description

Saving an agent with a knowledge base (vector engine) that doesn't have MCP enabled could leave its chats with no tools at all. The agent page still showed every toolbox as attached, and GetWorkspace still listed them.

Room.getAllToolsJsonForRoom loaded the agent's toolboxes with one try/catch around each whole loop: once for the WORKSPACE_RESOURCE rows and once for CONFIG_JSON.mcps. The first resource whose getToolJson threw stopped the loop and dropped every toolbox after it. Examples are a vector engine without MCP enabled, or a deleted engine. AddWorkspace/EditWorkspace write engines before projects, so a non-MCP knowledge base usually sorted ahead of the agent's toolboxes. Whether tools survived a save came down to row order.

Changes Made

  • Room.getAllToolsJsonForRoom: catch errors for each toolbox in both agent-tool loops, the same way the room options.mcp and collaboration-default loops already do. A failing resource is logged at warn and skipped, and the rest still load.
  • Mark failed ids as seen, so the CONFIG_JSON.mcps pass doesn't retry them and log the same warning twice.
  • Guard against getWorkspaceResourcesIgnoringType returning null.

How to Test

  1. Create an agent with a toolbox and a knowledge base whose vector engine doesn't have MCP enabled.
  2. Save the agent a few times, then start a chat with it in chat mode. Leave the toolbox off the chat itself so it only comes from the agent.
  3. Before: the model often gets no tools, and the log shows Unable to add tool map from workspace mcp with MCP access needs to be enabled for this resource....
  4. After: the toolbox's tools always reach the model, and the log shows one Skipping workspace mcp <vectorId> ... warning.

Local Test Results

TC-01 — RunAgent, mixed workspace (PROJECT + inaccessible VECTOR engine)
The EngineLogger showed one WARN Skipping workspace mcp <vector-id> for workspaceId=… entry when
the loop hit the VECTOR engine, then continued and successfully loaded 8 tools from the Elsa Chat
Utilities PROJECT. The agent run completed and the response enumerated all 8 tools — the VECTOR
failure did not abort the loop.

TC-02 — AskPlayground, same room (CONFIG_JSON.mcps path)
Same WARN skip for the VECTOR engine in the log, followed by the full tools array being sent in the
model request (visible as the tools: [...] block in the EngineLogger request entry). Model response
listed all 8 Elsa Chat Utilities tools by name — the CONFIG_JSON.mcps loop behaved the same as TC-01.

TC-03 — AskPlayground, fresh room with room-options MCP attachment
No skip warnings at all — only the Elsa Chat Utilities engine was in scope via room.options.mcp.
Log showed a clean single-resource load, tools array sent, and model response listed all 8 tools.
Validates the room.options.mcp[] code path independently of the workspace loop.

TC-04 — RunAgent, VECTOR + ECU attached directly via room options
Room test-room-options-005 was created fresh with both engines attached via UpdateRoomOptions
(room.options.mcp[] array, no workspace). Log shows two [ERROR] Room:1356 Unable to add tool map from room mcp entries for the VECTOR engine — one anonymous, one as ckelly17 — then the
EngineLogger shows the full ECU tools array sent in the model request. Run completed with all 8
Elsa Chat Utilities tools in the response.

TC-05 — AskPlayground, same room (VECTOR + ECU via room options)
Same room as TC-04, same room.options.mcp[] code path. Log shows one [ERROR] Room:1356 Unable to add tool map from room mcp for the VECTOR engine, then the model request goes out with ECU
tools present. Model called GetRoomResources (namespaced as a526d7d3c-..._GetRoomResources)
on its first turn, confirming ECU tools were loaded.

Note: the room.options.mcp[] path logs the skip as ERROR at Room.java:1356, while the
WORKSPACE_RESOURCE path (TC-01 / TC-02) logs it as WARN at Room.java:1384 — different levels
for the two code paths, both caught and continued correctly.

… the rest

getAllToolsJsonForRoom wrapped each workspace tool loop (WORKSPACE_RESOURCE
rows and CONFIG_JSON.mcps) in a single try/catch, so the first resource whose
getToolJson threw - e.g. a knowledge base without MCP enabled, or a deleted
engine - aborted the loop and silently dropped every tool after it. Because
EditWorkspace writes engines before projects, saving an agent with a non-MCP
vector engine could leave a chat with no tools at all.

Catch per resource instead, mark failed ids as seen so the CONFIG_JSON pass
doesn't retry them, and guard a null resource query result.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CK6yNNgkxXZ5R81iaa1Lta
@ckelly17
ckelly17 requested a review from a team as a code owner October 23, 2026 22:41
@snyk-io

snyk-io Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@ckelly17
ckelly17 marked this pull request as draft October 23, 2026 22:42
@ckelly17 ckelly17 changed the title Draft: MCP-level resolution failures MCP-level resolution failures Oct 26, 2026
@ckelly17
ckelly17 marked this pull request as ready for review October 26, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants