Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix context window management algorithm to handle large terminal output or file reads #827

Open
ifrankwang opened this issue Nov 26, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ifrankwang
Copy link

Which API Provider are you using?

OpenRouter

Which Model are you using?

anthropic/claude-3.5-sonnet:beta

What happened?

While Cline searching for specific class in the project module, the error shows up as:

API Request Failed
This endpoint's maximum context length is 200000 tokens. However, you requested about 344204 tokens (336012 of text input, 8192 in the output). Please reduce the length of either one, or use the "middle-out" transform to compress your prompt automatically.

but the there's only 37 result:

[search_files for 'enum.*BusinessType'] Result:

Found 37 results.

...location of class...

<environment_details>
# VSCode Visible Files
...files...

# VSCode Open Tabs
...tabs...
</environment_details>

Steps to reproduce

  1. Cline suggest the syntax error result (wrong type)
  2. Cline correct itself by search the usage of the type
  3. Cline popup the error

Relevant API REQUEST output

No response

Additional context

image

@ifrankwang ifrankwang added the bug Something isn't working label Nov 26, 2024
@saoudrizwan
Copy link
Collaborator

Hello, thank you for reporting this.

Sometimes when you run a command with massive output or cline tries to read a binary file with an unexpected extension, it might overload the context window. Theres still some work that needs to go into the context management algorithm to better handle these scenarios.

@saoudrizwan saoudrizwan changed the title Search result reach maximum context length Fix context window management algorithm to handle large terminal output or file reads Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants