Repository navigation
Conversation
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 significantly improves the usability and predictability of the 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
The pull request successfully implements the max_results parameter for the glob tool, allowing for better control over the number of returned file paths. The truncation messages for both grep and glob tools have been significantly improved to provide more structured and actionable warnings to the agent. The changes include appropriate constant definitions, schema updates, core logic for truncation, and comprehensive test coverage for the new functionality and validation rules. The code is well-tested and adheres to the project's standards.
3498039 to
72c71c4
Compare
…cation messages
Glob tool had no result-count limit — `glob('**/*.ts')` on a large monorepo
returns all paths, silently blowing up context windows. Grep truncation
messages were passive prose the agent couldn't act on.
- Add `max_results` optional parameter (default 500) to glob tool schema
- Enforce truncation after sort-by-recency so most recent files are returned
- Replace passive grep truncation messages with structured actionable warnings
- Surface truncation clearly in both llmContent and returnDisplay
Fixes google-gemini#21694
Made-with: Cursor
72c71c4 to
3091b03
Compare
|
Hi there! Thank you for your interest in contributing to Gemini CLI. To ensure we maintain high code quality and focus on our prioritized roadmap, we have updated our contribution policy (see Discussion #17383). We only guarantee review and consideration of pull requests for issues that are explicitly labeled as 'help wanted'. All other community pull requests are subject to closure after 14 days if they do not align with our current focus areas. For this reason, we strongly recommend that contributors only submit pull requests against issues explicitly labeled as 'help-wanted'. This pull request is being closed as it has been open for 14 days without a 'help wanted' designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding and for being part of our community! |
Summary
max_resultsoptional parameter (default 500) to glob tool to prevent unbounded results from blowing up context windows on large monoreposDetails
Glob truncation (new)
max_resultsoptional parameter (default 500) added to glob tool schema andGlobToolParamsllmContentandreturnDisplaysurface truncation clearlyGrep truncation messaging (improved)
(results limited to N matches for performance)with structured⚠️ RESULTS TRUNCATEDblock that instructs the agent to narrow the pattern or increasetotal_max_matchesreturnDisplaynow shows actual limit:(truncated at 100, more exist)instead of(limited)Files changed:
constants.ts— newDEFAULT_GLOB_MAX_RESULTS = 500base-declarations.ts— newGLOB_PARAM_MAX_RESULTSconstantdefault-legacy.ts,gemini-3.ts—max_resultsadded to glob schema (both model family sets)glob.ts— interface, validation, and execute() truncation logicgrep-utils.ts— rewritten truncation messages informatGrepResults()grep-utils.test.tsHow to Validate
```bash
npm test -w @google/gemini-cli-core -- src/tools/glob.test.ts
npm test -w @google/gemini-cli-core -- src/tools/grep-utils.test.ts
npm test -w @google/gemini-cli-core -- src/tools/grep.test.ts
npm test -w @google/gemini-cli-core -- src/tools/ripGrep.test.ts
npm test -w @google/gemini-cli-core -- src/tools/definitions/coreToolsModelSnapshots.test.ts
```
All 183 tests pass (143 tool tests + 40 snapshot tests).
tsc --noEmitclean.Fixes #21694