Skip to content

search: empty query / non-positive max_results silently return 0 results #374

@justrach

Description

@justrach

Symptom

`codedb_search query=""` returns `isError:false` body `0 results for '':`. `max_results=-3` and `max_results=0` also silently succeed. Indistinguishable from a real query that legitimately had no hits — the agent thinks the search ran.

Failing tests

  • `tests.test.issue-bug7: codedb_search rejects empty query`
  • `tests.test.issue-bug7: codedb_search rejects negative max_results`

Fix

Validate `query.len > 0` and `max_results >= 1` at the top of `handleSearch`, return explicit error.

Labels

bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions