Description
The legacy prompt loop persists an empty assistant message before creating its processor. Existing cleanup handles interruption, but another failed Effect exit during processor creation or ordinary provider-turn setup and execution can propagate while leaving the committed message without an error or completion timestamp.
For an ordinary provider turn created by the current run, the failure boundary should begin at the persistence call. A failed exit should attempt to finalize that run's exact persisted assistant message, if present, without replacing the original failure. Cleanup should preserve any existing error and finish value.
This is process-local cleanup only. It does not scan existing history or recover process crashes, compaction turns, subtasks, cross-process work, or turns created by another run.
Plugins
None
OpenCode version
Current dev at 411eff73
Steps to reproduce
- Create a session and persist a user message.
- Run
SessionPrompt.loop() with a SessionProcessor whose create() defects.
- The defect propagates, but the assistant scaffold remains persisted with no parts, error,
finish, or time.completed.
Expected: the original defect still propagates, while the persisted scaffold records an error and completion timestamp. finish remains unchanged.
Screenshot and/or share link
Not applicable
Operating System
macOS
Terminal
zsh
Description
The legacy prompt loop persists an empty assistant message before creating its processor. Existing cleanup handles interruption, but another failed Effect exit during processor creation or ordinary provider-turn setup and execution can propagate while leaving the committed message without an error or completion timestamp.
For an ordinary provider turn created by the current run, the failure boundary should begin at the persistence call. A failed exit should attempt to finalize that run's exact persisted assistant message, if present, without replacing the original failure. Cleanup should preserve any existing error and
finishvalue.This is process-local cleanup only. It does not scan existing history or recover process crashes, compaction turns, subtasks, cross-process work, or turns created by another run.
Plugins
None
OpenCode version
Current
devat411eff73Steps to reproduce
SessionPrompt.loop()with aSessionProcessorwhosecreate()defects.finish, ortime.completed.Expected: the original defect still propagates, while the persisted scaffold records an error and completion timestamp.
finishremains unchanged.Screenshot and/or share link
Not applicable
Operating System
macOS
Terminal
zsh