continuedev / continuedev/continue

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

Open
#11,999 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:context-providers ide:jetbrains kind:bug
Dominant language
TypeScript
Stars
36k
Forks
5.4k
PR merge metrics
No merged PRs in 30d

Description

Description

While the VS Code extension properly enforces a limit of 100 results for glob searches (consistent with the MAX_AGENT_GLOB_RESULTS constant in core), the IntelliJ implementation currently neglects this parameter. This oversight results in the entire file list being returned when using broad glob patterns (e.g., */* with @codebase), leading to immediate context window exhaustion in large repositories.

Technical Root Cause

The issue is twofold:

  1. The MessageIde class in core/protocol/messenger/messageIde.ts fails to forward the maxResults argument to the internal request payload for getFileResults.
  2. The Kotlin-based getFileResults implementation in the IntelliJ extension does not contain logic to truncate the output from the underlying ripgrep process based on the maxResults parameter.
Steps to Reproduce
  1. Open a project with a significant file count (tested on a repository with 10k+ files) using the IntelliJ IDEA extension.
  2. Trigger any functionality that utilizes glob search, such as the @codebase provider with a broad pattern.
  3. Observe the protocol logs or the resulting LLM error (e.g., 400 Bad Request due to context length).
Expected Behavior

The glob search should strictly adhere to the maxResults limit provided by the core engine, ensuring system stability and consistent behavior across IDEs.

Actual Behavior

The search returns an unfiltered list of all matching files, often exceeding 10k items, which overwhelms the context window.

Environment
  • OS: Windows 11
  • IDE: IntelliJ IDEA
  • Extension Version: Latest (1.0.68)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in core/protocol/messenger/messageIde.ts and trace the getFileResults request to the Kotlin IntelliJ implementation. Reproduce a broad glob such as / in a large project and inspect the protocol logs and ripgrep output. Done means the IntelliJ path forwards and enforces maxResults, preventing oversized file lists like the VS Code behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin, typescript
Domain
devtools, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.