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:
@@ -189,10 +189,8 @@ fn run_pty_session(
|
||||
// a tool requires user approval, instead of using PTY stdin/stdout.
|
||||
cmd.arg("--permission-prompt-tool");
|
||||
cmd.arg("mcp__story-kit__prompt_permission");
|
||||
if let Some(sys) = system_prompt {
|
||||
cmd.arg("--system");
|
||||
cmd.arg(sys);
|
||||
}
|
||||
// Note: --system is not a valid Claude Code CLI flag. System-level
|
||||
// instructions (like bot name) are prepended to the user prompt instead.
|
||||
cmd.cwd(cwd);
|
||||
// Keep TERM reasonable but disable color
|
||||
cmd.env("NO_COLOR", "1");
|
||||
|
||||
@@ -748,11 +748,10 @@ async fn handle_message(
|
||||
|
||||
// The prompt is just the current message with sender attribution.
|
||||
// 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 system_prompt = format!(
|
||||
"Your name is {bot_name}. Refer to yourself as {bot_name}, not Claude."
|
||||
let prompt = format!(
|
||||
"[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();
|
||||
@@ -792,7 +791,7 @@ async fn handle_message(
|
||||
&prompt,
|
||||
&project_root_str,
|
||||
resume_session_id.as_deref(),
|
||||
Some(&system_prompt),
|
||||
None,
|
||||
&mut cancel_rx,
|
||||
move |token| {
|
||||
let mut buf = buffer_for_callback.lock().unwrap();
|
||||
|
||||
Reference in New Issue
Block a user