[BUG] Web UI file search fails - query parameter stripped from request when empty #5445

Open
opened 2026-02-16 17:52:49 -05:00 by yindo · 0 comments
Owner

Originally created by @alexandrereyes on GitHub (Jan 13, 2026).

Originally assigned to: @adamdotdevin on GitHub.

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:

  1. packages/sdk/js/src/v2/gen/core/params.gen.ts - Check if query params are being filtered incorrectly
  2. packages/ui/src/hooks/use-filtered-list.tsx - Verify the query value is being passed correctly
  3. packages/app/src/context/file.tsx - Check searchFiles function

Additional notes:

  • Tested with --log-level DEBUG but validation errors are not logged server-side (only status=completed is 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

  1. Run opencode serve and access the Web UI
  2. Open any project/session
  3. Open file search dialog (Ctrl+P or Cmd+P, or click the file search)
  4. Type any text (e.g., "test")
  5. Observe in browser DevTools Network tab that query parameter is missing from all requests
  6. 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

Originally created by @alexandrereyes on GitHub (Jan 13, 2026). Originally assigned to: @adamdotdevin on GitHub. ### 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:** ```json { "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: 1. `packages/sdk/js/src/v2/gen/core/params.gen.ts` - Check if query params are being filtered incorrectly 2. `packages/ui/src/hooks/use-filtered-list.tsx` - Verify the query value is being passed correctly 3. `packages/app/src/context/file.tsx` - Check `searchFiles` function **Additional notes:** - Tested with `--log-level DEBUG` but validation errors are not logged server-side (only `status=completed` is 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 1. Run `opencode serve` and access the Web UI 2. Open any project/session 3. Open file search dialog (Ctrl+P or Cmd+P, or click the file search) 4. Type any text (e.g., "test") 5. Observe in browser DevTools Network tab that `query` parameter is missing from all requests 6. 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
yindo added the web label 2026-02-16 17:52:49 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#5445