Skip to content

Conversation

@lxxonx
Copy link

@lxxonx lxxonx commented Jan 13, 2026

Summary

Problem

Three issues prevented the Open Project dialog from working:

  1. Server: query parameter was required but SDK sends empty string as undefined, causing 400 Bad Request
  2. Server: directory parameter was ignored, always searching current project directory instead of home
  3. UI: useFilteredList hook didn't properly handle async items function, causing Promise to be used as array

Changes

packages/opencode/src/server/server.ts

  • Make query parameter optional with default empty string
  • Add directory parameter support to /find/file endpoint
  • Implement directory scanning when directory param is provided (2 levels deep)

packages/ui/src/hooks/use-filtered-list.tsx

  • Fix createResource source function to not call async functions synchronously
  • Properly await async items function in fetcher

packages/app/src/components/dialog-select-directory.tsx

  • Add null-safety to filter.trim() call

Testing

Tested locally with opencode web - dialog now shows home directories and search works correctly.

Three issues were preventing the Open Project dialog from working in web mode:

1. Server: query parameter was required but SDK sends empty string as undefined
2. Server: directory parameter was ignored, always searching current project
3. UI: useFilteredList hook didn't properly handle async items function

Changes:
- Make query parameter optional with default empty string
- Add directory parameter support to /find/file endpoint
- Implement directory scanning when directory param is provided
- Fix useFilteredList to properly await async items functions
- Add null-safety to filter.trim() call in dialog
@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found one potentially related PR:

Related PR:

Note: PR #6940 "feat: improve directory search with path completion and subdirectory listing" appeared in search results but is likely a related feature enhancement rather than a duplicate fix.

@adamdotdevin
Copy link
Contributor

Thanks for the contribution, but we got this fixed this morning!

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.

2 participants