Skip to content

Comments

Pull master in jojwang-localbuild#9147

Closed
annajowang wants to merge 7 commits intojojwang-localbuildfrom
master
Closed

Pull master in jojwang-localbuild#9147
annajowang wants to merge 7 commits intojojwang-localbuildfrom
master

Conversation

@annajowang
Copy link
Contributor

Description

Scenarios Tested

Sample Commands

fredzqm and others added 7 commits September 17, 2025 09:34
- Improving instructions and return values in crashlytics tools
- Making interval handling more robust
- Adding return messages to avoid undefined tool responses
…ager to do more than check your login status (#9133)

* Tweak the connect prompt to look at gitignored files and to be less eager to do more than check your login status

* Loosen prescriptiveness, ease testing proactivity, come up with multiple root causes

* Respond to prompt review comments.
… in Firebase ToS (#9143)

* update_environment can be used to accept Gemini ToS

* changelog

* Update src/mcp/tools/core/update_environment.ts

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* m

* m

* m

* m

* m

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @annajowang, 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 introduces significant enhancements to the Firebase CLI's Crashlytics API interactions and the Model Context Protocol (MCP) tooling, while also cleaning up the Data Connect VSCode extension. The changes focus on improving the developer experience by providing more granular control over Crashlytics data, offering clearer guidance within the MCP environment, and refining internal error handling and project configuration management.

Highlights

  • Crashlytics API Enhancements: Introduced a new batchGetEvents function for Crashlytics, enabling efficient retrieval of multiple events by resource name. This includes comprehensive tests and refined API type definitions. Additionally, API request bodies for updateIssue were simplified, and the deleteNote function now provides a confirmation string upon successful deletion.
  • Model Context Protocol (MCP) Tooling Improvements: Refactored and enhanced MCP tools with improved Gemini Terms of Service (TOS) management and more robust project directory handling. The firebase_update_environment tool now supports accepting Gemini TOS, and firebase_get_environment reports its status. Crashlytics report filters (intervalStartTime/intervalEndTime) are made more user-friendly by automatically setting intervalEndTime if intervalStartTime is present.
  • Enhanced MCP Prompt Guidance: Significantly updated the prompt instructions for Crashlytics tools, offering comprehensive guidance for app ID discovery, issue prioritization, and detailed crash diagnosis and fix planning. This includes new steps for determining possible root causes, critiquing them, and choosing the most likely solution.
  • Data Connect VSCode Extension Cleanup: Removed AI Companion related features, telemetry, and associated imports/methods from the Data Connect VSCode extension, streamlining its functionality and reducing its footprint.
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

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.

Copy link
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 introduces a significant number of updates and refactorings, primarily centered around the Model Context Protocol (MCP) tools. Key changes include adding support for accepting Gemini Terms of Service, introducing a new batchGetEvents function for Crashlytics, and extensive improvements to the prompts and logic for AI-driven features. The codebase has been refactored for better clarity and robustness, such as centralizing error handling and API checks. Overall, the changes are positive and enhance the functionality and maintainability of the tools. I've identified a couple of areas for improvement: a misleading comment in the tool definition and a potential null reference bug in the update_environment tool.

Comment on lines 65 to 69
if (active_user_account) {
assertAccount(active_user_account, { mcp: true });
setProjectAccount(host.cachedProjectRoot!, active_user_account);
setProjectAccount(host.cachedProjectDir!, active_user_account);
output += `- Updated active account to '${active_user_account}'\n`;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

high

There's a potential for a runtime error here. The update_environment tool has optionalProjectDir: true, which means host.cachedProjectDir can be undefined. However, setProjectAccount is called with a non-null assertion (host.cachedProjectDir!). If active_user_account is provided without a project directory being set (either in this call or previously), this will cause a crash. You should add a check to ensure host.cachedProjectDir is defined before calling setProjectAccount.

Suggested change
if (active_user_account) {
assertAccount(active_user_account, { mcp: true });
setProjectAccount(host.cachedProjectRoot!, active_user_account);
setProjectAccount(host.cachedProjectDir!, active_user_account);
output += `- Updated active account to '${active_user_account}'\n`;
}
if (active_user_account) {
if (!host.cachedProjectDir) {
return mcpError(
"Cannot set active user account without a project directory. Please specify 'project_dir'.",
);
}
assertAccount(active_user_account, { mcp: true });
setProjectAccount(host.cachedProjectDir, active_user_account);
output += `- Updated active account to '${active_user_account}'\n`;
}

Comment on lines +40 to +41
/** Set this on a tool if it cannot work without a Firebase project directory. */
optionalProjectDir?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The comment for optionalProjectDir is misleading. It states "Set this on a tool if it cannot work without a Firebase project directory.", but the implementation logic (if (!tool.mcp._meta?.optionalProjectDir)) implies it should be set to true if the project directory is optional. This can cause confusion for developers creating new tools. The comment should be updated to reflect the actual behavior.

Suggested change
/** Set this on a tool if it cannot work without a Firebase project directory. */
optionalProjectDir?: boolean;
/** Set this to true on a tool if it can work without a Firebase project directory. */
optionalProjectDir?: boolean;

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.

5 participants