Description
The legacy prompt loop persists an assistant message before processor setup begins. Cancellation is handled, but a defect during the durable write, processor creation, or later turn setup can leave the message with no parts, no finish, no error, and no completion timestamp.
The same shape remains after a hard process interruption because no finalizer can run. It stays in session history as an unfinished assistant turn.
Expected behavior: exact empty scaffolds from prior executions should be marked interrupted before the loop continues, and every failed exit after scaffold creation should finalize the message without swallowing the original failure. Recovery must still allow the latest user prompt to receive a new response.
Plugins
None
OpenCode version
Current dev at 411eff73
Steps to reproduce
- Create a session and persist a user message.
- Persist an assistant message parented to it with zero parts and no
finish, error, or time.completed.
- Add a newer user prompt and run
SessionPrompt.loop().
- The newer prompt receives a response, but the old assistant remains permanently unfinished.
The future-failure path is reproducible by replacing SessionProcessor.create() with an Effect defect. The defect propagates, but the already-persisted assistant remains in the same unfinished state.
Screenshot and/or share link
Not applicable.
Operating System
macOS
Terminal
zsh
Description
The legacy prompt loop persists an assistant message before processor setup begins. Cancellation is handled, but a defect during the durable write, processor creation, or later turn setup can leave the message with no parts, no finish, no error, and no completion timestamp.
The same shape remains after a hard process interruption because no finalizer can run. It stays in session history as an unfinished assistant turn.
Expected behavior: exact empty scaffolds from prior executions should be marked interrupted before the loop continues, and every failed exit after scaffold creation should finalize the message without swallowing the original failure. Recovery must still allow the latest user prompt to receive a new response.
Plugins
None
OpenCode version
Current
devat411eff73Steps to reproduce
finish,error, ortime.completed.SessionPrompt.loop().The future-failure path is reproducible by replacing
SessionProcessor.create()with an Effect defect. The defect propagates, but the already-persisted assistant remains in the same unfinished state.Screenshot and/or share link
Not applicable.
Operating System
macOS
Terminal
zsh