[ui] Fix MCP toggle not shown for models without gallery config #7318
+74
−15
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
This PR fixes the MCP/Agent toggle not appearing in the chat UI when users create model configurations that share the same model file. The toggle was incorrectly gated behind a gallery config check, which only exists for gallery-installed models.
Changes
UI Template (
chat.html): Removed{{ if $galleryConfig }}wrapper around MCP toggle logic. The toggle now displays for any model with MCP configuration, regardless of installation source.Test Coverage (
model_config_test.go): Added test verifying multiple configs pointing to the same model file maintain independent MCP settings.Example Scenario
Before:
/chat/model-agentshowed no MCP toggle (missing gallery file)After:
/chat/model-agentshows MCP toggle (checks model config directly)Notes for Reviewers
The fix is a 2-line change in the template. Gallery configs are metadata for gallery-installed models and should not gate feature availability.
Signed commits
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.