Skip to content

[Bug]: Bootstrap files (SOUL.md, USER.md) not injected into system prompt for openai-completions API #3775

@adriangrassi

Description

@adriangrassi

[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

  1. 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"
    }
  }
}
  1. Create workspace files:

    • SOUL.md - Agent personality
    • USER.md - User profile with name, timezone, etc.
    • IDENTITY.md - Agent identity
  2. 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.

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