fix: --system is not a valid Claude Code CLI flag

Removed the --system argument from the PTY runner — Claude Code CLI
doesn't support it. Bot name instruction is now prepended to the user
prompt instead of passed as a system prompt argument.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Dave
2026-03-18 11:42:39 +00:00
parent db92a78d2b
commit 77e368d354
2 changed files with 6 additions and 9 deletions

View File

@@ -189,10 +189,8 @@ fn run_pty_session(
// a tool requires user approval, instead of using PTY stdin/stdout. // a tool requires user approval, instead of using PTY stdin/stdout.
cmd.arg("--permission-prompt-tool"); cmd.arg("--permission-prompt-tool");
cmd.arg("mcp__story-kit__prompt_permission"); cmd.arg("mcp__story-kit__prompt_permission");
if let Some(sys) = system_prompt { // Note: --system is not a valid Claude Code CLI flag. System-level
cmd.arg("--system"); // instructions (like bot name) are prepended to the user prompt instead.
cmd.arg(sys);
}
cmd.cwd(cwd); cmd.cwd(cwd);
// Keep TERM reasonable but disable color // Keep TERM reasonable but disable color
cmd.env("NO_COLOR", "1"); cmd.env("NO_COLOR", "1");

View File

@@ -748,11 +748,10 @@ async fn handle_message(
// The prompt is just the current message with sender attribution. // The prompt is just the current message with sender attribution.
// Prior conversation context is carried by the Claude Code session. // Prior conversation context is carried by the Claude Code session.
let prompt = format_user_prompt(&sender, &user_message);
let bot_name = &ctx.bot_name; let bot_name = &ctx.bot_name;
let system_prompt = format!( let prompt = format!(
"Your name is {bot_name}. Refer to yourself as {bot_name}, not Claude." "[Your name is {bot_name}. Refer to yourself as {bot_name}, not Claude.]\n\n{}",
format_user_prompt(&sender, &user_message)
); );
let provider = ClaudeCodeProvider::new(); let provider = ClaudeCodeProvider::new();
@@ -792,7 +791,7 @@ async fn handle_message(
&prompt, &prompt,
&project_root_str, &project_root_str,
resume_session_id.as_deref(), resume_session_id.as_deref(),
Some(&system_prompt), None,
&mut cancel_rx, &mut cancel_rx,
move |token| { move |token| {
let mut buf = buffer_for_callback.lock().unwrap(); let mut buf = buffer_for_callback.lock().unwrap();