diff --git a/server/src/agents/pty/runner.rs b/server/src/agents/pty/runner.rs index b36b3c3b..cd94625c 100644 --- a/server/src/agents/pty/runner.rs +++ b/server/src/agents/pty/runner.rs @@ -112,13 +112,14 @@ fn run_agent_pty_blocking( // Launch mode: resume an existing session or start fresh. if let Some(sid) = session_id_to_resume { // Resume: --resume restores previous conversation context. - // Only the failure context (prompt) is sent as a new message via -p. + // The failure context (or empty string) is sent as a new message via -p. + // Always pass -p so --include-partial-messages (added below) works: + // claude CLI requires --print/-p to be set when --include-partial-messages + // is used, regardless of whether the prompt is empty. cmd.arg("--resume"); cmd.arg(sid); - if !prompt.is_empty() { - cmd.arg("-p"); - cmd.arg(prompt); - } + cmd.arg("-p"); + cmd.arg(prompt); } else { // Fresh session: deliver the full rendered prompt via -p. cmd.arg("-p");