Skip to content

Provider-turn failures can leave assistant scaffolds unfinished #38431

Closed as not planned

Description

@iandraves

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

  1. Create a session and persist a user message.
  2. Run SessionPrompt.loop() with a SessionProcessor whose create() defects.
  3. 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

Activity

  1. changed the title [-]Unfinished assistant scaffold persists after prompt setup failure[/-] [+]Provider-turn failures can leave assistant scaffolds unfinished[/+] on Jul 23, 2026
  2. DatScreamer commented on Aug 14, 2026

    @DatScreamer

    PR #42516 includes the propagation work from #42253 plus follow-up persistence and concise UI formatting. It overlaps this issue specifically in assistant-message finalization: PR #39200's finalizeAssistant approach is broader and may be preferable to port onto the current architecture. #39200 does not replace #42253's error propagation or tool-warning UI work, so I am leaving #42516 open until maintainers choose the implementation.

  3. github-actions commented on Oct 15, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions