[eric] agents: status flips to running BEFORE the user-message snapshot; a stale completed on disk hid follow-up-turn crashes from the boot detector (exp.19 drill catch)

This commit is contained in:
ciregenz
2026-08-19 16:51:35 -07:00
parent 455b8fa4d3
commit cf7790ca3b
+6
View File
@@ -134,6 +134,10 @@ class Messaging(AgentManagerProtocol):
client_message_id=client_message_id,
)
session.messages.append(user_msg)
# Status flips BEFORE the snapshot: the old order persisted a stale "completed" from the
# prior turn, so a dirty death during a follow-up turn was invisible to the boot-time crash
# detector (drilled live: round-2 kill -9 resumed nothing because disk said completed).
session.status = "running"
snapshot_session_now(session)
await ws_manager.send_to_session(session_id, "agent:message", {
"session_id": session_id,
@@ -279,6 +283,8 @@ class Messaging(AgentManagerProtocol):
attached_skills=target_msg.attached_skills,
)
session.messages.append(edited_msg)
# Same status-before-snapshot rule as send_message: a stale terminal status on disk hides a mid-turn dirty death from the crash detector.
session.status = "running"
snapshot_session_now(session)
await ws_manager.send_to_session(session_id, "agent:message", {