Problem
In agent_context.py, the memory.md content injected into agent context is truncated at 2,000 characters. This is hardcoded and applies uniformly to all agents.
2,000 characters is insufficient for agents with rich operational context:
- DevOps Moiria needs infrastructure mappings, container IDs, delegation rules
- Platform Moiria needs DB schema references, migration paths
- Curator needs the full 12-dimension monitoring framework
Agents are forced to choose between: (a) keeping memory.md under 2,000 chars (losing critical context), or (b) letting it grow and having the platform silently truncate it (agents don't know what context they're missing).
Root Cause
In the Clawith platform code (agent_context.py or similar), memory.md is read and truncated:
# Current (hardcoded)
memory_content = read_file(memory_path)[:2000]
The 2,000-char cap was likely set as a safe default to control token usage, but it's too aggressive for operational agents.
Proposed Solution
Make the cap configurable per agent, with a sane default:
# Proposed: per-agent configuration
DEFAULT_MEMORY_CAP = 5000 # chars
memory_cap = agent_config.get("memory_char_limit", DEFAULT_MEMORY_CAP)
memory_content = read_file(memory_path)[:memory_cap]
Configuration options:
- Agent-level config (preferred): Add a
memory_char_limit field to the agent profile in the database
- Soul.md directive: Parse
# memory_char_limit: 5000 from soul.md frontmatter
- Environment variable:
CLAWITH_MEMORY_CHAR_LIMIT as a global override
Recommended values:
| Tier |
Chars |
Use case |
| Minimal |
2,000 |
Simple agents with little context |
| Standard |
5,000 |
Default for new agents |
| Extended |
10,000 |
Operational agents (DevOps, Platform) |
| Maximum |
20,000 |
Agents with large reference needs |
Acceptance Criteria
Context
Priority
P2 — Agents are losing context silently. Not breaking, but degrading agent effectiveness.
Labels
enhancement, agent-context, configurability
Problem
In
agent_context.py, the memory.md content injected into agent context is truncated at 2,000 characters. This is hardcoded and applies uniformly to all agents.2,000 characters is insufficient for agents with rich operational context:
Agents are forced to choose between: (a) keeping memory.md under 2,000 chars (losing critical context), or (b) letting it grow and having the platform silently truncate it (agents don't know what context they're missing).
Root Cause
In the Clawith platform code (
agent_context.pyor similar), memory.md is read and truncated:The 2,000-char cap was likely set as a safe default to control token usage, but it's too aggressive for operational agents.
Proposed Solution
Make the cap configurable per agent, with a sane default:
Configuration options:
memory_char_limitfield to the agent profile in the database# memory_char_limit: 5000from soul.md frontmatterCLAWITH_MEMORY_CHAR_LIMITas a global overrideRecommended values:
Acceptance Criteria
Context
Priority
P2 — Agents are losing context silently. Not breaking, but degrading agent effectiveness.
Labels
enhancement,agent-context,configurability