opencode
opencode copied to clipboard
[BUG] Web UI file search fails - query parameter stripped from request when empty
Description
When using the file search dialog in the Web UI (via opencode serve), the query parameter is never being sent in the request URL, regardless of what is typed. This causes validation errors on every keystroke.
Actual request sent by the browser (even after typing text):
GET /find/file?dirs=false
Expected request:
GET /find/file?query=mySearchTerm&dirs=false
Error response:
{
"data": { "dirs": "false" },
"error": [{
"expected": "string",
"code": "invalid_type",
"path": ["query"],
"message": "Invalid input: expected string, received undefined"
}],
"success": false
}
Root cause analysis:
The query parameter is never included in the request URL. The SDK should be sending { query: "searchTerm", dirs: "false" } but only dirs appears in the actual HTTP request.
Possible fix locations:
-
packages/sdk/js/src/v2/gen/core/params.gen.ts- Check if query params are being filtered incorrectly -
packages/ui/src/hooks/use-filtered-list.tsx- Verify the query value is being passed correctly -
packages/app/src/context/file.tsx- ChecksearchFilesfunction
Additional notes:
- Tested with
--log-level DEBUGbut validation errors are not logged server-side (onlystatus=completedis shown) - The validation error is returned to the client but not captured in server logs - this could be a separate improvement
Plugins
None
OpenCode version
1.1.18
Steps to reproduce
- Run
opencode serveand access the Web UI - Open any project/session
- Open file search dialog (Ctrl+P or Cmd+P, or click the file search)
- Type any text (e.g., "test")
- Observe in browser DevTools Network tab that
queryparameter is missing from all requests - File search returns no results / shows errors
Screenshot and/or share link
N/A - Bug is in network requests, visible in browser DevTools Network tab
Operating System
macOS (tested on Safari 26.2 and Chrome)
Terminal
N/A - Web UI via browser