Skip to content

fix(claude-code): pass system prompt via --system-prompt flag instead…#705

Open
apestchanker wants to merge 1 commit intoRightNow-AI:mainfrom
apestchanker:fix/claude-code-system-prompt
Open

fix(claude-code): pass system prompt via --system-prompt flag instead…#705
apestchanker wants to merge 1 commit intoRightNow-AI:mainfrom
apestchanker:fix/claude-code-system-prompt

Conversation

@apestchanker
Copy link

… of inlining in -p

Summary

Fixes HAND initializations and .md files (SOUL.md, IDENTITY.md, MEMORY.md, etc.) being silently ignored when using claude-code as the LLM provider.

Changes

crates/openfang-runtime/src/drivers/claude_code.rs: Remove system prompt from build_prompt() — it was being inlined into the -p argument as a [System] text marker, which the Claude Code CLI does not parse. Instead, pass it via the --system-prompt CLI flag in both complete() and stream(). Update test_build_prompt_simple to reflect the new behavior.
Formatting: Run cargo fmt --all to fix pre-existing style violations in kernel.rs, drivers/mod.rs, openai.rs, and model_catalog.rs that would have failed CI.

Testing

  • cargo clippy --workspace --all-targets -- -D warnings passes
  • cargo test --workspace passes
  • Live integration tested (if applicable)

Security

  • No new unsafe code
  • No secrets or API keys in diff
  • User input validated at boundaries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant