Skip to content

enhancement: Empty query not guarded — returns misleading results across all interfaces #907

Closed

Description

@ajianaz

What

Empty string queries ("") return results across all recall paths (CLI, server, MCP). No guard rejects empty queries.

Reproduction

# CLI — returns results for empty query:
uteke recall "" --limit 5
# Returns 5 results via FTS5 fallback

# HTTP API — same:
curl -X POST http://localhost:18999/recall \
  -d '{"query":"","limit":5}'
# Returns results

# All strategies accept empty query:
uteke recall "" --strategy vector   # 3 results
uteke recall "" --strategy fts5     # 3 results
uteke recall "" --strategy hybrid   # 3 results

Impact

  • Empty queries produce meaningless results, misleading users
  • Wastes compute (embedding generation for empty input)
  • Could mask client-side bugs that send empty queries

Proposed Fix

Add early return with helpful message when query is empty or whitespace-only:

if query.trim().is_empty() {
    return Err("Query cannot be empty".into());
}

Apply at: CLI recall command, HTTP /recall handler, MCP uteke_recall handler.

Environment

  • All interfaces affected: CLI, HTTP API, MCP

Activity

  1. added
    enhancement
    scope:core
    on Aug 5, 2026
  2. added a commit that references this issue on Aug 6, 2026
  3. ajianaz commented on Aug 6, 2026

    @ajianaz
    CollaboratorAuthor

    Fixed in PR #911 (squash merged to develop). Empty/whitespace query now returns 400.

  4. added a commit that references this issue on Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementpriority:mediumscope:core

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions