anomalyco / anomalyco/opencode

tui: deleted projects remain selectable in V2 project picker

Open
#39,903 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Summary

The V2 TUI project picker can offer a persisted project whose canonical directory has since been deleted. Selecting it leaves the home prompt targeting the deleted path while the footer can still show the previous resolved project, and prompt submission then fails.

Environment

  • opencode version: opencode2 v0.0.0-next-16594
  • OS: Darwin 25.5.0, arm64
  • Terminal: Ghostty (TERM=xterm-256color, COLORTERM=truecolor)
  • Shell: /bin/zsh
  • Install/channel: next / V2
  • Active plugins: @kitlangton/opencode-session-recap, local debug workspace plugin, and ~/.config/opencode/plugins/voice.ts

Reproduction

  1. Open a project in the V2 TUI so it is persisted and appears in the project picker.
  2. Delete that project's directory outside OpenCode.
  3. Open the session/project picker with ctrl+o.
  4. Select the deleted project.
  5. Enter and submit a prompt.

Expected Behavior

A deleted or otherwise unavailable project should not put the TUI into an invalid location state. The picker should either prevent selection or handle the unavailable project explicitly while preserving the current valid location.

Actual Behavior

The deleted project remains selectable. After selection, the path shown under the prompt points at the deleted project while the bottom-left footer can continue to show the previous project. Submitting a prompt fails because the selected directory no longer exists.

Additional Context

Project.list() currently represents persisted known projects and does not account for filesystem changes after persistence. The project picker turns those records directly into selectable directory targets.

The desired project lifecycle semantics need design before implementation. Options include:

  • Filter unavailable directories when listing projects, at the cost of one filesystem lookup per persisted project and changing Project.list() from “known” to “currently reachable.”
  • Validate only the selected directory before changing route/location state, then show an error and optionally evict the stale local picker entry.
  • Add an explicit stale/deleted project lifecycle or cleanup mechanism.

PR #39899 contains a list-time filtering prototype, but it is being closed so these semantics can be decided first.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading Project.list() and the V2 TUI project picker flow that turns persisted projects into directory targets. Review PR #39899 for the list-time filtering prototype, then clarify whether unavailable projects should be filtered, validated on selection, or given an explicit lifecycle. Done means the chosen behavior prevents a deleted project from invalidating the current location and prompt submission.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.