feat: unified slash commands (/new, /help) across all channels

This commit is contained in:
Re-bin
2026-02-13 03:30:21 +00:00
parent 0fc4f109bf
commit 903caaa642
5 changed files with 38 additions and 74 deletions

View File

@@ -28,7 +28,6 @@ app = typer.Typer(
console = Console()
EXIT_COMMANDS = {"exit", "quit", "/exit", "/quit", ":q"}
NEW_SESSION_COMMANDS = {"/new", "/reset"}
# ---------------------------------------------------------------------------
# CLI input: prompt_toolkit for editing, paste, history, and display
@@ -112,11 +111,6 @@ def _is_exit_command(command: str) -> bool:
return command.lower() in EXIT_COMMANDS
def _is_new_session_command(command: str) -> bool:
"""Return True when input should clear the session history."""
return command.lower() in NEW_SESSION_COMMANDS
async def _read_interactive_input_async() -> str:
"""Read user input using prompt_toolkit (handles paste, history, display).
@@ -375,7 +369,7 @@ def gateway(
)
# Create channel manager
channels = ChannelManager(config, bus, session_manager=session_manager)
channels = ChannelManager(config, bus)
if channels.enabled_channels:
console.print(f"[green]✓[/green] Channels enabled: {', '.join(channels.enabled_channels)}")
@@ -490,15 +484,6 @@ def agent(
console.print("\nGoodbye!")
break
if _is_new_session_command(command):
session = agent_loop.sessions.get_or_create(session_id)
session.clear()
agent_loop.sessions.save(session)
console.print(
f"\n[green]{__logo__} Started new session. History cleared.[/green]\n"
)
continue
with _thinking_ctx():
response = await agent_loop.process_direct(user_input, session_id)
_print_agent_response(response, render_markdown=markdown)