Skip to content

Commit ded1b9d

Browse files
jwesleyeclaude
andcommitted
fix: skip empty input queries to prevent sending blank messages to agent
Added validation to ignore when user presses Enter on an empty line, preventing blank queries from being sent to the agent. This improves UX by matching expected behavior where empty input is simply ignored and the prompt is shown again. The check validates input after command routing but before processing, catching empty queries from single-line input, templates, and as a defensive check for multiline input (which already has its own check). Fixes: Users pressing Enter on empty line no longer sends to agent 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 7d3fc26 commit ded1b9d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/basic_agent_chat_loop/chat_loop.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,6 +1155,10 @@ async def _async_run(self):
11551155
CommandType.TEMPLATE,
11561156
CommandType.MULTILINE,
11571157
):
1158+
# Skip empty queries
1159+
if not user_input.strip():
1160+
continue
1161+
11581162
# Process query through agent
11591163
logger.info(f"Processing query: {user_input[:100]}...")
11601164

0 commit comments

Comments
 (0)