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
Conversation
Summary of ChangesHello @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 Highlights
Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
|
Size Change: +2.39 kB (+0.01%) Total Size: 23.5 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
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.
| const underlyingTransport = | ||
| transport instanceof XcodeMcpBridgeFixTransport | ||
| ? // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| (transport as any).transport | ||
| : transport; |
There was a problem hiding this comment.
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;| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| const result = response.result as any; |
There was a problem hiding this comment.
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.
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | |
| const result = response.result as any; | |
| const result = response.result as Record<string, any>; |
This PR automatically cherry-picks commit 1cae5ab to patch version v0.27.2 in the stable release to create version 0.27.3.