Skip to content

Open file hint is stuck and can't be removed #24582

Closed

Description

@max-wittig

Description

Image

How do I get rid of this again? It's used as context in every opencode window

Plugins

none

OpenCode version

1.14.28

Steps to reproduce

not sure

Screenshot and/or share link

No response

Operating System

macOS 26.3.1

Terminal

iTerm2

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Apr 27, 2026
  2. max-wittig commented on Apr 27, 2026

    @max-wittig
    Author

    Reinstall did it now.

    brew uninstall opencode
    brew install opencode

    My coworker had the same issue @nejch

  3. nejch commented on Apr 27, 2026

    @nejch

    If it helps, in my case this seems to always be the last file I had open in the active tab in my IDE (Zed), but it persists after closing the editor as well. I checked there were no related running processes from what I could see.

    I assume that was also the case for you @max-wittig but with vscode or so.

  4. lukasbash commented on Apr 27, 2026

    @lukasbash

    Could it be that this strongly interferes with the quality of the session with regard to input context? I see very bad results in sessions having this issue.

  5. AlexandruCalinica commented on Apr 27, 2026

    @AlexandruCalinica

    I have the same problem. Opened Zed to see the new parallel agents interface and tried it in a session and now it seems to have stuck with a file in context.

    If someone finds a way to fix this without installing opencode from scratch would be much appreciated.

  6. AlexandruCalinica commented on Apr 27, 2026

    @AlexandruCalinica

    I found a more targeted workaround than reinstalling.
    On macOS, OpenCode can fall back to reading the current Zed selection from:

    ~/Library/Application\ Support/Zed/db/0-stable/db.sqlite

    If that sqlite state is stale, OpenCode keeps injecting the old file/selection into new sessions.
    Inspect it

    sqlite3 "$HOME/Library/Application Support/Zed/db/0-stable/db.sqlite" "
    SELECT
      e.item_id,
      e.workspace_id,
      e.buffer_path,
      s.start,
      s.end,
      w.paths,
      w.timestamp
    FROM items i
    JOIN panes p
      ON p.pane_id = i.pane_id AND p.workspace_id = i.workspace_id
    JOIN workspaces w
      ON w.workspace_id = i.workspace_id
    JOIN editors e
      ON e.item_id = i.item_id AND e.workspace_id = i.workspace_id
    LEFT JOIN editor_selections s
      ON s.editor_id = e.item_id AND s.workspace_id = e.workspace_id
    WHERE i.active = 1
      AND p.active = 1
      AND i.kind = 'Editor'
      AND e.buffer_path IS NOT NULL
    ORDER BY w.timestamp DESC;
    "

    If you see the stale file there, that’s likely what OpenCode is picking up.
    Clear just that selection
    Backup first:

    sqlite3 "$HOME/Library/Application Support/Zed/db/0-stable/db.sqlite" \
      ".backup '$HOME/Library/Application Support/Zed/db/0-stable/db.sqlite.backup'"

    Then delete the matching selection row using the item_id + workspace_id from the query above:

    sqlite3 "$HOME/Library/Application Support/Zed/db/0-stable/db.sqlite" "
    DELETE FROM editor_selections
    WHERE editor_id = ITEM_ID
      AND workspace_id = WORKSPACE_ID;
    "

    Restart OpenCode after that.
    This fixed it for me without reinstalling.

  7. lukasbash commented on Apr 27, 2026

    @lukasbash

    I found a more targeted workaround than reinstalling.
    On macOS, OpenCode can fall back to reading the current Zed selection from:

    ~/Library/Application\ Support/Zed/db/0-stable/db.sqlite

    If that sqlite state is stale, OpenCode keeps injecting the old file/selection into new sessions.
    Inspect it

    sqlite3 "$HOME/Library/Application Support/Zed/db/0-stable/db.sqlite" "
    SELECT
      e.item_id,
      e.workspace_id,
      e.buffer_path,
      s.start,
      s.end,
      w.paths,
      w.timestamp
    FROM items i
    JOIN panes p
      ON p.pane_id = i.pane_id AND p.workspace_id = i.workspace_id
    JOIN workspaces w
      ON w.workspace_id = i.workspace_id
    JOIN editors e
      ON e.item_id = i.item_id AND e.workspace_id = i.workspace_id
    LEFT JOIN editor_selections s
      ON s.editor_id = e.item_id AND s.workspace_id = e.workspace_id
    WHERE i.active = 1
      AND p.active = 1
      AND i.kind = 'Editor'
      AND e.buffer_path IS NOT NULL
    ORDER BY w.timestamp DESC;
    "

    If you see the stale file there, that’s likely what OpenCode is picking up.
    Clear just that selection
    Backup first:

    sqlite3 "$HOME/Library/Application Support/Zed/db/0-stable/db.sqlite" \
      ".backup '$HOME/Library/Application Support/Zed/db/0-stable/db.sqlite.backup'"

    Then delete the matching selection row using the item_id + workspace_id from the query above:

    sqlite3 "$HOME/Library/Application Support/Zed/db/0-stable/db.sqlite" "
    DELETE FROM editor_selections
    WHERE editor_id = ITEM_ID
      AND workspace_id = WORKSPACE_ID;
    "

    Restart OpenCode after that.
    This fixed it for me without reinstalling.

    It's just working! Pretty smart solution.

    In any case .. I know this stuff is all open source back and forth, but I really wonder how these issues make it into a release 😢

  8. removed
    bugSomething isn't working
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on May 3, 2026
  9. lukasbash commented on May 5, 2026

    @lukasbash

    Any reason why the bug label has been removed. It is a bug, isn't it? @thdxr

  10. max-wittig commented on May 8, 2026

    @max-wittig
    Author

    @lukasbash This workaround doesn't really work for me. I can see the stale state, but somehow the removal doesn't do anything.

  11. AlexandruCalinica commented on May 8, 2026

    @AlexandruCalinica

    @lukasbash @max-wittig I think the bug is on zed's side. I had several files open by zed and I had to clear them all. The problem is basically that Zed does not clear it's state if you close it. Not sure if it's an opencode problem.

  12. max-wittig commented on May 8, 2026

    @max-wittig
    Author

    I never want to use this feature in opencode. Any way to disable it?

  13. rekram1-node commented on May 21, 2026

    @rekram1-node
    Contributor
    Image

    I think we are going to turn it off by default (I also disable it but you can toggle it on / off using ctrl+p command palette)

  14. max-wittig commented on May 22, 2026

    @max-wittig
    Author

    Thanks for the fix!

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