Commit e4033b2
authored
fix(cli): catch KeyboardInterrupt during flush_memories on exit (NousResearch#3025)
KeyboardInterrupt inherits from BaseException, not Exception, so the
except Exception: clauses wrapping flush_memories() on exit paths
silently skipped the flush when the user pressed Ctrl+C. This could
lose conversation memory.
Change both call sites to except (Exception, KeyboardInterrupt): so
the memory flush is attempted even during interrupt.
Salvaged from PR NousResearch#2855 by RufusLin (dropped unrelated bundled changes).1 parent 94e3d9a commit e4033b2
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2881 | 2881 | | |
2882 | 2882 | | |
2883 | 2883 | | |
2884 | | - | |
| 2884 | + | |
2885 | 2885 | | |
2886 | 2886 | | |
2887 | 2887 | | |
| |||
7206 | 7206 | | |
7207 | 7207 | | |
7208 | 7208 | | |
7209 | | - | |
| 7209 | + | |
7210 | 7210 | | |
7211 | 7211 | | |
7212 | 7212 | | |
| |||
0 commit comments