How to fix: context length exceeded
Official fix for context length exceeded: run /compress on the session and check /usage; the durable fix is setting model.context_length in config.yaml to your model's real limit.
Who this is for:Anyone hitting the context ceiling after long chats or heavy tool output.
Steps
-
Compress the current session
Slash command inside the chat.
/compress -
Check usage and the detected limit
/usage -
Set it explicitly in config.yaml
Especially for self-hosted/local models, match the server's real capability.
model: context_length: 131072
How to verify
- Chat works again after compressing
- The startup message shows a context limit matching your model's spec
FAQ
Local models hit this more often?
The official FAQ notes that with Custom endpoints (e.g. Ollama) you should set context length to the server's actual capability; auto-detection may be wrong.
Related pages
- Download and Install Hermes Agent on macOS
- Download and Install Hermes Agent on Windows (Desktop / PowerShell / WSL2)
- Download and Install Hermes Agent on Linux
- Install Hermes Agent on WSL2 (Advanced Windows Path)
- Hermes Agent Model Provider and API Key Setup
- Migrate from OpenClaw to Hermes Agent (official hermes claw migrate)
- How to fix: hermes: command not found
- How to fix: API key not set / invalid API key
- How to fix: Hermes requires Python 3.11 or newer
- Telegram + Hermes Agent: Known Pitfalls and Fixes
- Curated official issues
- School solution cards