Check the code enhancement and remove if not useful#23664
Check the code enhancement and remove if not useful#23664Durgesh-Kumar-Dewangan wants to merge 9 commits intogoogle-gemini:mainfrom
Conversation
Refined prompt for clearer delegation intent
Summary of ChangesHello, 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 strengthens the integrity and predictability of evaluation configurations by strictly prohibiting the use of tool restriction fields. It achieves this through a dual approach of compile-time type enforcement and runtime sanitization, ensuring that all evaluations consistently utilize the full, default toolset. This change aims to prevent unintended deviations in evaluation behavior and promotes more realistic testing scenarios. Additionally, it enhances the robustness of argument parsing within several evaluation files. Highlights
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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request refactors evaluation configurations to enforce tool restriction policies and improves the robustness of tool argument parsing. It introduces ForbiddenToolKeys and NoToolRestrictions types to prevent specific tool restriction configurations in evaluation setups at compile-time. A new sanitizeConfigOverrides function was added to app-test-helper.ts to remove these forbidden keys at runtime, ensuring evals always use the full tool set. Additionally, a parseToolArgs helper function was introduced and applied across several evaluation files (grep_search_functionality.eval.ts, validation_fidelity.eval.ts, validation_fidelity_pre_existing_errors.eval.ts) to safely parse tool arguments, handling both object and string inputs, and improving error handling for malformed JSON. Minor formatting adjustments and a refined prompt for a delegation test were also included.
Summary
This PR prevents the use of tool restriction fields in evaluation configurations and adds compile-time safeguards to enforce this. It ensures evals run with the full default toolset for more realistic and consistent behavior.
Details
Disallowed tool restriction fields: excludeTools, allowedTools, coreTools, mainAgentTools
Introduced a TypeScript utility type (NoToolRestrictions) to enforce this at compile time
Added runtime sanitization in eval helpers to remove restricted fields if passed dynamically (e.g., via as any or external configs)
Updated eval files to align with the new constraints without modifying test logic or behavior
#Related Issues
Fixes #23312
Related to #23310
Related to #20328
Related to #20571
Related to #18617