Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 25, 2026

The main workflow schema defined both mode and type properties with identical enums for custom MCP server configuration. Investigation shows mode is only meaningful for built-in tools (GitHub, Serena) where it controls execution mode ("local"/"remote" for GitHub, "docker"/"local" for Serena). For custom MCP servers, only type is used by the parser to determine connection protocol ("stdio", "http").

Changes

  • Removed mode property entirely from custom MCP servers in main_workflow_schema.json

    • The deprecated field has been completely removed (not just marked as deprecated)
    • GitHub/Serena tools continue using mode for their specific purposes (unchanged)
  • Enhanced type property description

    • Documented connection protocol semantics (stdio/http)
    • Noted "local" is normalized to "stdio" during parsing
  • Added migration codemod (codemod_mcp_mode_to_type.go)

    • Automatically renames mode to type in mcp-servers: section
    • Preserves GitHub and Serena tool mode fields (not affected)
    • Handles multiple MCP servers and preserves comments/formatting
    • Registered in codemod registry with ID mcp-mode-to-type-migration
  • Added comprehensive tests (codemod_mcp_mode_to_type_test.go)

    • 6 test cases covering all migration scenarios
    • Verifies GitHub/Serena fields remain unchanged
    • Tests multiple servers and formatting preservation

Migration Path

Users can automatically migrate workflows using:

gh aw compile --fix

The codemod will transform:

Before:

mcp-servers:
  my-server:
    mode: stdio  # ❌ No longer supported
    command: node

After:

mcp-servers:
  my-server:
    type: stdio  # ✅ Correct
    command: node

Built-in tools remain unchanged:

tools:
  github:
    mode: remote  # ✅ Still valid - controls local vs hosted execution

Testing

  • ✅ All codemod tests pass (6/6)
  • ✅ All codemod registry tests pass (5/5)
  • ✅ Manual workflow migration confirmed working
  • ✅ Format and lint checks pass
  • ✅ Binary rebuilt with updated schema
  • ✅ Code review passed with no issues
Original prompt

This section details on the original issue you should resolve

<issue_title>[plan] Clarify or deprecate "mode" property in main schema</issue_title>
<issue_description>## Objective

Determine the purpose of the mode property in main schema and either document it clearly or deprecate it.

Context

From discussion #11706: The main schema defines both mode and type with identical enum values, but MCP config schema only has type. It's unclear if mode is:

  • An alias for type
  • A deprecated field
  • A workflow-specific property

Approach

  1. Search codebase for usage of mode field in MCP context
  2. Check if parser/compiler treats mode and type differently
  3. Review git history to understand when/why mode was added
  4. Either:
    • Document mode as an alias (if intentional)
    • Mark as deprecated with migration guide
    • Remove if unused

Files to Investigate

  • pkg/parser/mcp.go - Check parsing logic
  • pkg/workflow/mcp-config-*.go - Check compilation logic
  • .github/workflows/*.md - Check for usage in workflows
  • Git history of main_workflow_schema.json

Acceptance Criteria

  • Usage of mode vs type is clarified
  • Decision documented in schema description or comments
  • If deprecated: Add deprecation notice with migration path
  • If alias: Add clear documentation explaining relationship
  • If unused: Remove from schema
  • Update docs if needed

AI generated by Plan Command for discussion #11706

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.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Clarify or deprecate mode property in main schema Deprecate mode field for custom MCP servers in main schema Jan 25, 2026
Copilot AI requested a review from pelikhan January 25, 2026 01:32
@pelikhan
Copy link
Contributor

@copilot remove deprecated features from the schema and add codemods as needed

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

Copilot AI commented Jan 25, 2026

@copilot remove deprecated features from the schema and add codemods as needed

Done! Removed the deprecated mode field from the schema and added a migration codemod.

Changes in commit 2f35101:

  1. Removed mode field entirely from pkg/parser/schemas/main_workflow_schema.json
  2. Added migration codemod (codemod_mcp_mode_to_type.go) that:
    • Automatically renames mode to type in custom MCP servers (mcp-servers: section)
    • Preserves GitHub and Serena tool mode fields (unaffected)
    • Handles multiple servers and preserves comments/formatting
  3. Added tests with 100% pass rate covering all scenarios

Users can migrate with: gh aw compile --fix

The codemod only affects custom MCP servers - GitHub and Serena tool mode fields remain valid and unchanged.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Deprecate mode field for custom MCP servers in main schema Remove mode field from custom MCP servers schema and add migration codemod Jan 25, 2026
@pelikhan pelikhan marked this pull request as ready for review January 25, 2026 05:42
@pelikhan pelikhan merged commit 809794c into main Jan 25, 2026
118 checks passed
@pelikhan pelikhan deleted the copilot/clarify-deprecate-mode-property branch January 25, 2026 05:51
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.

[plan] Clarify or deprecate "mode" property in main schema

2 participants