Which version of LM Studio?
LM Studio 0.4.11-1
Which operating system?
Linux (but also reproducible on Windows and MacOS)
What is the bug?
LM Studio fails silently and breaks model interactions when a tool response (e.g., a full Wikipedia page) exceeds the configured Context Length of the loaded model.
Instead of warning the user that the context window has been exceeded (e.g., showing 12526/4096 tokens in the input), the app continues processing and causes the model to output either complete garbage text (e.g., Bee<|"|> extraar zerod toara/?) or generic fallbacks like "I am a large language model, trained by Google." without answering the question.
Logs
Here is an example of the garbage output received after a massive tool response was injected:
Bee<|"|> extraar zerod toara/?
To Reproduce
Steps to reproduce the behavior:
- Load a model with a default context length set to a low value (e.g., 4096 tokens).
- Enable a tool or MCP server (like the Wikipedia tool) that can return a large volume of data.
- Ask a question that triggers the tool to fetch a large amount of content (e.g., "Explain Capoeira" which returns ~12k tokens).
- Observe that the input tokens indicator in the chat box shows that the limit is exceeded (e.g.,
12526/4096).
- See the model break and output garbage or an irrelevant generic response without any error warning from LM Studio.
Which version of LM Studio?
LM Studio 0.4.11-1
Which operating system?
Linux (but also reproducible on Windows and MacOS)
What is the bug?
LM Studio fails silently and breaks model interactions when a tool response (e.g., a full Wikipedia page) exceeds the configured Context Length of the loaded model.
Instead of warning the user that the context window has been exceeded (e.g., showing
12526/4096tokens in the input), the app continues processing and causes the model to output either complete garbage text (e.g.,Bee<|"|> extraar zerod toara/?) or generic fallbacks like "I am a large language model, trained by Google." without answering the question.Logs
Here is an example of the garbage output received after a massive tool response was injected:
To Reproduce
Steps to reproduce the behavior:
12526/4096).