Skip to content

[Bug]: Context overflow error #5771

@realQhimself

Description

@realQhimself

Summary

Context overflow error occurs on fresh sessions with minimal workspace, even after deleting all memory databases and simplifying configuration files. The agent becomes unusable after 2-3 messages.

Steps to reproduce

  1. Delete all memory: rm -rf ~/.openclaw/memory/*
  2. Delete workspace memory files: rm -rf ~/.openclaw/workspace/memory/*
  3. Simplify AGENTS.md to ~30 lines, delete MEMORY.md, SOUL.md, USER.md, etc.
  4. Delete any node_modules folders in workspace projects
  5. Restart gateway: pkill -9 -f openclaw && nohup openclaw gateway run --bind loopback --port 18789 &
  6. Send /new in Telegram to start fresh session
  7. Send 2-3 short messages like "Hello" and "How are you?"

Expected behavior

A new session with minimal workspace should handle simple messages without overflow.

Actual behavior

After 2-3 messages, any subsequent message triggers:

Context overflow: prompt too large for the model. Try again with less input or a larger-context model.

The issue persists despite:

  • Deleting 12MB main.sqlite memory database
  • Removing all node_modules directories
  • Simplifying AGENTS.md to minimal content
  • Starting fresh sessions with /new

Environment

  • Clawdbot version: 2026.1.29 (a5b4d22)
  • OS: Linux (Ubuntu on GCP VM)
  • Install method: direct install
  • Model: google/gemini-2.0-flash
  • Interface: Telegram bot

Logs or screenshots

Gateway starts successfully with no errors:

[gateway] agent model: google/gemini-2.0-flash
[gateway] listening on ws://127.0.0.1:18789
[telegram] [default] starting provider (@YourBotName)

No errors appear in /tmp/openclaw.log before the overflow occurs.


Additional Notes

Workaround attempts that failed:

  • agents.defaults.autoCompact: true → "Unrecognized key: autoCompact"
  • agent.autoCompact: true → "agent.* was moved" validation error (causes startup crash loop)

Feature requests:

  1. Add option to completely disable memory/RAG
  2. Add context size limit configuration
  3. Provide token count visibility for debugging
  4. Fix/document the correct autoCompact configuration path

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions