Fix message queue persistence after auto-send

ruizanthony@gmail.com committed May 19, 2026 at 14:07 UTC 83a58cf6ade41dccf1e76d70d75a81bb572bb41c
2 files changed +5 -1
api/message_queue_send.py
+2
@@ -19,6 +19,8 @@ class MessageQueueSend(ApiHandler):
19
20 if send_all:
21 count = mq.send_all_aggregated(context)
22 + if count:
23 + mark_dirty_for_context(context.id, reason="message_queue_send_all")
24 return {"ok": True, "sent_count": count}
25
26 # Send single item
extensions/python/process_chain_end/_50_process_queue.py
+3 -1
@@ -2,6 +2,7 @@ import asyncio
2 from helpers.extension import Extension
3 from helpers import message_queue as mq
4 from agent import AgentContext, Agent, LoopData
5 +from helpers.state_monitor_integration import mark_dirty_for_context
6
7
8 class ProcessQueue(Extension):
@@ -34,4 +35,5 @@ class ProcessQueue(Extension):
35
36 # Send next queued message if task is not running
37 if not context.is_running():
37 - mq.send_next(context)
38 + if mq.send_next(context):
39 + mark_dirty_for_context(context.id, reason="message_queue_auto_send")