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 <session_id>) 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) <noreply@anthropic.com>
This commit is contained in:
dave
2026-05-13 05:44:46 +00:00
parent 9ccbdff19f
commit 3a8894ea8f
+5
View File
@@ -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