warp icon indicating copy to clipboard operation
warp copied to clipboard

Token limit exceeded error prevents completion of code tasks despite available request quota

Open ccmyk opened this issue 1 year ago • 6 comments

Pre-submit Checks

Describe the bug

Description: When working with Warp's AI agent on code refactoring tasks, I'm encountering a persistent "Token limit exceeded" error with the message: "The output from generating a code diff was too large to read." This occurs despite having only used 109 out of my 1000 Pro plan requests.

Current Behavior: • AI suggests it can work within limits by switching to smaller tasks • When attempting to switch to smaller tasks, same error occurs • AI confirms no need for new terminal session, but error persists • Unable to complete any meaningful code changes due to token limit, regardless of task size • Error occurs even when working with single, small files • No clear path to resolution or workaround provided

Notably inconsistent behavior: • The AI agent can maintain normal conversation about the issue and project • AI can discuss another topic. • BUT: Any attempt to actually implement code changes results in the token limit error • This suggests the token limit might be specifically affecting code generation/diff creation rather than general AI communication • Creates a frustrating situation where the AI can explain what needs to be done but cannot actually perform the task.

This inconsistency further demonstrates that the token limit issue appears to be specific to code generation tasks rather than a general communication limitation, making the error message potentially misleading about the actual problem.

..............

Example: I asked "Are you able to switch to another refactoring that wouldn't exceed the token limit? Or are you unable to do anything at this point in this workflow?"

Warp: Yes, let's switch to a simpler component or task to avoid token limits. Let's examine the page.js in the home directory first, since it's a good starting point for implementing proper Next.js patterns without hitting token limits.

I see several issues in the HomePage component that we can improve to better follow Next.js and React patterns:

  1. We're still using direct DOM manipulation with GSAP
  2. Canvas elements are being created directly in JSX
  3. Animation state management could be moved to a custom hook
  4. We can better use Next.js features like Server Components

Let's refactor this component to follow better practices, focusing on one section at a time to avoid token limits.

Token limit exceeded: The output from generating a code diff was too large to read.

To reproduce

  1. Start a coding session with the AI agent
  2. Request a code refactoring task
  3. Receive "Token limit exceeded" error
  4. Attempt to work around by: • Asking AI to work on smaller tasks instead • Requesting to switch to different files • Asking if a new terminal session would help
  5. Error persists regardless of attempted solutions

Expected behavior

• AI should either:

  1. Successfully handle smaller tasks as it suggests it can
  2. Provide clear limits on what size changes are possible
  3. Offer working solutions to break down larger tasks
  4. Successfully continue work after suggesting a task switch

Screenshots, videos, and logs

[

Image

Image

Image

Image

warp-logs.zip

](url)

Operating system (OS)

macOS

Operating system and version

MacOS 15.4.1

Shell Version

zsh 5.9 (arm-apple-darwin22.1.0)

Current Warp version

v0.2025.04.16.08.11.stable_02

Regression

Yes, this bug started recently or with an X Warp version

Recent working Warp date

4/20/2025

Additional context

No response

Does this block you from using Warp daily?

Yes, this issue prevents me from using Warp daily.

Is this an issue only in Warp?

Yes, I confirmed that this only happens in Warp, not other terminals.

Warp Internal (ignore): linear-label:b9d78064-c89e-4973-b153-5178a31ee54e

None

ccmyk avatar Apr 20 '25 19:04 ccmyk

Having the same issue. Any updates?

rustam-swe avatar May 24 '25 14:05 rustam-swe

I am also having the same issue. Can someone please update, as this is severely impacting the ability to use Warp.

royhensens avatar May 28 '25 19:05 royhensens

Also, for anyone having this issue, I've tried a different approach, asking Warp to "please show me the intended changes to be made to the files (preferably displaying the full end-result), so I can implement these changes manually". This actually resulted in Warp giving me the intended end-result for each file, thus enabling me to continue with the suggested code-changes, without the token issue.

Bump: @rustam-swe @ccmyk

royhensens avatar May 28 '25 19:05 royhensens

I reached out to Warp directly, and they provided this response:

"Each request to Agent mode has an associated token size (which is based on the number of characters in the request; see more here: (https://help.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them)).

Please see more in our [Agent Mode documentation] (https://docs.warp.dev/features/warp-ai/agent-mode#exceeding-agent-mode-limits), there are two types of limits: • Message token limit: This is related to the size of individual queries and their context. • Monthly token limit: This is a cumulative limit on the total number of tokens used over a month.

If you see the​ "Message token limit", that means your input (plus attached context) exceeds the maximum context window of the model you're using. For example, GPT-4o has a context window limit of 123,904 tokens. If you exceed that, you may receive no output.

To fix this, try: • Starting a new conversation • Reducing the number of blocks or lines attached to your query ​ If the error you're seeing is "You've reached the monthly token limit", that indicates that you've hit the second type of limit. This limit resets monthly, and you should see when it resets on the Settings > AI page."

I ended up upgrading to the Turbo plan for one month, which appeared to resolve the issue during that period. @rustam-swe @royhensens

ccmyk avatar May 29 '25 03:05 ccmyk

This issue highlights exactly why real-time token/context visibility is needed in Warp.

The 'Token limit exceeded' error is particularly frustrating because users have no way to predict when it will hit. The root causes described here — large diffs exceeding output limits, agent self-correction loops consuming tokens silently — are all symptoms of the same problem: zero runtime monitoring.

Concrete suggestion: If Warp exposed even a basic context window usage indicator (e.g., how much of the model's context has been consumed in the current conversation), users could:

  1. Know when to start a new conversation before hitting limits
  2. Identify token-burning loops early and interrupt them
  3. Make informed decisions about attaching large files/blocks as context

Related: #5993 was closed after adding a small per-request i chip, but the persistent monitoring that would actually prevent issues like this one remains unimplemented.

From the oh-my-warp project — where we build structured agent workflows — this is the #1 limitation for power users running complex multi-step tasks.

hongvincent avatar Mar 01 '26 07:03 hongvincent

Just a side note, if the team would allow one of the most requested features since 2024 (local / other models), you could shave off 90% of tokens with RTK to use your quota more efficiently. https://github.com/warpdotdev/Warp/issues/4339 https://github.com/warpdotdev/Warp/issues/4687 https://github.com/rtk-ai/rtk

reneleonhardt avatar Mar 01 '26 11:03 reneleonhardt