From 3a8894ea8fa4cf5c93d32e7824ca66947016ec74 Mon Sep 17 00:00:00 2001 From: dave Date: Wed, 13 May 2026 05:44:46 +0000 Subject: [PATCH] obs: log warm/cold spawn mode at agent respawn decision point Without this, the only way to tell whether a watchdog-respawn went warm (--resume ) vs cold (fresh CLI invocation) was to read the args list of the existing "Spawning claude with args:" log and check whether --resume was present. That made it impossible to count cold-paths or distinguish "supposed-to-be-warm but resume_failed fallback" from "first session" without source-diving. This adds one slog! per spawn, prefixed `[agent:{sid}:{name}] spawn mode=warm|cold session_id=...`, so grep "spawn mode=" answers it. Co-Authored-By: Claude Opus 4.7 (1M context) --- server/src/agents/pool/start/spawn.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/src/agents/pool/start/spawn.rs b/server/src/agents/pool/start/spawn.rs index 938857fd..525aa47c 100644 --- a/server/src/agents/pool/start/spawn.rs +++ b/server/src/agents/pool/start/spawn.rs @@ -248,6 +248,11 @@ pub(super) async fn run_agent_spawn( ); } + match &session_id_to_resume_owned { + Some(sess_id) => slog!("[agent:{sid}:{aname}] spawn mode=warm session_id={sess_id}"), + None => slog!("[agent:{sid}:{aname}] spawn mode=cold"), + } + // Build the effective prompt and determine resume session. // // When resuming a previous session, discard the full rendered prompt