Repository navigation
fix(search): explain empty results in metadata - #647
Conversation
|
Thank you for the focused fix and the detailed validation notes! Distinguishing “no eligible results” from “content already returned” is useful, and the change in I reviewed commit [P2] Update Codex consumers when empty search answers become non-empty noticesThe new fallback in search.py makes an empty successful search return a non-empty string. However, the existing Codex integration still uses the truthiness of
I reproduced this by passing the actual empty
Could you please update these consumers to distinguish a no-results notice from retrieved memory, preserve their empty-result handling, and add regression coverage using the new response? The same classification should handle the all-returned notice where applicable. One detail to keep in mind: the current MCP job wrapper returns only Optional simplificationThe runtime change already adds only four lines and reuses the existing notice constants; I would keep it this small rather than introduce another shared helper. In the new regression file, Local validation
Thanks again for the contribution! Apart from the downstream empty-result handling above, I did not find a defect in the core search change. |
|
Thank you for the updates and for addressing the earlier integration feedback! I reviewed After checking another downstream consumer, QwenPaw, I would like to recommend preserving the existing empty-answer behavior and adding the explanation to metadata instead. This revises my earlier suggestion to adapt individual consumers: preserving the response behavior would avoid requiring each existing agent integration to recognize new notice strings. There is a reproducible P2 compatibility issue outside the integrations changed here. In the local QwenPaw checkout at Given ReMe's emphasis on CLI and embedded usage, could we use this additive contract for the default
{
"empty_result": {
"reason": "no_results",
"message": "No relevant information was found for the given query."
}
}The other reason would be Both the HTTP-backed CLI and the one-shot CLI already support optional metadata display. For normal service usage, This should also simplify the PR: the integration changes introduced to accommodate non-empty notices would no longer be needed, leaving the default For validation, please retain the distinct no-match, score-filtered, all-returned, normal-hit, and shared-context cases, but assert the unchanged answer plus the new metadata. Locally, the 91 related QwenPaw tests and 19 ReMe CLI/client tests pass; the existing QwenPaw tests do not cover these new notices. I also checked both CLI formatters with the proposed metadata shape. No live model-provider tests were run. Thanks again for the careful fixes and regression coverage. Keeping this additive would make the change easier for existing consumers to adopt. |
# Conflicts: # reme/steps/index/search.py
|
Updated in c2e0c965 following the revised metadata approach.
Validation: 120 focused/related tests passed; the full Linux Python 3.12 suite and plugin tests passed with 2358 passed and 3 optional-dependency skips. Pre-commit and diff checks passed. Documentation tests passed (19), and the standard Linux documentation build verified 40 artifacts. Actual search responses also pass the unchanged Codex explicit search (English/Chinese), Codex/Claude auto-recall, Hermes recall/status, and OpenClaw formatter checks with retrieval and transport mocked. The new head's GitHub Actions currently require maintainer approval to run. No live model-provider or external-agent tests were run. |
Summary
Preserve
answer=""andsuccess=truefor successful empty default searches, and explain the outcome in optionalmetadata.empty_result:no_resultswhen retrieval or score filtering leaves no eligible chunks, andall_returnedwhen all eligible chunks were already returned in the same tool context. The accompanyingmessagereuses the existing notices. Normal hits omit this field and keep their existing rendering.The reason is determined after score filtering and before deduplication, so earlier search history cannot turn a new no-match query into
all_returned. Clear the field before each invocation to avoid carrying an empty-result explanation into a later hit or error.The net diff is limited to
SearchStep, focused regressions, and the English/Chinese Memory Search guides. Existing agent consumers and the answer-only MCP transport retain their behavior. CLI users can display the explanation with the existingshow_metadata=trueoption.Related issue
Related to #379 (the default search path).
Contract and data impact
The only contract addition is optional
metadata.empty_result = {reason, message}. Existingresults,counts,link_expansion, and optional deduplication metadata keep their shapes. No configuration change or migration is required. Separate BM25/vector search answers remain unchanged.Validation
Focused tests pass
Unit tests pass, or omitted tests are explained below
pre-commit run --all-filespasses, or omitted checks are explained belowFrontend checks were run when
reme_studio/changedWindows: search, score-threshold, link-expansion, HTTP-client and CLI tests — 120 passed, including 20 focused empty-result cases.
Linux, Python 3.12.3:
python -m coverage run -m pytest tests/unit plugins/auto-fin plugins/daily_paper plugins/lme plugins/beam -q --tb=short— 2358 passed, 3 skipped, 0 failed; coverage reporting passes. The skips are optionalpillow_heifandaiodockercases, with no manual test exclusions.Linux, Node 24.16.0, from
github-pages:npm test— 19 passed;npm run build— passed, verifying 40 documentation build artifacts.pre-commit run --all-filesandgit diff --check— passed.Actual
SearchStepresponses for no-match, score-filtered, all-returned, and normal-hit scenarios pass through the unchanged Codex explicit search (English/Chinese), Codex/Claude auto-recall, Hermes recall/status, and OpenClaw context formatter with retrieval and transport boundaries mocked. Empty results are not injected as memory; normal hits remain usable.No live model-provider or external-agent tests were run. The PR has no Studio frontend changes.
Checklist
No default configuration, typed schema, or resource-lifecycle changes are needed.