Repository navigation
Conversation
… 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
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
ckelly17
marked this pull request as draft
October 23, 2026 22:42
ckelly17
marked this pull request as ready for review
October 26, 2026 15:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
GetWorkspacestill listed them.Room.getAllToolsJsonForRoomloaded the agent's toolboxes with onetry/catcharound each whole loop: once for theWORKSPACE_RESOURCErows and once forCONFIG_JSON.mcps. The first resource whosegetToolJsonthrew stopped the loop and dropped every toolbox after it. Examples are a vector engine without MCP enabled, or a deleted engine.AddWorkspace/EditWorkspacewrite 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 roomoptions.mcpand collaboration-default loops already do. A failing resource is logged atwarnand skipped, and the rest still load.CONFIG_JSON.mcpspass doesn't retry them and log the same warning twice.getWorkspaceResourcesIgnoringTypereturningnull.How to Test
Unable to add tool map from workspace mcpwithMCP access needs to be enabled for this resource....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 whenthe 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 responselisted 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-005was created fresh with both engines attached viaUpdateRoomOptions(
room.options.mcp[]array, no workspace). Log shows two[ERROR] Room:1356 Unable to add tool map from room mcpentries for the VECTOR engine — one anonymous, one asckelly17— then theEngineLogger 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 mcpfor the VECTOR engine, then the model request goes out with ECUtools present. Model called
GetRoomResources(namespaced asa526d7d3c-..._GetRoomResources)on its first turn, confirming ECU tools were loaded.
Note: the
room.options.mcp[]path logs the skip asERRORat Room.java:1356, while theWORKSPACE_RESOURCEpath (TC-01 / TC-02) logs it asWARNat Room.java:1384 — different levelsfor the two code paths, both caught and continued correctly.