fix: Reject empty search queries with validation (Issue #175)#179
Merged
rdmueller merged 1 commit intodocToolchain:mainfrom Jan 26, 2026
Merged
Conversation
e6133c1 to
ea77bf9
Compare
) - Add validation for empty/whitespace-only queries in CLI and MCP - CLI exits with EXIT_INVALID_ARGS (exit code 2) - MCP raises ValueError wrapped in ToolError - Add comprehensive tests for both interfaces - Error message: 'Search query cannot be empty' Fixes docToolchain#175
ea77bf9 to
c504066
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements validation for empty search queries in both CLI and MCP interfaces.
Changes
src/dacli/cli.py): Validate query before search, exit withEXIT_INVALID_ARGS(code 2)src/dacli/mcp_app.py): RaiseValueErrorfor empty queries (wrapped inToolErrorby FastMCP)Behavior
Empty string:
Whitespace only:
Test Results
All 105 tests passing.
Fixes #175
🤖 Generated with Claude Code