Skip to content

fix: stop masking retrieval failures as vault misses in /query confirm path#435

Merged
cgfixit merged 1 commit into
mainfrom
claude/cyclaw-optimize-retrieval-error
Jul 8, 2026
Merged

fix: stop masking retrieval failures as vault misses in /query confirm path#435
cgfixit merged 1 commit into
mainfrom
claude/cyclaw-optimize-retrieval-error

Conversation

@cgfixit

@cgfixit cgfixit commented Jul 6, 2026

Copy link
Copy Markdown
Owner

What

When retrieve_node (graph.py:235-243) catches a RAGError it returns top_score=0.0 plus an error string, which routes to user_gate exactly like an empty vault. The gateway then answered "Vault miss (best score: 0.000 < ...). Send query to Grok online?" and dropped result["error"] — a broken index was indistinguishable from a routine miss, and the console (which renders only confirm_message on the needs_confirm path and returns early before its data.error handler) never showed the failure.

gate.py's needs-confirm branch now: (1) names the failure in confirm_message ("Retrieval failed (INDEX_NOT_FOUND: ...) — no vault results available. ...") when result["error"] is set, and (2) passes error through in the QueryResponse, matching what the answered path already does. Routing topology is untouched — no graph edge or invariant changes.

Adds test_retrieval_failure_not_masked_as_vault_miss and tightens test_needs_confirm_response (a real vault miss must carry error: null).

Why / benefit

Auditability/operability: a crashed index surfaces as what it is instead of silently nudging the user toward a Grok escalation prompt.

Risk to monitor

This edits the same needs_confirm block that open draft PR #415 touches (its min_score fallback line) — whichever lands second may need a trivial rebase. Verified: tests/test_gate.py + tests/test_graph.py pass locally; full suite green on a trial merge with the three sibling optimize PRs.

🤖 Generated with Claude Code

https://claude.ai/code/session_0195JFv9p8b8Gu6Qvag59ZVq


Generated by Claude Code

@cgfixit cgfixit force-pushed the claude/cyclaw-optimize-retrieval-error branch from 9404717 to 69445b0 Compare July 7, 2026 19:47
…m path

When retrieve_node catches a RAGError it returns top_score=0.0 plus an error
string, which routes to user_gate exactly like an empty vault. The gateway
then answered with 'Vault miss (best score: 0.000 < ...) Send query to Grok
online?' and dropped result['error'] — so a broken index was indistinguishable
from a routine miss, and the console (which renders only confirm_message on
the needs_confirm path) never showed the failure. The confirm response now
names the retrieval failure in confirm_message and passes error through,
matching the answered path. Routing topology is unchanged.
@cgfixit cgfixit force-pushed the claude/cyclaw-optimize-retrieval-error branch from 69445b0 to c6e2d28 Compare July 8, 2026 23:33
@cgfixit cgfixit marked this pull request as ready for review July 8, 2026 23:35
@cgfixit cgfixit merged commit ebda565 into main Jul 8, 2026
29 checks passed
@cgfixit cgfixit deleted the claude/cyclaw-optimize-retrieval-error branch July 8, 2026 23:35
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.

2 participants