Skip to content

[BUG]: Unhandled ENOENT error when submitting a message with a deleted file attachment #8807

Closed

Description

@ochen1

Description

When a user attaches a file (e.g., @somefile.txt) to a message, but deletes that file from the file system before submitting the message, OpenCode crashes.

Bun.file(filepath).stat() throws an unhandled ENOENT error that prints raw to the TUI, breaking the display.

Plugins

No response

OpenCode version

No response

Steps to reproduce

  1. Attach/mention a file in the input (e.g., @somefile.txt).
  2. Delete the file from the file system.
  3. Submit the message (Enter).

Alternatively (simpler):

  1. attach/mention (e.g., @somefile.txt) any file and ask OpenCode to delete it (wait for completion)
  2. up arrow, enter

Screenshot and/or share link

Screenshot 2026-01-02 105744

Operating System

Ubuntu 24.04

Terminal

Visual Studio Code Insiders

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Jan 16, 2026
  2. github-actions commented on Jan 16, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  3. github-actions commented on Mar 26, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 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

bugSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentui

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions