#Session auto-reset when conversation exceeded the maximum context size

1 messages ยท Page 1 of 1 (latest)

lost vine
#

Hi everyone,

Has anyone experienced a sudden session reset?

The error message:
"Session auto-reset โ€” the conversation exceeded the maximum context size and could not be compressed further. Your next message will start a fresh session."

Details:
Reset happens out of nowhere
Conversation context is lost
Can occur at any time (no specific pattern)

If you've encountered this, please share:
What platform/LLM are you using?
Did you find a fix?

Thanks! ๐Ÿ™

junior bridge
#

what is your ctx length set too?

lost vine
#

adding error message

2026-05-11 18:11:59,421 INFO gateway.run: response ready: platform=discord chat=1503327091377307659 time=14.2s api_calls=2 response=69 chars
2026-05-11 18:11:59,422 INFO gateway.run: Skipping transcript persistence for context-overflow failure in session 20260511_180322_79e3bd92 to prevent session growth loop.
2026-05-11 18:11:59,423 INFO gateway.run: Auto-resetting session 20260511_180322_79e3bd92 after compression exhaustion.
2026-05-11 18:11:59,442 INFO gateway.platforms.base: [Discord] Sending response (227 chars) to 1503327091377307659```
junior bridge
#

what model?

lost vine
#

@junior bridge

Environment:
OS: Linux (Ubuntu/Debian)
Installation: Docker on VPS
Provider/Model: MiniMax-M2.7 via minimax
Platform: Self-hosted Hermes Agent on VPS

What I was trying to do:
Use Hermes Agent for ongoing conversations and task execution. After several message exchanges or complex tasks, the session appears to reset or lose context mid-conversation.

What happened instead:
When context length approaches the model's limit (or during long multi-step tasks), the session resets โ€” conversation history is lost and the agent appears to start fresh, as if the context window was exceeded and the session was restarted.

Steps to reproduce:
Engage in a conversation with multiple back-and-forth exchanges (10+ turns)
Or run a complex multi-step task that generates significant tool outputs
At some point, session resets with no warning

What I already tried:
Restarting the gateway (hermes gateway restart)
Using shorter, more focused prompts
Running hermes debug share to gather logs

Relevant logs:
Debug Report: https://paste.rs/4dMyj
agent.log: https://dpaste.com/ATZQQRJKF
gateway.log: https://paste.rs/FGl9E

junior bridge
#

@past rock what happened here ?

past rockBOT
past rockBOT
# junior bridge <@1498667414873968700> what happened here ?

logs tell a pretty clear story. here's what happened:

Root cause: compression.threshold: 0.9 is too aggressive

MiniMax-M2.7 has a ~128k context window. Your sessions keep hitting ~105-110k tokens, at which point Hermes tries to compress the transcript. With compression.threshold: 0.9, it waits until the context is 90% full before triggering compression โ€” that's cutting it extremely close. By the time it tries to compress, there's no room left to do the work, so it fails and resets.

Contributing factors from your logs:

  • 16 sessions reset in a single day โ€” this isn't a one-off, it's a configuration problem
  • agent.max_turns: 9999 means sessions run indefinitely, accumulating massive context
  • You have 137 skills loaded + mempalace MCP with 29 tools โ€” the system prompt alone is huge, leaving less room for conversation
  • You were literally asking the agent to "split skills to reduce context" but the task itself kept overflowing

The fix:

Lower your compression threshold so it kicks in earlier:

hermes config set compression.threshold 0.7

Or even 0.6 given your setup. This gives the compressor room to actually do its job before you're jammed against the ceiling.

Also consider:

hermes config set agent.max_turns 50

9999 turns is effectively unlimited โ€” long-running tasks are the direct cause of 100k+ token sessions.

The kanban duplicate column max_retries error is a separate known migration bug โ€” it's benign (won't crash anything) but worth noting.

The gateway restart chaos was caused by you repeatedly trying to restart while an agent was mid-run. Each drain hit the 60s timeout with an active agent, requiring SIGKILL. Not a bug, just rough to deal with when sessions are hanging due to context issues.

tl;dr โ€” drop compression.threshold to 0.65-0.7 and set a sane max_turns limit. The resets should stop.

junior bridge
#

Let us know if this helps !

lost vine
#

halo @junior bridge @past rock thx for the solution, it works!!