diff --git a/server/src/agents/pool/start/spawn.rs b/server/src/agents/pool/start/spawn.rs index 4e4367aa..1dffc363 100644 --- a/server/src/agents/pool/start/spawn.rs +++ b/server/src/agents/pool/start/spawn.rs @@ -263,7 +263,18 @@ pub(super) async fn run_agent_spawn( Some(_) => { // Keep the full rendered prompt as fallback if resume fails. let fallback = prompt; - (resume_context_owned.unwrap_or_default(), Some(fallback)) + // claude-code's --resume requires a non-empty -p prompt unless the + // resumed session has a deferred-tool marker. Watchdog-killed + // sessions don't have one, so an empty -p aborts the CLI with + // "No deferred tool marker found... Provide a prompt to continue + // the conversation." We default to a brief "continue from + // PLAN.md" message when no gate-failure context was provided. + let resume_msg = resume_context_owned.filter(|s| !s.is_empty()).unwrap_or_else( + || { + "Continue from your prior session. Read PLAN.md for your current state and pick up where you left off.".to_string() + }, + ); + (resume_msg, Some(fallback)) } None => { if let Some(ctx) = resume_context_owned {