You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Open file hint is stuck and can't be removed #24582
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.
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.
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.
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.timestampFROM items iJOIN panes p ON p.pane_id = i.pane_id AND p.workspace_id = i.workspace_idJOIN workspaces w ON w.workspace_id = i.workspace_idJOIN editors e ON e.item_id = i.item_id AND e.workspace_id = i.workspace_idLEFT JOIN editor_selections s ON s.editor_id = e.item_id AND s.workspace_id = e.workspace_idWHERE i.active = 1 AND p.active = 1 AND i.kind = 'Editor' AND e.buffer_path IS NOT NULLORDER 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:
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.timestampFROM items iJOIN panes p ON p.pane_id = i.pane_id AND p.workspace_id = i.workspace_idJOIN workspaces w ON w.workspace_id = i.workspace_idJOIN editors e ON e.item_id = i.item_id AND e.workspace_id = i.workspace_idLEFT JOIN editor_selections s ON s.editor_id = e.item_id AND s.workspace_id = e.workspace_idWHERE i.active = 1 AND p.active = 1 AND i.kind = 'Editor' AND e.buffer_path IS NOT NULLORDER 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:
@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.
Activity
max-wittig commentedon Apr 27, 2026
Reinstall did it now.
My coworker had the same issue @nejch
nejch commentedon Apr 27, 2026
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.
lukasbash commentedon Apr 27, 2026
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.
AlexandruCalinica commentedon Apr 27, 2026
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.
AlexandruCalinica commentedon Apr 27, 2026
I found a more targeted workaround than reinstalling.
On macOS, OpenCode can fall back to reading the current Zed selection from:
If that sqlite state is stale, OpenCode keeps injecting the old file/selection into new sessions.
Inspect it
If you see the stale file there, that’s likely what OpenCode is picking up.
Clear just that selection
Backup first:
Then delete the matching selection row using the item_id + workspace_id from the query above:
Restart OpenCode after that.
This fixed it for me without reinstalling.
lukasbash commentedon Apr 27, 2026
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 😢
lukasbash commentedon May 5, 2026
Any reason why the bug label has been removed. It is a bug, isn't it? @thdxr
max-wittig commentedon May 8, 2026
@lukasbash This workaround doesn't really work for me. I can see the stale state, but somehow the removal doesn't do anything.
AlexandruCalinica commentedon May 8, 2026
@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.
max-wittig commentedon May 8, 2026
I never want to use this feature in opencode. Any way to disable it?
fix(tui): allow file_context to be disabled
rekram1-node commentedon May 21, 2026
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)
max-wittig commentedon May 22, 2026
Thanks for the fix!