Commit 0245c48
Fix /resume broken for OpenAI chats
Three root causes fixed:
- Nil reasoning text during replay: message-content->chat-content
unconditionally emitted reasonText with nil text when OpenAI reasoning
had no :thinking events (e.g. redacted). Now conditionally includes
reasonText only when text is non-nil.
- Prompt-id lost after chat replacement: the resume command replaced the
entire chat map, losing the current prompt-id. finish-chat-prompt!'s
supersession guard then rejected the transition to idle, leaving the
UI stuck in "thinking" state. Now restores prompt-id after replacement.
- UI not cleared before replay: resumed messages were appended on top of
existing ones. Now sends chat-cleared before replaying, matching the
rollback-chat pattern, and re-sends statusChanged :running so the
client properly tracks the loading→finished lifecycle.
Closes #400
🤖 Generated with [eca](https://eca.dev)
Co-Authored-By: eca <git@eca.dev>1 parent 67ccc01 commit 0245c48
3 files changed
+20
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
200 | 202 | | |
201 | 203 | | |
202 | 204 | | |
| |||
852 | 854 | | |
853 | 855 | | |
854 | 856 | | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
855 | 860 | | |
856 | 861 | | |
857 | 862 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
413 | 413 | | |
414 | 414 | | |
415 | 415 | | |
| 416 | + | |
416 | 417 | | |
417 | 418 | | |
418 | 419 | | |
| 420 | + | |
419 | 421 | | |
420 | 422 | | |
421 | 423 | | |
| |||
0 commit comments