Skip to content

Fix MCPGatewayConfig type name collision#7589

Closed
Copilot wants to merge 4 commits intomainfrom
copilot/fix-mcp-gateway-config-collision
Closed

Fix MCPGatewayConfig type name collision#7589
Copilot wants to merge 4 commits intomainfrom
copilot/fix-mcp-gateway-config-collision

Conversation

Copy link
Contributor

Copilot AI commented Dec 25, 2025

Fix MCPGatewayConfig type name collision

Successfully resolved type name collision where MCPGatewayConfig was defined with completely different structures in two packages.

Summary

Problem: MCPGatewayConfig was defined in two locations with fundamentally different purposes:

  1. pkg/awmg/gateway.go - Container for multiple MCP servers configuration
  2. pkg/workflow/tools_types.go - Runtime execution configuration for the gateway

Solution: Renamed both types to clearly indicate their purpose:

  • MCPGatewayConfigMCPGatewayServersConfig (in pkg/awmg/)
  • MCPGatewayConfigMCPGatewayRuntimeConfig (in pkg/workflow/)

Recent Updates

  • Merged main branch
  • Applied code formatting with make fmt
  • All lint checks pass (make lint)

Changes Made

  • Explored repository and understood the issue
  • Renamed pkg/awmg/gateway.go type to MCPGatewayServersConfig
  • Updated all references in pkg/awmg/ package (6 files)
  • Renamed pkg/workflow/tools_types.go type to MCPGatewayRuntimeConfig
  • Updated all references in pkg/workflow/ package (5 files)
  • Updated documentation in specs/mcp-gateway.md
  • Verified builds succeed (gh-aw and awmg binaries)
  • Verified all tests pass for modified packages
  • Confirmed no type name collisions remain
  • Merged main branch
  • Applied formatting and linting

Files Modified (13 files + 2 formatted)

pkg/awmg/ (MCPGatewayConfig → MCPGatewayServersConfig):

  • gateway.go - Type definition and 10 function signature updates
  • gateway_test.go - 12 test reference updates
  • gateway_inspect_integration_test.go - 1 test reference
  • gateway_integration_test.go - 1 test reference
  • gateway_rewrite_test.go - 2 test references
  • gateway_streamable_http_test.go - 2 test references

pkg/workflow/ (MCPGatewayConfig → MCPGatewayRuntimeConfig):

  • tools_types.go - Type definition
  • gateway.go - 10 function signature updates
  • tools_parser.go - 2 function updates
  • sandbox.go - 1 field type update (+ formatting)
  • gateway_test.go - 29 test reference updates
  • sandbox_test.go - 5 test reference updates

Documentation:

  • specs/mcp-gateway.md - Updated type name reference

Formatting:

  • pkg/parser/schemas/main_workflow_schema.json - Formatting (whitespace)
  • pkg/workflow/sandbox.go - Formatting (alignment)

Verification

✅ All awmg package tests pass (TestMCPGatewayServersConfig_* tests)
✅ All workflow gateway tests pass (TestGetMCPGatewayRuntimeConfig, TestGenerateMCPGateway*, etc.)
✅ All sandbox tests pass (TestSandboxConfigWithMCPGateway, etc.)
✅ Both gh-aw and awmg binaries build successfully
✅ No MCPGatewayConfig type name collisions remain in codebase
✅ All lint checks pass
✅ Zero breaking changes - pure rename operation

Original prompt

This section details on the original issue you should resolve

<issue_title>[plan] Fix MCPGatewayConfig naming collision</issue_title>
<issue_description>## Objective

Resolve the critical type name collision where MCPGatewayConfig is defined with completely different structures in two locations.

Context

The same type name MCPGatewayConfig exists in:

  1. pkg/cli/mcp_gateway_command.go:24 - Container for multiple MCP servers
  2. pkg/workflow/tools_types.go:235 - Configuration for gateway execution

These represent fundamentally different concepts and need distinct names.

Approach

  1. Rename pkg/cli/mcp_gateway_command.go:24 type to MCPGatewayServersConfig
  2. Rename pkg/workflow/tools_types.go:235 type to MCPGatewayRuntimeConfig
  3. Update all references throughout the codebase:
    • Search for MCPGatewayConfig usage
    • Update to use the appropriate renamed type based on context
    • Update struct literal instantiations
  4. Run make test to verify no breakage

Files to Modify

  • pkg/cli/mcp_gateway_command.go - Rename type and update references
  • pkg/workflow/tools_types.go - Rename type and update references
  • Find and update all files referencing these types (use grep/ripgrep)

Acceptance Criteria

  • No type name collisions exist
  • Type names clearly indicate their purpose (servers vs runtime)
  • All references updated correctly
  • All tests pass (make test)
  • Build succeeds (make build)

Estimated Effort

2-3 hours
Related to #7369

AI generated by Plan Command for discussion #7368

Comments on the Issue (you are @copilot in this section)


💡 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.

- Renamed pkg/awmg/gateway.go MCPGatewayConfig to MCPGatewayServersConfig (contains multiple MCP servers)
- Renamed pkg/workflow/tools_types.go MCPGatewayConfig to MCPGatewayRuntimeConfig (contains runtime execution config)
- Updated all references in both packages and test files
- Updated documentation reference in specs/mcp-gateway.md
- All tests pass for modified packages

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix MCPGatewayConfig naming collision issue Fix MCPGatewayConfig type name collision Dec 25, 2025
Copilot AI requested a review from mnkiefer December 25, 2025 05:17
@pelikhan pelikhan marked this pull request as ready for review December 25, 2025 10:39
@pelikhan
Copy link
Contributor

@copilot merge main, lint

Copilot AI and others added 2 commits December 25, 2025 10:45
- Merged main branch into copilot/fix-mcp-gateway-config-collision
- Applied formatting with make fmt
- All lint checks pass

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 25, 2025

@copilot merge main, lint

Done! ✅

  • Merged main branch (commit 916f817)
  • Applied formatting (commit 1bab18e)
  • All lint checks pass

The merge introduced some changes from main including updates to gateway.go and test files, which were successfully merged with our MCPGatewayConfig rename changes.

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.

[plan] Fix MCPGatewayConfig naming collision

3 participants