continuedev / continuedev/continue
[Bug] Missing results limitation in IntelliJ getFileResults implementation causing context overflow
Nobody has claimed this yet.
- 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:
- The
MessageIdeclass incore/protocol/messenger/messageIde.tsfails to forward themaxResultsargument to the internal request payload forgetFileResults. - The Kotlin-based
getFileResultsimplementation in the IntelliJ extension does not contain logic to truncate the output from the underlyingripgrepprocess based on themaxResultsparameter.
Steps to Reproduce
- Open a project with a significant file count (tested on a repository with 10k+ files) using the IntelliJ IDEA extension.
- Trigger any functionality that utilizes glob search, such as the
@codebaseprovider with a broad pattern. - 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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