Skip to content

fix: recover MCP config for ACP automation presets - #354

Open
rahuliitk wants to merge 1 commit into
OpenHands:mainfrom
allgpt-co:fix/acp-mcp-config-inheritance
Open

fix: recover MCP config for ACP automation presets#354
rahuliitk wants to merge 1 commit into
OpenHands:mainfrom
allgpt-co:fix/acp-mcp-config-inheritance

Conversation

@rahuliitk

Copy link
Copy Markdown

Summary

  • recover persisted MCP configuration for ACP-backed automation workspaces when Workspace.get_mcp_config() returns an empty mapping
  • preserve the existing public get_mcp_config() path whenever it returns configured servers
  • apply the compatibility path consistently to both prompt and plugin presets
  • add regression coverage for both presets

Root cause

In openhands-sdk==1.42.1, ACPAgentSettings includes an mcp_config field, but APIRemoteWorkspace.get_mcp_config() returns {} unless the fetched settings are OpenHandsAgentSettings. As a result, ACP automation presets silently started without their configured MCP servers.

The compatibility helper falls back to the workspace's existing _fetch_agent_settings() result only when the public method returns no configuration. It can be removed once the SDK public method supports ACP settings directly.

Verification

  • uv run pytest -q tests/test_preset_router.py — 98 passed, 41 skipped
  • uv run ruff check tests/test_preset_router.py
  • uv run pyright tests/test_preset_router.py
  • uv run python -m py_compile openhands/automation/presets/prompt/sdk_main.py openhands/automation/presets/plugin/sdk_main.py tests/test_preset_router.py
  • uv run pre-commit run --files openhands/automation/presets/prompt/sdk_main.py openhands/automation/presets/plugin/sdk_main.py tests/test_preset_router.py
  • live read-only automation run initialized configured MCP servers and completed successfully

@github-actions github-actions Bot added the type: fix A bug fix label Aug 20, 2026
@all-hands-bot

Copy link
Copy Markdown
Contributor

👋 This PR needs a couple of things fixed before OpenHands can review it:

  • the PR description's HUMAN: section needs at least 20 characters describing what you tested, not just the template placeholder

Push an update once this is addressed and this check re-runs automatically.

This is an automated check - no AI was used to generate this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants