What happened?
A simple chat query (今天天气如何, "what's the weather today") using the gpt-5-nano model fails with:
"Your input exceeds the context window of this model. Please adjust your input and try again."
Observability metrics for the run:
- LLM CALLS: 5
- TOOL CALLS: 4
- HITL: 1
- FAILED: 5 / 5 — every LLM call in the run failed
- INPUT: 372K tokens
- OUTPUT: 155 tokens
- TOTAL: 372K tokens
- DURATION: 28.08s
gpt-5-nano's context window is on the order of ~128K tokens (and likely smaller on some versions). 372K is several times over, so every call in the run collapses. The user then waits 28 seconds before seeing the error.
Notably, the user input itself is one short Chinese sentence (今天天气如何). The 372K tokens almost certainly come from accumulated memory system blocks and/or prior tool / turn results that the chat graph is re-injecting on every LLM call without any token-aware truncation.

What did you expect to happen?
- A simple, fresh-feeling query like "what's the weather today" should not blow the context window, even on a small model.
- The chat agent should either:
- Cap / summarize memory and prior-turn content before each LLM call so the assembled prompt fits the chosen model's window, or
- Fail fast (before the first LLM call) with a clear error if the assembled prompt exceeds the window, instead of burning 28s + 5 retries before showing the error.
Steps to reproduce
- Sign in, open
https://ai.firetable.tech/chat.
- Use a session / thread where memory has accumulated over time (so the memory system block has grown).
- With
OPENAI_MODEL=gpt-5-nano (or whatever selector picks the nano model), send 今天天气如何 (or any short, fresh query).
- Observe: 5 LLM calls, 5 failed, 28s wasted, final response is the context-window-exceeded error.
Severity
S1 — feature broken, no workaround from the user side. The user can't fix this by retrying; the only escape is to switch to a larger-context model or wipe memory manually.
Environment
- Site:
https://ai.firetable.tech/chat
- Model:
gpt-5-nano
- Deployed commit:
6730007 (refactor(env): replace NEXT_PUBLIC_* with window.__CONFIG__ injection)
- Input size at failure: 372K tokens (vs ~128K context window for the nano model)
Investigation hints
Likely root cause (for whoever picks this up):
- The chat graph likely prepends the memory system block and/or prior thread messages on every LLM call without checking the assembled token count against the chosen model's limit.
- Suggested mitigations:
- Token-aware prompt assembly — count input tokens → summarize / truncate memory if it exceeds ~80% of the model's window.
- Pre-call validation — reject before invoking the model when the assembled prompt is over the window, so the user gets a fast, clear error.
- Smaller-window models should auto-summarize memory instead of letting raw accumulated memory flow through unchanged.
Relevant logs / screenshots

Self-checks
What happened?
A simple chat query (
今天天气如何, "what's the weather today") using thegpt-5-nanomodel fails with:Observability metrics for the run:
gpt-5-nano's context window is on the order of ~128K tokens (and likely smaller on some versions). 372K is several times over, so every call in the run collapses. The user then waits 28 seconds before seeing the error.Notably, the user input itself is one short Chinese sentence (
今天天气如何). The 372K tokens almost certainly come from accumulated memory system blocks and/or prior tool / turn results that the chat graph is re-injecting on every LLM call without any token-aware truncation.What did you expect to happen?
Steps to reproduce
https://ai.firetable.tech/chat.OPENAI_MODEL=gpt-5-nano(or whatever selector picks the nano model), send今天天气如何(or any short, fresh query).Severity
S1 — feature broken, no workaround from the user side. The user can't fix this by retrying; the only escape is to switch to a larger-context model or wipe memory manually.
Environment
https://ai.firetable.tech/chatgpt-5-nano6730007(refactor(env): replace NEXT_PUBLIC_* with window.__CONFIG__ injection)Investigation hints
Likely root cause (for whoever picks this up):
Relevant logs / screenshots
Self-checks
main(current deployed commit6730007).