diff --git a/bot/commands.py b/bot/commands.py index bd7552d..93b6ac3 100644 --- a/bot/commands.py +++ b/bot/commands.py @@ -56,7 +56,7 @@ async def handle_command(user_id: str, text: str) -> Optional[str]: elif cmd in ("/help", "/h", "/?"): return _cmd_help() else: - return f"Unknown command: {cmd}\n\n{_cmd_help()}" + return None async def _cmd_new(user_id: str, args: str) -> str: diff --git a/orchestrator/agent.py b/orchestrator/agent.py index 2b8d62f..2e62071 100644 --- a/orchestrator/agent.py +++ b/orchestrator/agent.py @@ -55,12 +55,6 @@ Guidelines: MAX_ITERATIONS = 10 _TOOL_MAP = {t.name: t for t in TOOLS} -COMMAND_PATTERN = re.compile(r"^/(new|list|close|switch|retry|help)", re.IGNORECASE) - - -def _looks_like_command(text: str) -> bool: - return bool(COMMAND_PATTERN.match(text.strip())) - class OrchestrationAgent: """Per-user agent with conversation history and active session tracking.""" @@ -108,8 +102,8 @@ class OrchestrationAgent: logger.info(">>> user=...%s conv=%s msg=%r", short_uid, active_conv, text[:80]) logger.debug(" history_len=%d", len(self._history[user_id])) - # Passthrough mode: if active session and not a command, bypass LLM - if active_conv and not _looks_like_command(text): + # Passthrough mode: if active session, bypass LLM (bot commands handled earlier) + if active_conv: try: reply = await manager.send(active_conv, text, user_id=user_id) logger.info("<<< [passthrough] reply: %r", reply[:120])