Teknium
a8c862900b
fix(tui): sanitize replay history on WebUI/TUI session resume ( #29086 ) ( #53939 )
...
A WebUI/TUI session whose last turn died mid-tool-loop (stale-timeout kill,
interrupt, or process restart before the tool result was written) persists a
dangling assistant(tool_calls) or interrupted assistant->tool tail. The
messaging gateway already strips these tails before replay (the #49201 fix),
but the TUI/WebUI resume path fed db.get_messages_as_conversation() straight
in as the agent's conversation_history with no cleanup. The model re-issued
the unanswered call on every resume -- including after a full WebUI + Gateway
restart, since the poison lives in the SessionDB, not memory -- leaving the
session permanently 'thinking'. Only deleting the session recovered it.
- Extract the two strippers + helper from gateway/run.py into a shared
agent/replay_cleanup.py (sanitize_replay_history wraps both).
- gateway/run.py re-exports under the historical private names; messaging
behavior unchanged.
- Both TUI cold-resume sites now sanitize the model-fed history while leaving
the display transcript untouched, so the user still sees their full history.
Verified E2E against a real SessionDB: dangling and interrupted tails are
stripped from the model feed, healthy mid-progress tool sequences are
preserved, and the display transcript is always the full raw history.
2026-06-27 20:56:49 -07:00
..
2026-05-30 02:08:36 -07:00
2026-06-24 21:46:30 -07:00
2026-06-27 19:23:15 -07:00
2026-06-27 19:14:43 -07:00
2026-06-08 09:36:38 -07:00
2026-06-17 13:20:29 +05:30
2026-06-23 23:59:40 -07:00
2026-06-10 20:45:16 -07:00
2026-06-10 20:45:16 -07:00
2026-06-07 01:40:50 -07:00
2026-06-26 19:15:18 -07:00
2026-05-28 22:26:25 -07:00
2026-06-26 11:21:05 +05:30
2026-05-29 00:28:02 -07:00
2026-06-27 19:09:27 -07:00
2026-05-28 22:26:25 -07:00
2026-06-27 14:21:26 -07:00
2026-05-28 22:26:25 -07:00
2026-06-14 02:09:16 -07:00
2026-06-07 02:02:40 -07:00
2026-05-28 22:26:25 -07:00
2026-05-18 10:14:38 -07:00
2026-06-15 05:25:17 -07:00
2026-05-28 22:26:25 -07:00
2026-06-19 01:53:32 +05:30
2026-06-08 02:19:13 -07:00
2026-06-27 11:43:08 -07:00
2026-06-25 12:24:34 -05:00
2026-05-28 22:26:25 -07:00
2026-06-17 17:33:32 -07:00
2026-05-29 02:02:25 -07:00
2026-06-25 16:40:27 -05:00
2026-06-11 23:03:52 -07:00
2026-06-12 16:47:15 -07:00
2026-06-25 12:56:05 -07:00
2026-06-21 11:34:47 -07:00
2026-06-20 21:32:30 -07:00
2026-06-25 12:56:05 -07:00
2026-06-22 15:51:52 +05:30
2026-06-25 12:56:05 -07:00
2026-06-12 15:41:57 -07:00
2026-05-16 17:18:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-12 01:14:28 -07:00
2026-06-22 16:26:56 +05:30
2026-06-07 22:09:45 -07:00
2026-05-27 22:14:53 -07:00
2026-06-11 13:57:13 -07:00
2026-06-24 18:31:51 +05:30
2026-05-28 22:26:25 -07:00
2026-06-25 02:13:26 +05:30
2026-06-09 19:16:46 -05:00
2026-06-14 03:20:21 -07:00
2026-05-16 02:24:48 -07:00
2026-06-25 19:14:06 -07:00
2026-06-27 19:01:37 -07:00
2026-06-12 01:06:46 -07:00
2026-06-06 13:18:18 +05:30
2026-06-12 08:51:10 +00:00
2026-06-06 13:18:18 +05:30
2026-06-12 08:51:10 +00:00
2026-05-28 22:26:25 -07:00
2026-06-17 05:40:05 -07:00
2026-05-28 22:26:25 -07:00
2026-06-27 03:52:52 -07:00
2026-06-13 02:01:09 -07:00
2026-06-25 00:17:17 -07:00
2026-06-07 21:50:57 -07:00
2026-05-17 02:29:41 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-25 22:02:22 -07:00
2026-06-17 17:32:14 -07:00
2026-06-27 04:16:54 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-20 10:46:01 -07:00
2026-06-02 14:03:37 +10:00
2026-05-25 03:40:47 -07:00
2026-05-28 22:26:25 -07:00
2026-06-02 11:29:24 +10:00
2026-05-28 22:26:25 -07:00
2026-06-21 19:53:27 -07:00
2026-05-28 22:26:25 -07:00
2026-06-13 13:47:08 -07:00
2026-06-03 12:00:27 -07:00
2026-06-27 19:26:04 -07:00
2026-06-07 18:33:20 -07:00
2026-06-27 20:46:00 -07:00
2026-05-28 00:20:11 -07:00
2026-05-23 17:38:19 -07:00
2026-06-25 12:48:08 -07:00
2026-06-05 10:18:10 +10:00
2026-05-11 16:49:13 -07:00
2026-06-08 02:18:59 -07:00
2026-06-25 02:17:29 +05:30
2026-06-08 02:18:59 -07:00
2026-06-16 10:37:37 -07:00
2026-05-28 22:26:25 -07:00
2026-06-22 07:00:42 -07:00
2026-06-19 15:23:41 +08:00
2026-06-04 05:53:35 -07:00
2026-05-28 22:26:25 -07:00
2026-06-27 12:08:09 -07:00
2026-05-29 23:45:05 -07:00
2026-06-13 05:51:41 -07:00
2026-05-28 22:26:25 -07:00
2026-06-06 13:18:18 +05:30
2026-06-12 08:51:10 +00:00
2026-06-04 01:19:28 +05:30
2026-06-07 08:36:48 -07:00
2026-06-23 08:01:50 +00:00
2026-06-20 14:18:30 -05:00
2026-06-25 00:44:53 -05:00
2026-06-18 14:28:01 -07:00
2026-05-28 22:26:25 -07:00
2026-05-12 20:49:20 -07:00
2026-06-25 01:20:23 +05:30
2026-06-27 03:46:41 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-25 22:12:06 -07:00
2026-06-27 04:43:28 -07:00
2026-06-27 20:56:49 -07:00
2026-06-27 20:04:45 -07:00
2026-06-11 13:57:13 -07:00
2026-06-02 20:23:09 +00:00
2026-05-24 18:10:47 -07:00
2026-06-19 07:34:15 -07:00
2026-05-30 02:38:59 -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-26 19:15:18 -07:00
2026-05-21 16:40:04 +05:30
2026-06-25 22:03:02 -07:00
2026-06-13 21:14:32 -07:00
2026-06-10 20:21:38 -05:00
2026-05-18 10:53:08 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-11 13:57:13 -07:00
2026-06-16 09:50:17 -05:00
2026-06-25 16:40:27 -05:00
2026-06-25 19:00:48 -07:00
2026-06-19 17:15:52 -07:00
2026-05-25 14:52:24 -07:00
2026-05-19 00:12:12 -07:00
2026-05-13 06:46:23 -07:00
2026-05-25 01:41:19 -07:00
2026-05-24 18:04:54 -07:00
2026-06-25 12:54:19 -07:00
2026-06-22 13:57:59 -07:00
2026-06-23 23:52:28 -07:00
2026-06-20 11:38:01 -07:00
2026-05-29 17:24:30 -07:00
2026-06-21 11:48:43 -07:00
2026-06-24 23:03:45 -05:00
2026-06-27 03:23:22 -07:00
2026-05-13 16:39:41 -07:00
2026-05-24 15:01:28 -07:00