Skip to content

Report empty retrieval before generating an answer - #13

Open
agenticsymphony-tech wants to merge 1 commit into
primeodin:mainfrom
agenticsymphony-tech:fix/empty-retrieval-notice
Open

agenticsymphony-tech wants to merge 1 commit into
primeodin:mainfrom
agenticsymphony-tech:fix/empty-retrieval-notice

Conversation

@agenticsymphony-tech

@agenticsymphony-tech agenticsymphony-tech commented Sep 9, 2026 •

Copy link
Copy Markdown

Closes #12.

When a question matches no notes, the CLI currently prints a found-nothing answer and exits successfully. Return status 1 with an actionable stderr notice mentioning the selected notes directory, before constructing the answerer. Stdout stays empty, including with --json. Document this behavior for unmatched questions and empty folders. Successful text and JSON responses remain unchanged.

Update the empty-directory test and add a parametrized regression against the bundled notes with a nonsense query. It covers normal, mock, JSON, and mock JSON modes, asserts no Sources block or stdout, and verifies the answerer is never constructed.

Validation

  • Direct subprocess regression failed before implementation: expected exit 1 but received exit 0 with a found-nothing answer on stdout.
  • The same CLI checks pass after the fix in all four modes.
  • Successful mock text and JSON output were compared byte-for-byte against the original commit and matched.
  • git diff --check passed.
  • Full pytest suite passed locally: installed the declared development dependencies in a project-local virtual environment and ran .venv/bin/python -m pytest -v with Python 3.13.5 and pytest 9.1.1. All 12 tests passed, including the four new parametrized empty-result cases.
collected 12 items
============================== 12 passed in 0.03s ==============================

Implemented with OpenAI Codex and independently reviewed with Claude Code. Both static reviews found no blocking defects; the complete local pytest run also passed.

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.

good first issue: empty-hits notice when nothing retrieves

1 participant