Skip to content

fix(tui): handle non-git project paths when opening editor#29180

Merged
rekram1-node merged 1 commit into
anomalyco:devfrom
OpeOginni:fix/open-editor
May 27, 2026
Merged

fix(tui): handle non-git project paths when opening editor#29180
rekram1-node merged 1 commit into
anomalyco:devfrom
OpeOginni:fix/open-editor

Conversation

@OpeOginni
Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #16071

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

When opening the external editor from the TUI prompt or session export, the cwd was resolved as:
project.instance.path().worktree || project.instance.directory() || process.cwd()

For non-git projects, worktree is intentionally set to "/" (see src/project/project.ts). Because "/" is truthy, it was selected as the working directory, causing the editor to open at the filesystem root instead of the actual project directory.

Fix

Treat "/" as an invalid worktree at the three Editor.open() call sites so the fallback chain correctly resolves to project.instance.directory().

How did you verify your code works?

  • Tests Run Successful

Screenshots / recordings

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@rekram1-node
Copy link
Copy Markdown
Collaborator

/review

@github-actions
Copy link
Copy Markdown
Contributor

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Non deterministic behaviour of variants passed into agents in the opencode.json config (Desktop)

2 participants