Skip to content

Introduce LLMClientApp type to remove xcode from MCP API swagger enum#5081

Open
yrobla wants to merge 2 commits intomainfrom
fix/llm-client-type
Open

Introduce LLMClientApp type to remove xcode from MCP API swagger enum#5081
yrobla wants to merge 2 commits intomainfrom
fix/llm-client-type

Conversation

@yrobla
Copy link
Copy Markdown
Contributor

@yrobla yrobla commented Apr 28, 2026

Summary

Xcode (GitHub Copilot for Xcode) supports LLM gateway but not MCP client registration. Previously declared as a ClientApp constant, it was included in the generated swagger enum for the MCP API, misleading consumers into attempting unsupported operations.

Introduce a separate LLMClientApp type for LLM-gateway-only tools and move the Xcode constant to it. The internal clientAppConfig entry uses an explicit ClientApp(Xcode) cast so the config table continues to work unchanged. Regenerate swagger docs to confirm xcode no longer appears in the enum.

Fixes #5073

Type of change

  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Dependency update
  • Documentation
  • Other (describe):

Test plan

  • Unit tests (task test)
  • E2E tests (task test-e2e)
  • Linting (task lint-fix)
  • Manual testing (describe below)

API Compatibility

  • This PR does not break the v1beta1 API, OR the api-break-allowed label is applied and the migration guidance is described above.

Changes

File Change

Does this introduce a user-facing change?

Implementation plan

Approved implementation plan

Special notes for reviewers

@github-actions github-actions Bot added the size/XS Extra small PR: < 100 lines changed label Apr 28, 2026
JAORMX
JAORMX previously approved these changes Apr 28, 2026
@yrobla yrobla requested a review from Copilot April 28, 2026 09:33
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.79%. Comparing base (b470ddb) to head (6933b58).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5081      +/-   ##
==========================================
- Coverage   69.80%   69.79%   -0.02%     
==========================================
  Files         570      570              
  Lines       56919    56919              
==========================================
- Hits        39731    39725       -6     
- Misses      14139    14150      +11     
+ Partials     3049     3044       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
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 refactors client-type definitions to prevent LLM-gateway-only tools (specifically GitHub Copilot for Xcode) from being exposed as MCP-capable ClientApp values in the generated MCP API swagger schema.

Changes:

  • Introduces LLMClientApp and moves the Xcode constant to this new type to keep it out of the swagger-derived ClientApp enum.
  • Keeps internal config behavior unchanged by explicitly casting Xcode to ClientApp where needed.
  • Regenerates swagger artifacts (swagger.yaml, swagger.json, docs.go) to remove xcode from the ClientApp enum.

Reviewed changes

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

Show a summary per file
File Description
pkg/client/config.go Adds LLMClientApp, retypes Xcode, and casts to ClientApp in internal config table to preserve behavior while keeping swagger enums correct.
pkg/client/llm_gateway_test.go Updates test to use ClientApp(Xcode) after retyping Xcode.
pkg/client/config_test.go Updates switch cases to use ClientApp(Xcode) after retyping Xcode.
docs/server/swagger.yaml Regenerated swagger output removing xcode from ClientApp enum.
docs/server/swagger.json Regenerated swagger output removing xcode from ClientApp enum.
docs/server/docs.go Regenerated embedded swagger template removing xcode from ClientApp enum.

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

Comment thread pkg/client/config_test.go Outdated
Comment thread pkg/client/config_test.go Outdated
@yrobla yrobla force-pushed the fix/llm-client-type branch from c1ed2cf to 21ba442 Compare April 28, 2026 09:50
@yrobla yrobla requested a review from Copilot April 28, 2026 09:50
@github-actions github-actions Bot added size/XS Extra small PR: < 100 lines changed and removed size/XS Extra small PR: < 100 lines changed labels Apr 28, 2026
Copy link
Copy Markdown
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

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.


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

Comment thread pkg/client/config_test.go Outdated
Xcode (GitHub Copilot for Xcode) supports LLM gateway but not MCP client
registration. Previously declared as a ClientApp constant, it was included
in the generated swagger enum for the MCP API, misleading consumers into
attempting unsupported operations.

Introduce a separate LLMClientApp type for LLM-gateway-only tools and move
the Xcode constant to it. The internal clientAppConfig entry uses an explicit
ClientApp(Xcode) cast so the config table continues to work unchanged.
Regenerate swagger docs to confirm xcode no longer appears in the enum.

Closes #5073
@yrobla yrobla force-pushed the fix/llm-client-type branch from 21ba442 to aea0d81 Compare April 28, 2026 09:56
@github-actions github-actions Bot added size/XS Extra small PR: < 100 lines changed and removed size/XS Extra small PR: < 100 lines changed labels Apr 28, 2026
@yrobla yrobla requested a review from JAORMX April 28, 2026 09:57
@github-actions github-actions Bot added size/XS Extra small PR: < 100 lines changed and removed size/XS Extra small PR: < 100 lines changed labels Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Extra small PR: < 100 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

llm: use separate type for LLM-gateway-only clients to remove them from MCP API swagger enum

5 participants