fix(search): distinguish invalid QMD output - #47
Conversation
|
Warning Review limit reachedNext included review available in 7 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (7)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 601bb7d02b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| var ErrInvalidOutput = errors.New("qmd returned invalid search output") | ||
|
|
||
| // FailureHint distinguishes dependency failures from invalid producer output. | ||
| func FailureHint(err error) string { |
There was a problem hiding this comment.
Apply the invalid-output hint to brief
When exocortex brief receives malformed or non-JSON output from both the hybrid query and its BM25 fallback, qmd.Search returns ErrInvalidOutput, but cmdBrief still emits its hard-coded installation/indexing hint at internal/cli/cli.go:482. As a result, the new classification remains bypassed for the core brief operation and continues sending operators toward the wrong recovery action; route that error through FailureHint(err) as well.
AGENTS.md reference: AGENTS.md:L18-L18
Useful? React with 👍 / 👎.
Intent
Stop directing operators toward installation or collection recovery when QMD exits successfully but violates its JSON output contract.
Decision
Add the typed
qmd.ErrInvalidOutputboundary for non-JSON and malformed JSON stdout. CLI and MCP continue to return the stablesearch_unavailableconflict but now use a data-specific recovery hint for producer output failures; process/dependency failures keep the installation/index hint. Integer and decimal score shapes remain nativefloat64decoding.The historical deployed failure no longer reproduces with installed QMD 2.6.3: the exact
SeptemberBM25 journal query now returns structured results. The malformed fixture preserves the original decimal-boundary failure shape and proves truthful handling if it recurs.Checks
./scripts/check.sh: passed.go run ./cmd/exocortex search September --mode bm25 --type journal: returned structured Daybook results.Rollback
Revert this PR. Search dependency failures remain unchanged; only successful-process invalid-output diagnostics would return to the generic hint.