GPT5 incorrect context counting #1171

Closed
opened 2026-02-16 17:29:51 -05:00 by yindo · 2 comments
Owner

Originally created by @asafyish on GitHub (Aug 8, 2025).

Originally assigned to: @thdxr on GitHub.

Just used GPT5 and halfway the context window I got the attached error. It was all a long session. no compaction run before. The session was open for many hours (worked on it on and off).

Image Image Image
Originally created by @asafyish on GitHub (Aug 8, 2025). Originally assigned to: @thdxr on GitHub. Just used GPT5 and halfway the context window I got the attached error. It was all a long session. no compaction run before. The session was open for many hours (worked on it on and off). <img width="335" height="118" alt="Image" src="https://github.com/user-attachments/assets/02ab3bd8-07bb-4835-b7b0-9cc892824d34" /> <img width="1666" height="143" alt="Image" src="https://github.com/user-attachments/assets/1bb065de-4484-4d5a-a5f5-47e9a95f17c1" /> <img width="251" height="92" alt="Image" src="https://github.com/user-attachments/assets/763bccc0-5143-45b3-b9a3-b589f46f6d97" />
yindo closed this issue 2026-02-16 17:29:51 -05:00
Author
Owner

@asafyish commented on GitHub (Aug 8, 2025):

According to https://simonwillison.net/2025/Aug/7/gpt-5/:
"The models have an input limit of 272,000 tokens" which is pretty close to where it stopped working for me.
it's a bit odd since on https://platform.openai.com/docs/models/gpt-5 it says:
"400,000 context window".

I did use tools (edit, read, grep) and mcp (context7).

@asafyish commented on GitHub (Aug 8, 2025): According to https://simonwillison.net/2025/Aug/7/gpt-5/: "The models have an input limit of 272,000 tokens" which is pretty close to where it stopped working for me. it's a bit odd since on https://platform.openai.com/docs/models/gpt-5 it says: "400,000 context window". I did use tools (edit, read, grep) and mcp (context7).
Author
Owner

@rekram1-node commented on GitHub (Dec 27, 2025):

[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

@rekram1-node commented on GitHub (Dec 27, 2025): [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1171