Skip to content

fix(mcp/docker): odds and ends#2434

Merged
andreynering merged 8 commits intomainfrom
docker-desktop-followup
Mar 19, 2026
Merged

fix(mcp/docker): odds and ends#2434
andreynering merged 8 commits intomainfrom
docker-desktop-followup

Conversation

@meowgorithm
Copy link
Member

@meowgorithm meowgorithm commented Mar 19, 2026

Odds and ends related to the Docker Desktop integration. The main changes here are:

  • Don't write to the config until the MCP is successfully enabled
  • Run the Docker MCP availability check asynchronously so it doesn't block the UI

@meowgorithm meowgorithm requested a review from a team as a code owner March 19, 2026 15:48
@meowgorithm meowgorithm requested review from aymanbagabas and removed request for a team March 19, 2026 15:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refines the Docker Desktop MCP integration to make enabling Docker MCP more atomic (only persisting configuration after the MCP successfully starts), while also improving determinism and testability in a few MCP-adjacent areas.

Changes:

  • Stage Docker MCP configuration in-memory, initialize the MCP client, then persist the config only after successful startup (with rollback paths).
  • Make Docker MCP tool rendering deterministic by sorting map keys before rendering parameters.
  • Improve MCP tool media/base64 handling and expand related test coverage; refactor Docker MCP availability checks to be test-stubbable.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
internal/ui/model/ui.go Switch Docker MCP enable flow to prepare → start → persist with rollback on failures.
internal/ui/chat/docker_mcp.go Sort extra argument keys for stable tool rendering output.
internal/config/docker_mcp.go Extract Docker MCP config creation; split enable into prepare vs persist; add injectable runner for availability checks.
internal/config/docker_mcp_test.go Remove env-dependent skips via runner stubbing; add a “real docker when available” test.
internal/agent/tools/mcp/tools.go Normalize/validate base64 output for MCP tool media results.
internal/agent/tools/mcp/tools_test.go Add test cases for whitespace and unpadded base64 handling.
internal/agent/coordinator.go Remove Coordinator.RefreshTools from interface and implementation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@meowgorithm meowgorithm requested a review from Copilot March 19, 2026 15:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts Docker MCP enablement/presentation flows and tightens some MCP tool handling to improve UX reliability in the Docker Desktop integration.

Changes:

  • Stage Docker MCP config in-memory first, initialize the MCP client, then persist config (with rollback on failure).
  • Make Docker MCP tool parameter rendering deterministic by sorting extra-arg keys.
  • Improve MCP tool media handling by normalizing base64 inputs and extending tests; refactor Docker MCP availability probing for testability.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
internal/ui/model/ui.go Enables Docker MCP using a staged config + initialize + persist sequence with rollback.
internal/ui/chat/docker_mcp.go Sorts extra tool args for stable rendering output.
internal/config/docker_mcp.go Introduces an overridable Docker MCP version runner + splits enablement into prepare/persist steps.
internal/config/docker_mcp_test.go Makes Docker MCP tests deterministic by stubbing availability; adds an optional “real docker” test.
internal/agent/tools/mcp/tools.go Normalizes base64 inputs and expands base64 validation to accept raw encoding.
internal/agent/tools/mcp/tools_test.go Adds coverage for unpadded/whitespace base64 and decoding validation.
internal/agent/coordinator.go Removes RefreshTools from the Coordinator interface/implementation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@meowgorithm meowgorithm force-pushed the docker-desktop-followup branch from d1b2b8f to 876901b Compare March 19, 2026 17:03
Copy link
Member

@andreynering andreynering left a comment

Choose a reason for hiding this comment

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

Looks good!

I made sure to test and it's still working well.

@andreynering andreynering merged commit 7e29c85 into main Mar 19, 2026
19 of 20 checks passed
@andreynering andreynering deleted the docker-desktop-followup branch March 19, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants