opencode icon indicating copy to clipboard operation
opencode copied to clipboard

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

Open alexandrereyes opened this issue 1 day ago • 0 comments

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

alexandrereyes avatar Jan 13 '26 21:01 alexandrereyes