Skip to content

IDE/editor context persists after closing file #24184

@gabethehuman

Description

@gabethehuman

Description

Since 1.14.23, OpenCode shows the currently-open file in the TUI prompt area, e.g. testfile.py.

Problem:
When I close that file in the editor, OpenCode keeps showing/injecting the old file context. The LLM then assumes my unrelated prompt is about that stale file and tries to modify it.

Expected:
When the active editor file is closed, OpenCode should clear the editor context and stop injecting "user opened this file" or equivalent context into the prompt.

Plugins

No response

OpenCode version

1.14.23

Steps to reproduce

  1. Open opencode in VSCode terminal
  2. Open a file, select something in it. Filename should appear at the botton of opencode
  3. Close this file, the filename doesn't disappear.

Screenshot and/or share link

we open file, testfile.py appears near the bottom:
Image

we close this file, testfile.py remains
Image

Operating System

WSL2 inside Windows 11, latest versions.

Terminal

Bash inside VSCode, WSL2

Metadata

Metadata

Assignees

Labels

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

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions