[FEATURE]: undo last prompt if it exceeds token limit #2291

Open
opened 2026-02-16 17:35:00 -05:00 by yindo · 4 comments
Owner

Originally created by @bcardarella on GitHub (Oct 26, 2025).

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

If a prompt exceeds token limit (i.e. I ask LLM to pull down a large file to analyze) then I follow up with a prompt that should fit the request still exceeds token limit becuase the previous token exceeding prompt is still in the context. It would be nice UX to undo that exceeding prompt or don't put it into the history entirely

Originally created by @bcardarella on GitHub (Oct 26, 2025). ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request If a prompt exceeds token limit (i.e. I ask LLM to pull down a large file to analyze) then I follow up with a prompt that should fit the request still exceeds token limit becuase the previous token exceeding prompt is still in the context. It would be nice UX to undo that exceeding prompt or don't put it into the history entirely
yindo added the discussion label 2026-02-16 17:35:00 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Oct 26, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #2464: Describes the exact same problem of token count exceeding limits and blocking the work process
  • #2637: Requests configuration to limit input tokens per request to prevent this exact scenario
  • #1990: Requests user controls for context management, including commands like /clear to manage bloated context
  • #1212: Similar issue where content exceeds context limits making sessions impossible to continue

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Oct 26, 2025): This issue might be a duplicate of existing issues. Please check: - #2464: Describes the exact same problem of token count exceeding limits and blocking the work process - #2637: Requests configuration to limit input tokens per request to prevent this exact scenario - #1990: Requests user controls for context management, including commands like /clear to manage bloated context - #1212: Similar issue where content exceeds context limits making sessions impossible to continue Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Oct 26, 2025):

you can use /undo to make it exit context, say if you wanted to edit the prompt you sent to remove eztra tokens

@rekram1-node commented on GitHub (Oct 26, 2025): you can use /undo to make it exit context, say if you wanted to edit the prompt you sent to remove eztra tokens
Author
Owner

@bcardarella commented on GitHub (Oct 26, 2025):

I know, what I'm suggesting is that this is automatic. If the token limits exceeds there is no reason to keep that prompt in the history as it will just do so again

@bcardarella commented on GitHub (Oct 26, 2025): I know, what I'm suggesting is that this is automatic. If the token limits exceeds there is no reason to keep that prompt in the history as it will just do so again
Author
Owner

@rekram1-node commented on GitHub (Oct 26, 2025):

nice just wanted to make sure u were aware of that option, this makes sense itd be useful fot sure

@rekram1-node commented on GitHub (Oct 26, 2025): nice just wanted to make sure u were aware of that option, this makes sense itd be useful fot sure
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2291