Skip to content

fix(intellij): enforce results limit for glob search#12000

Open
xxsLuna wants to merge 3 commits intocontinuedev:mainfrom
xxsLuna:fix/intellij-glob-search-limit
Open

fix(intellij): enforce results limit for glob search#12000
xxsLuna wants to merge 3 commits intocontinuedev:mainfrom
xxsLuna:fix/intellij-glob-search-limit

Conversation

@xxsLuna
Copy link
Copy Markdown
Contributor

@xxsLuna xxsLuna commented Apr 2, 2026

Summary

This PR fixes a bug where the maxResults parameter was not correctly passed from the Core engine to the IntelliJ extension during glob searches, causing context overflow in large repositories.

Key Changes

  1. Core Protocol: Updated core/protocol/messenger/messageIde.ts to include the maxResults parameter in the getFileResults request payload. Previously, this parameter was missing, causing the IDE implementation to receive undefined.
  2. IntelliJ Extension: Updated IntelliJIde.kt to handle the maxResults parameter. It now filters out blank lines and uses .take(maxResults) to ensure the returned file list complies with the requested limit.

Impact

  • Standardizes glob search behavior between VS Code and IntelliJ.
  • Prevents context overflow issues when using @codebase or broad glob patterns in large projects.

Verification

  • Verified on a repository with 10k+ files (integrated the fix into a micube-final branch).
  • Confirmed that results are now capped at 100 files and the "Truncation warning" is visible in the chat interface.

Closes #11999


Summary by cubic

Enforces the maxResults limit for glob searches in IntelliJ by passing and applying the value through the Core protocol. Aligns behavior with VS Code and prevents oversized context when using @codebase or broad patterns in large repos.

  • Bug Fixes
    • Core: include optional maxResults in getFileResults request.
    • IntelliJ: filter blank lines and apply the limit to cap returned files.

Written for commit 35b7913. Summary will update on new commits.

@xxsLuna xxsLuna requested a review from a team as a code owner April 2, 2026 07:43
@xxsLuna xxsLuna requested review from sestinj and removed request for a team April 2, 2026 07:43
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Apr 2, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

[Bug] Missing results limitation in IntelliJ getFileResults implementation causing context overflow

1 participant