#Openclaw + ollama llama3.1 8b ignores AGENTS.md rules at first, until I remind the agent. Why?
1 messages · Page 1 of 1 (latest)
Because with Ollama + a small-ish instruct model, AGENTS.md is “just more text in the prompt,” not a hard constraint—and those models are noticeably less consistent at prioritizing long, global instructions unless they’re made very salient.
A few concrete things that commonly cause the exact “ignores it at first, obeys after I remind it” pattern:
- Instruction salience / recency
- OpenClaw injects
AGENTS.mdas part of the system prompt context, but the model still has to attend to it. - When you remind it (“follow AGENTS.md”), you’ve just moved the rule into the most recent user turn, so it becomes the most salient instruction and it suddenly complies.
- Context pressure → early compaction / truncation effects
- Local models often run with a smaller effective context window (or your Ollama
num_ctxis set low). - OpenClaw also has non-trivial overhead from tool schemas + system prompt. If you’re near the window edge, it’s easy for the model to behave like it “didn’t see” parts of your workspace instructions.
- After compaction, OpenClaw can re-inject only specific
AGENTS.mdsections (defaults are["Session Startup", "Red Lines"]). If your rules live elsewhere, they can become less reliably present after compaction.
- Role handling differences in OpenAI-compatible servers
- Some OpenAI-compatible backends/templates don’t weight
systemmessages as strongly as OpenAI/Anthropic do, so “system rules” are easier to ignore.