[Bug]: Bootstrap files (SOUL.md, USER.md) not injected into system prompt for openai-completions API
Description
When using a local LLM via Ollama with the openai-completions API, bootstrap files (SOUL.md, USER.md, IDENTITY.md) are not injected into the system prompt's Project Context section. The same configuration works correctly with Anthropic providers.
Steps to Reproduce
- Configure Ollama provider with
api: "openai-completions":
{
"models": {
"providers": {
"ollama": {
"baseUrl": "http://127.0.0.1:11434/v1",
"apiKey": "ollama-local",
"api": "openai-completions",
"models": [{
"id": "qwen2.5:32b",
"name": "qwen2.5:32b",
"contextWindow": 131072,
"maxTokens": 8192
}]
}
}
},
"agents": {
"defaults": {
"model": { "primary": "ollama/qwen2.5:32b" },
"workspace": "/path/to/workspace"
}
}
}
-
Create workspace files:
SOUL.md - Agent personality
USER.md - User profile with name, timezone, etc.
IDENTITY.md - Agent identity
-
Run agent and ask about user info:
clawdbot agent --agent main -m "What is my name and timezone?"
Expected Behavior
Agent should know user's name and timezone from USER.md content injected into Project Context (works correctly with Anthropic).
Actual Behavior
- Agent does NOT have USER.md content in its context
- Agent tries to use
memory_get tool to fetch SOUL.md, USER.md, IDENTITY.md
memory_get fails with "error": "path required" because these aren't memory paths
- Model hallucinates or says it doesn't have the information
- Input tokens are consistently ~4096 regardless of conversation length
Session Transcript Evidence
{"type":"message","message":{"role":"assistant","content":[
{"type":"toolCall","name":"memory_get","arguments":{"path":"SOUL.md"}},
{"type":"toolCall","name":"memory_get","arguments":{"path":"USER.md"}}
],"usage":{"input":4096,"output":68}}}
{"type":"message","message":{"role":"toolResult","content":[
{"type":"text","text":"{\"path\": \"USER.md\", \"disabled\": true, \"error\": \"path required\"}"}
]}}
Verification
Switching to Anthropic provider with same workspace:
clawdbot models set anthropic/claude-sonnet-4-5
clawdbot agent --agent main -m "What is my name and timezone?"
Result: Agent correctly responds with user's name and timezone from USER.md.
Environment
- Clawdbot version: 2026.1.24-3
- OS: Windows 11
- Ollama version: Latest
- Model: qwen2.5:32b (also tested with llama3.1:8b)
Analysis
The system prompt building code in system-prompt.js correctly includes contextFiles (lines 419-434), and openai-completions.js correctly adds system messages when context.systemPrompt exists (lines 398-402). However, somewhere in the chain between buildEmbeddedSystemPrompt and the actual API call, the system prompt content appears to not be reaching Ollama.
Direct curl calls to Ollama with system prompts work correctly:
curl http://127.0.0.1:11434/v1/chat/completions -d '{
"model": "qwen2.5:32b",
"messages": [
{"role": "system", "content": "User is John in America/New_York timezone"},
{"role": "user", "content": "What is my timezone?"}
]
}'
# Returns correct answer
Workaround
Use Anthropic provider instead of Ollama for agents that need bootstrap file context.
[Bug]: Bootstrap files (SOUL.md, USER.md) not injected into system prompt for openai-completions API
Description
When using a local LLM via Ollama with the
openai-completionsAPI, bootstrap files (SOUL.md, USER.md, IDENTITY.md) are not injected into the system prompt's Project Context section. The same configuration works correctly with Anthropic providers.Steps to Reproduce
api: "openai-completions":{ "models": { "providers": { "ollama": { "baseUrl": "http://127.0.0.1:11434/v1", "apiKey": "ollama-local", "api": "openai-completions", "models": [{ "id": "qwen2.5:32b", "name": "qwen2.5:32b", "contextWindow": 131072, "maxTokens": 8192 }] } } }, "agents": { "defaults": { "model": { "primary": "ollama/qwen2.5:32b" }, "workspace": "/path/to/workspace" } } }Create workspace files:
SOUL.md- Agent personalityUSER.md- User profile with name, timezone, etc.IDENTITY.md- Agent identityRun agent and ask about user info:
clawdbot agent --agent main -m "What is my name and timezone?"Expected Behavior
Agent should know user's name and timezone from USER.md content injected into Project Context (works correctly with Anthropic).
Actual Behavior
memory_gettool to fetch SOUL.md, USER.md, IDENTITY.mdmemory_getfails with"error": "path required"because these aren't memory pathsSession Transcript Evidence
{"type":"message","message":{"role":"assistant","content":[ {"type":"toolCall","name":"memory_get","arguments":{"path":"SOUL.md"}}, {"type":"toolCall","name":"memory_get","arguments":{"path":"USER.md"}} ],"usage":{"input":4096,"output":68}}} {"type":"message","message":{"role":"toolResult","content":[ {"type":"text","text":"{\"path\": \"USER.md\", \"disabled\": true, \"error\": \"path required\"}"} ]}}Verification
Switching to Anthropic provider with same workspace:
Result: Agent correctly responds with user's name and timezone from USER.md.
Environment
Analysis
The system prompt building code in
system-prompt.jscorrectly includescontextFiles(lines 419-434), andopenai-completions.jscorrectly adds system messages whencontext.systemPromptexists (lines 398-402). However, somewhere in the chain betweenbuildEmbeddedSystemPromptand the actual API call, the system prompt content appears to not be reaching Ollama.Direct curl calls to Ollama with system prompts work correctly:
Workaround
Use Anthropic provider instead of Ollama for agents that need bootstrap file context.