File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -502,10 +502,16 @@ def route(
502502
503503 user_input_lower = user_input .lower ().strip ()
504504
505+ # Check if user explicitly references a slash command (e.g., "/save", "/mcp-read")
506+ # We need to distinguish between actual commands (like "/save") and file paths (like "/tmp/city")
507+ # Slash commands typically appear as "/command" at word boundaries or standalone
508+ slash_command_pattern = r'\b/(?:save|run|validate|connect|mcp-|init|help|status|clear|exit|optimize|eval|explain|model|models|data|examples|adapters|retrievers|demo|session)'
509+ has_slash_command = re .search (slash_command_pattern , user_input_lower ) is not None
510+
505511 # For now, we are conservative: only attempt NL routing when the
506- # user *explicitly* references slash commands (\"/\") , otherwise
512+ # user *explicitly* references slash commands, otherwise
507513 # we treat the input as a normal LLM request.
508- if "/" not in user_input_lower :
514+ if not has_slash_command :
509515 logger .debug (
510516 f"No explicit slash command reference in NL input, treating as normal LLM input: '{ user_input } '"
511517 )
You can’t perform that action at this time.
0 commit comments