Skip to content

fix(patch): cherry-pick 1cae5ab to release/v0.27.2-pr-18376 to patch version v0.27.2 and create version 0.27.3#18464

Merged
skeshive merged 1 commit intorelease/v0.27.2-pr-18376from
hotfix/v0.27.2/0.27.3/stable/cherry-pick-1cae5ab/pr-18376
Feb 6, 2026
Merged

fix(patch): cherry-pick 1cae5ab to release/v0.27.2-pr-18376 to patch version v0.27.2 and create version 0.27.3#18464
skeshive merged 1 commit intorelease/v0.27.2-pr-18376from
hotfix/v0.27.2/0.27.3/stable/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.27.2 in the stable release to create version 0.27.3.

@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 critical fix for an incompatibility issue with Xcode 26.3's mcpbridge. It introduces a specialized transport wrapper that automatically corrects malformed JSONRPC responses, ensuring that structured data is correctly interpreted by populating the structuredContent field when it's erroneously placed in the content field. This enhancement improves the robustness and compatibility of the system when interacting with mcpbridge without impacting other transport mechanisms.

Highlights

  • New Transport Layer for Xcode Fix: Introduced a new XcodeMcpBridgeFixTransport class designed to specifically intercept and correct non-compliant JSONRPC responses originating from Xcode's mcpbridge.
  • Response Correction Logic: The XcodeMcpBridgeFixTransport now parses the content field of mcpbridge responses. If this field contains valid JSON and structuredContent is missing, the parsed JSON is used to populate the structuredContent field, ensuring protocol compliance.
  • Conditional Application: The new fix transport is applied conditionally within mcp-client.ts, wrapping the standard StdioClientTransport only when the detected command is xcrun mcpbridge, thus optimizing performance by not affecting other transport types.
  • Enhanced Debugging for Wrapped Transports: The debug logging mechanism for stderr has been updated to correctly access and log output from the underlying StdioClientTransport, even when it's wrapped by the XcodeMcpBridgeFixTransport.
  • Comprehensive Unit Testing: A new test file, xcode-mcp-fix-transport.test.ts, has been added to thoroughly validate the XcodeMcpBridgeFixTransport. Tests cover scenarios where malformed responses are fixed, compliant responses are left untouched, and non-JSON content is gracefully ignored.
Changelog
  • packages/core/src/tools/mcp-client.ts
    • Imported XcodeMcpBridgeFixTransport for use in the createTransport function.
    • Modified the createTransport function to conditionally instantiate and wrap the StdioClientTransport with XcodeMcpBridgeFixTransport when xcrun mcpbridge is detected.
    • Updated the stderr debug logging logic to correctly handle the XcodeMcpBridgeFixTransport wrapper, ensuring stderr output from the underlying transport is still captured.
  • packages/core/src/tools/xcode-mcp-fix-transport.test.ts
    • Added a new test file to provide comprehensive unit tests for the XcodeMcpBridgeFixTransport.
    • Included tests to verify that non-compliant mcpbridge responses are correctly fixed by populating structuredContent.
    • Added tests to confirm that already compliant responses are passed through without modification.
    • Implemented tests to ensure that responses containing non-JSON text in the content field are ignored and do not cause errors.
  • packages/core/src/tools/xcode-mcp-fix-transport.ts
    • Added a new file defining the XcodeMcpBridgeFixTransport class.
    • Implemented the core logic to intercept JSONRPC messages, check for result.content without structuredContent, and attempt to parse the content as JSON.
    • If parsing is successful, the structuredContent field is populated with the parsed JSON, addressing the mcpbridge non-compliance.
Activity
  • No specific activity (comments, reviews, etc.) has been recorded for this pull request yet.
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.5 MB

Filename Size Change
./bundle/gemini.js 23.5 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. The changes introduce a transport wrapper, XcodeMcpBridgeFixTransport, to intercept and correct these responses. The implementation is sound and includes tests. My review includes two high-severity suggestions to improve type safety and encapsulation by removing the use of as any and avoiding access to private properties.

Comment on lines +1895 to +1899
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 breaks encapsulation and bypasses TypeScript's type safety. A cleaner approach would be to expose the underlying transport publicly.

In packages/core/src/tools/xcode-mcp-fix-transport.ts, you can change the constructor to make the transport property public:

// packages/core/src/tools/xcode-mcp-fix-transport.ts
export class XcodeMcpBridgeFixTransport
  extends EventEmitter
  implements Transport
{
  constructor(public readonly transport: Transport) { // <-- Make public
    super();
    // ...
  }
  // ...
}

This allows you to access transport.transport directly and safely here, improving maintainability.

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

Comment on lines +78 to +79
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const result = response.result as any;
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

Using as any completely bypasses TypeScript's type safety. A slightly safer alternative is to cast to Record<string, any>, which at least asserts that result is an object-like structure. This improves readability and is a step towards better type safety, while also allowing the removal of the eslint-disable comment.

Suggested change
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const result = response.result as any;
const result = response.result as Record<string, any>;

@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 self-requested a review February 6, 2026 19:47
@skeshive skeshive enabled auto-merge (squash) February 6, 2026 19:47
@skeshive skeshive merged commit d5a135b into release/v0.27.2-pr-18376 Feb 6, 2026
26 checks passed
@skeshive skeshive deleted the hotfix/v0.27.2/0.27.3/stable/cherry-pick-1cae5ab/pr-18376 branch February 6, 2026 19:49
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