Description
Two related issues around handling non-existent project directories:
TUI — /open and /project commands show stale projects that can't be removed:
When a project directory is moved or deleted, the /open and /project commands still list it as a previously opened project. There is no way to remove stale entries. If the user selects one, the session fails or hangs.
Desktop — Settings > Projects shows non-existent projects, and opening them crashes the app:
In the desktop app, the Settings > Projects panel lists previously opened projects. If a project directory has been moved or deleted, it still appears in the list. When the user tries to open it, the app throws:
ClientError: UnexpectedStatus
at i (oc://renderer/assets/health-BdaR9NAA.js:1:41042)
原因:
{
status: 500
}
The desktop app becomes unresponsive and must be manually restarted.
Steps to reproduce
TUI:
- Open a project in TUI (
/open or startup)
- Move or delete that project directory from disk
- Run
/open or /project again — the old project still appears in the list
- There is no option to remove it from the list
Desktop:
- Open a project in the desktop app
- Move or delete that project directory from disk
- Go to Settings > Projects — the old project still appears
- Try to open it — the app crashes with
ClientError: UnexpectedStatus (status: 500) and must be restarted
Expected Behavior
- TUI:
/open and /project should detect stale (non-existent) project entries and either remove them automatically or provide a way to delete them from the list
- Desktop: Settings > Projects should detect stale entries and either remove them or show a clear error message ("Project directory not found") instead of crashing the app
Actual Behavior
- TUI: Stale projects persist in
/open and /project lists with no way to clean them up
- Desktop: Settings > Projects shows stale entries; opening one crashes the app with a 500 error requiring a full restart
Additional Context
- opencode version: 2.0.3
- OS: Windows_NT 10.0.26200 (win32 x64)
- Terminal: xterm-256color (TUI mode)
- Shell: cmd.exe
- Install/channel: npm global, latest
- Active plugins: None
- This is a common scenario when reorganizing project directories or migrating between machines
Description
Two related issues around handling non-existent project directories:
TUI —
/openand/projectcommands show stale projects that can't be removed:When a project directory is moved or deleted, the
/openand/projectcommands still list it as a previously opened project. There is no way to remove stale entries. If the user selects one, the session fails or hangs.Desktop — Settings > Projects shows non-existent projects, and opening them crashes the app:
In the desktop app, the Settings > Projects panel lists previously opened projects. If a project directory has been moved or deleted, it still appears in the list. When the user tries to open it, the app throws:
The desktop app becomes unresponsive and must be manually restarted.
Steps to reproduce
TUI:
/openor startup)/openor/projectagain — the old project still appears in the listDesktop:
ClientError: UnexpectedStatus (status: 500)and must be restartedExpected Behavior
/openand/projectshould detect stale (non-existent) project entries and either remove them automatically or provide a way to delete them from the listActual Behavior
/openand/projectlists with no way to clean them upAdditional Context