fix(tui): handle non-git project paths in autocomplete and session fi…#29539
Open
crimsondhaks wants to merge 1 commit into
Open
fix(tui): handle non-git project paths in autocomplete and session fi…#29539crimsondhaks wants to merge 1 commit into
crimsondhaks wants to merge 1 commit into
Conversation
…lter For non-git projects worktree is set to "/". Two TUI sites used this value directly: autocomplete passed "/" to Reference.resolveAll, and the session list filter computed a relative path against "/" instead of falling through to scope=project. Treat "/" as invalid in both, matching the pattern from anomalyco#29180. Closes anomalyco#29537
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #29537
Type of change
What does this PR do?
For non-git projects the worktree is set to
"/"as a sentinel (seepackages/opencode/src/project/project.ts). Two TUI sites passed it through as if it were a real path:cli/cmd/tui/component/prompt/autocomplete.tsx: the chainsync.path.worktree || sync.path.directory || process.cwd()picked"/"because it's truthy, soReference.resolveAllgot"/"as the worktree instead of the project directory.cli/cmd/tui/context/sync.tsx: thesessionListQueryguard didn't catch"/", sopath.relative("/", directory)produced a stray relative path that was sent as the session filter scope instead of falling back toscope: "project".Treats
"/"as invalid in both call sites. Same pattern as #29180.How did you verify your code works?
bun typecheckfrompackages/opencodebun turbo typecheck) passed across all 19 packagesreferencePath()already handlesworktree === "/"downstream, so the autocomplete change brings the call site into consistency;sessionListQuerynow correctly returnsscope: "project"for non-git projects.Screenshots / recordings
N/A — no UI changes.
Checklist