Skip to content

fix: allow qveris_call without prior discover step#120

Merged
chris7iu merged 1 commit into
mainfrom
chli/qveris-call-no-discover
Apr 9, 2026
Merged

fix: allow qveris_call without prior discover step#120
chris7iu merged 1 commit into
mainfrom
chli/qveris-call-no-discover

Conversation

@chris7iu

@chris7iu chris7iu commented Apr 9, 2026

Copy link
Copy Markdown

Summary

  • Remove the mandatory tool_not_discovered gate in qveris_call that blocked calls when search_id was not in the session registry
  • Make searchId optional in qverisCall(), passing null to the backend API when unavailable (backend accepts it)
  • Update test to verify the call proceeds with null search_id instead of being blocked

Motivation

Production analysis of QVerisBot2 over 792 user messages (2026-03-27 to 2026-04-07) found 190 tool_not_discovered errors — the single largest source of tool failures. The model (kimi-k2.5) memorized tool_ids from prior sessions and called them directly, skipping the discover step. While 85% self-recovered by retrying with discover, each error added 1-3 seconds latency and wasted API calls.

The QVeris backend API accepts null search_id (proven by open-qveris-skills which has always worked this way). The restriction was client-side only.

Behavior change

  • Models that discover first: no change (search_id still cached and used)
  • Models that skip discover: call now proceeds with null search_id instead of returning error

Test plan

  • Updated test: verifies undiscovered call hits API with search_id: null
  • Existing discover→call tests: unaffected (search_id still resolved from registry)
  • Lint passes (oxlint)

🤖 Generated with Claude Code

Remove the mandatory discover-before-call restriction that caused 190
tool_not_discovered errors in production. When search_id is not available
from a prior discover, pass null to the backend API (which accepts it),
matching the behavior of open-qveris-skills.

Models that do discover first still benefit from session tracking via
the rolodex/discoverTracker registries. Models that skip discover now
proceed instead of being blocked.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@chris7iu
chris7iu requested a review from linfangw April 9, 2026 12:49

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the qveris_call tool to allow an optional searchId, enabling the tool to proceed even when a searchId is not provided. The previous validation logic that returned a tool_not_discovered error when searchId was missing has been removed, and the API request now explicitly sends null for search_id if it is undefined. I have no feedback to provide.

@chris7iu
chris7iu merged commit 13a2cee into main Apr 9, 2026
2 of 9 checks passed
@chris7iu
chris7iu deleted the chli/qveris-call-no-discover branch April 9, 2026 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant