liuhao1024
8e4c447e5f
fix(gateway): prevent duplicate user messages in state.db
...
When the agent has its own SessionDB reference (_session_db is not None),
_flush_messages_to_session_db() persists user messages to SQLite during the
agent run. Two gateway fallback paths also wrote the same user message
without skip_db=True, creating duplicate entries in state.db:
1. agent_failed_early path (transient 429/timeout failures)
2. not-new-messages path (history_offset >= len(messages) edge case)
Move agent_persisted flag definition to before the if/elif/else block so
all paths can use it, and pass skip_db=agent_persisted to every fallback
append_to_transcript() call.
Fixes #42039
2026-06-08 11:29:53 -07:00
..
2026-06-07 22:22:21 -07:00
2026-06-08 09:36:38 -07:00
2026-06-08 02:13:07 -07:00
2026-06-06 12:51:12 -05:00
2026-06-04 03:03:35 -07:00
2026-05-28 22:26:25 -07:00
2026-06-02 12:37:40 -04:00
2026-06-08 11:29:53 -07:00
2026-06-08 10:01:47 -07:00
2026-06-08 09:35:22 -07:00
2026-06-06 11:46:24 -07:00
2026-06-04 17:40:33 -07:00
2026-06-07 17:41:10 -07:00
2026-06-07 01:52:49 -07:00
2026-06-08 09:41:34 -07:00
2026-06-05 13:30:02 +10:00
2026-05-28 22:26:25 -07:00
2026-06-08 09:41:20 -07:00
2026-06-07 02:33:28 -07:00
2026-06-01 19:52:28 -07:00
2026-06-01 19:51:03 -07:00
2026-05-28 22:26:25 -07:00
2026-06-06 18:33:44 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-08 10:02:05 -07:00
2026-06-03 07:32:00 +07:00
2026-06-04 03:03:35 -07:00
2026-06-01 16:06:44 +10:00
2026-06-01 13:32:55 +10:00
2026-06-05 02:54:34 -07:00
2026-05-25 15:18:55 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-08 06:32:42 -07:00
2026-05-28 22:26:25 -07:00
2026-06-03 19:37:29 -07:00
2026-06-06 19:57:44 -07:00
2026-05-28 21:40:39 -07:00
2026-05-27 14:31:55 -07:00
2026-06-07 02:41:01 -07:00
2026-06-08 09:35:22 -07:00
2026-05-29 22:29:48 -07:00
2026-05-27 10:49:33 -07:00
2026-06-01 20:13:42 -07:00
2026-06-08 02:18:21 -07:00
2026-05-27 13:55:51 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-04 18:04:47 -07:00
2026-06-03 11:22:06 -07:00
2026-05-28 22:26:25 -07:00
2026-06-07 03:52:09 -07:00
2026-06-03 12:00:27 -07:00
2026-05-28 22:26:25 -07:00
2026-06-08 09:35:22 -07:00
2026-05-28 22:26:25 -07:00
2026-06-04 08:54:38 -07:00
2026-06-08 07:03:12 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-07 05:01:27 -07:00
2026-06-03 06:36:46 -07:00
2026-06-08 10:02:05 -07:00
2026-06-08 10:02:05 -07:00
2026-06-08 10:02:05 -07:00
2026-06-03 12:00:27 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-07 17:49:38 -07:00