Skip to content

fix(patch): cherry-pick 1cae5ab to release/v0.28.0-preview.3-pr-18376 to patch version v0.28.0-preview.3 and create version 0.28.0-preview.4#18463

Merged
skeshive merged 1 commit intorelease/v0.28.0-preview.3-pr-18376from
hotfix/v0.28.0-preview.3/0.28.0-preview.4/preview/cherry-pick-1cae5ab/pr-18376
Feb 6, 2026
Merged

fix(patch): cherry-pick 1cae5ab to release/v0.28.0-preview.3-pr-18376 to patch version v0.28.0-preview.3 and create version 0.28.0-preview.4#18463
skeshive merged 1 commit intorelease/v0.28.0-preview.3-pr-18376from
hotfix/v0.28.0-preview.3/0.28.0-preview.4/preview/cherry-pick-1cae5ab/pr-18376

Conversation

@gemini-cli-robot
Copy link
Copy Markdown
Collaborator

This PR automatically cherry-picks commit 1cae5ab to patch version v0.28.0-preview.3 in the preview release to create version 0.28.0-preview.4.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @gemini-cli-robot, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request implements a targeted solution to rectify an incompatibility issue with Xcode 26.3's mcpbridge tool, which was found to produce malformed JSON-RPC responses. By introducing an intermediary transport layer, the system can now seamlessly process these responses, ensuring robust communication and functionality when integrating with Xcode's developer tools.

Highlights

  • Xcode MCP Bridge Fix: Introduced a new XcodeMcpBridgeFixTransport to address non-compliant JSON-RPC responses from Xcode 26.3's mcpbridge tool. This transport intercepts messages and correctly populates the structuredContent field when it's missing but the content field contains stringified JSON.
  • Conditional Transport Application: The mcp-client.ts file has been updated to conditionally apply the XcodeMcpBridgeFixTransport wrapper only when the mcpbridge command is executed via xcrun, ensuring the fix is targeted where needed.
  • Enhanced Debugging for Wrapped Transports: Modified the debug logging mechanism to correctly access the stderr stream of the underlying StdioClientTransport even when it's wrapped by XcodeMcpBridgeFixTransport, preserving debugging capabilities.
  • Comprehensive Unit Tests: Added a dedicated test file (xcode-mcp-fix-transport.test.ts) with unit tests for the XcodeMcpBridgeFixTransport, covering scenarios where non-compliant responses are fixed, compliant responses are passed through, and non-JSON content is ignored.
Changelog
  • packages/core/src/tools/mcp-client.ts
    • Imported XcodeMcpBridgeFixTransport for use in the client.
    • Modified the createTransport function to allow reassignment of the transport variable.
    • Implemented logic to wrap the StdioClientTransport with XcodeMcpBridgeFixTransport if the command is xcrun mcpbridge.
    • Updated stderr debug logging to correctly handle the wrapped transport by unwrapping it to access the underlying stream.
  • packages/core/src/tools/xcode-mcp-fix-transport.test.ts
    • Added a new file containing unit tests for the XcodeMcpBridgeFixTransport.
    • Tests verify that non-compliant mcpbridge responses are correctly fixed by populating structuredContent.
    • Tests confirm that compliant responses are passed through without modification.
    • Tests ensure that responses with non-JSON text in content are ignored.
  • packages/core/src/tools/xcode-mcp-fix-transport.ts
    • Added a new file defining the XcodeMcpBridgeFixTransport class.
    • Implemented a wrapper transport that intercepts JSONRPCMessages.
    • Added fixStructuredContent method to parse stringified JSON from result.content and populate result.structuredContent when it's missing.
Activity
  • This pull request was automatically generated by gemini-cli-robot to cherry-pick a fix into a preview release branch.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 6, 2026

Size Change: +2.39 kB (+0.01%)

Total Size: 23.7 MB

Filename Size Change
./bundle/gemini.js 23.7 MB +2.39 kB (+0.01%)
ℹ️ View Unchanged
Filename Size
./bundle/sandbox-macos-permissive-closed.sb 1.03 kB
./bundle/sandbox-macos-permissive-open.sb 890 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB
./bundle/sandbox-macos-restrictive-closed.sb 3.29 kB
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB

compressed-size-action

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request cherry-picks a fix for non-compliant responses from Xcode's mcpbridge. It introduces a new XcodeMcpBridgeFixTransport wrapper to intercept and correct these responses. The implementation is sound and includes relevant tests. My review includes suggestions to improve encapsulation by avoiding access to private properties through type assertions, which will make the code more robust and maintainable.

Comment on lines +1912 to +1916
const underlyingTransport =
transport instanceof XcodeMcpBridgeFixTransport
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
(transport as any).transport
: transport;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

Accessing the private transport property using as any is a workaround that breaks encapsulation. Once the transport property in XcodeMcpBridgeFixTransport is made public (as suggested in another comment), you can access it directly without the type cast and eslint-disable comment, making the code cleaner and more robust.

      const underlyingTransport =
        transport instanceof XcodeMcpBridgeFixTransport
          ? transport.transport
          : transport;

extends EventEmitter
implements Transport
{
constructor(private readonly transport: Transport) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The transport property is marked as private, but it's being accessed from mcp-client.ts using a type assertion (as any). This breaks encapsulation and makes the code brittle. To provide proper, type-safe access, please change the visibility of transport to public.

Suggested change
constructor(private readonly transport: Transport) {
constructor(public readonly transport: Transport) {

@gemini-cli gemini-cli bot added the status/need-issue Pull requests that need to have an associated issue. label Feb 6, 2026
@skeshive skeshive enabled auto-merge (squash) February 6, 2026 19:47
@skeshive skeshive self-requested a review February 6, 2026 19:47
@skeshive skeshive merged commit 900e0c9 into release/v0.28.0-preview.3-pr-18376 Feb 6, 2026
25 of 26 checks passed
@skeshive skeshive deleted the hotfix/v0.28.0-preview.3/0.28.0-preview.4/preview/cherry-pick-1cae5ab/pr-18376 branch February 6, 2026 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/need-issue Pull requests that need to have an associated issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants