Skip to content

🔌 fix: Load MCP Tools When the Agent Builder Is Open - #17534

Open
dustinhealy wants to merge 1 commit into
devfrom
fix/agent-builder-mcp-discovery
Open

dustinhealy wants to merge 1 commit into
devfrom
fix/agent-builder-mcp-discovery

Conversation

@dustinhealy

@dustinhealy dustinhealy commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Opening Agent Builder while chatting with an ephemeral agent can leave MCP details showing Unknown and no tools. The builder incorrectly inherits the current chat's restriction on observing tool authorization.

Enable the builder's observers independently of the chat agent type. The existing hydration and panel-visibility gates remain in place, and opening the builder does not select the ephemeral chat agent as the agent being edited.

How it works

-observeToolAuthorization={conversation != null && !isEphemeralAgent(agentId)}
+observeToolAuthorization={conversation != null}

The visible builder owns discovery of its tool catalog and authorization state. This also lets its active queries refetch after connection mutations invalidate them.

Type of change

  • Bug fix
  • Tests / tooling / CI

Testing

Tested environments/configuration: Chromium, synthetic local MCP server using the real MCP SDK, mock model, disposable MongoDB. The cold-cache model spec hides composer tool controls so another observer cannot mask the regression. No model inference request is required.

Automated tests:

  • Updated component regression fails before the fix and passes afterward; all 3 tests pass.
  • The same browser regression fails on the base application and passes with the fix, checking the tools/status requests and successful tool selection without API prefetching.
  • Client typecheck and affected static checks pass.
  • Lighthouse passes with the existing 250 ms database-query delay: median LCP 3398 ms, CLS 0.018, TBT 55 ms across three runs.

Screenshots

Matching captures from the running application at 1280 × 720 with identical scenario and lockfile hashes. Only synthetic test data is shown.

Before: Unknown and no tools After: Connected and selectable tools
Builder before Builder after

Risk / compatibility

The change enables discovery when the builder is visible even if the active chat is ephemeral. It preserves the existing hydration and visibility gates. No API or configuration changes.

Checklist

  • I reviewed my own changes
  • Relevant tests have been added or updated
  • Existing relevant tests pass
  • The change does not introduce new warnings or errors
  • User-facing or complex behavior is documented where necessary
  • Required dependency changes have been merged/published — N/A
  • Required documentation PR: N/A

Copilot AI balanced review requested due to automatic review settings October 28, 2026 11:37
@dustinhealy

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T11:39:44.036575Z 293b615 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are identified for the builder MCP discovery change.

No open issues 🎉

What changed in this PR

Fixes MCP tool discovery in Agent Builder when the current chat uses an ephemeral agent. Builder authorization observers no longer depend on the chat agent type, while hydration and panel-visibility gates remain unchanged.

Changes:

  • Enables builder observers without selecting the ephemeral chat agent for editing.
  • Updates component coverage and adds a cold-cache browser regression using a model spec that hides composer tool controls.
File Description
e2e/​specs/​mock/​mcp.spec.ts Adds browser coverage for MCP status, discovery requests, and tool selection.
e2e/​config/​librechat.e2e.yaml Adds a model spec that isolates builder discovery from composer observers.
client/​src/​components/​SidePanel/​Agents/​AgentPanelSwitch.tsx Removes the ephemeral-agent restriction on builder observers.
client/​src/​components/​SidePanel/​Agents/​AgentPanelSwitch.spec.tsx Verifies observers activate without selecting the ephemeral agent for editing.

Review effort: Balanced

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 293b615ef0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

This branch has not been deployed

No deployments
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