Skip to content

[Bug]: Workspace bootstrap files silently truncated at 20,000 chars — agent receives incomplete context with no warning #54623

@billpark88

Description

@billpark88

Summary

When workspace bootstrap files (AGENTS.md, SOUL.md, etc.) exceed the 20,000 character bootstrap limit, they are silently truncated in the injected agent context. A WARN is logged internally but nothing is surfaced to the operator. The agent runs with incomplete instructions and the operator has no indication this happened.

Steps to Reproduce

  1. Create a workspace file (e.g. AGENTS.md or SOUL.md) that exceeds 20,000 characters
  2. Dispatch any agent turn via CLI or Mission Control
  3. Agent receives truncated context — operating rules, routing logic, or instructions at the end of the file are silently dropped

Expected Behavior

Either:

  • The CLI/dispatch surface a visible warning: Warning: AGENTS.md (31035 chars) exceeds bootstrap limit (20000); truncated. Agent may have incomplete instructions.
  • Or the gateway enforces a hard limit and rejects dispatch with a clear error

Actual Behavior

The gateway logs internally at WARN level:

workspace bootstrap file AGENTS.md is 31035 chars (limit 20000); truncating in injected context (sessionKey=agent:main:cmd)
workspace bootstrap file SOUL.md is 31952 chars (limit 20000); truncating in injected context (sessionKey=agent:main:cmd)

No warning is shown to the operator. The agent runs silently on truncated context.

Impact

  • Agents may silently lose critical operating rules, routing logic, or safety instructions
  • Operator has no way to know the agent is running on incomplete context unless they check gateway logs directly
  • Particularly dangerous for governing files like SOUL.md and AGENTS.md which define agent behavior

Environment

  • OpenClaw 2026.3.13 (61d171a)
  • macOS Darwin 25.3.0 arm64
  • Affected files: workspace AGENTS.md (31035 chars), SOUL.md (31952 chars), limit 20000 chars

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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