1
0

Merge pull request '[loop-cycle-9] fix: CLI multi-word messages (#26)' (#107) from fix/cli-multiword-messages into main

This commit is contained in:
2026-03-14 19:48:28 -04:00
2 changed files with 137 additions and 4 deletions

View File

@@ -143,7 +143,7 @@ def think(
@app.command()
def chat(
message: str = typer.Argument(..., help="Message to send"),
message: list[str] = typer.Argument(..., help="Message to send to Timmy"),
backend: str | None = _BACKEND_OPTION,
model_size: str | None = _MODEL_SIZE_OPTION,
new_session: bool = typer.Option(
@@ -173,6 +173,8 @@ def chat(
calls are checked against config/allowlist.yaml — allowlisted operations
execute automatically, everything else is safely rejected.
"""
full_message = " ".join(message)
import uuid
if session_id is not None:
@@ -184,7 +186,7 @@ def chat(
timmy = create_timmy(backend=backend, model_size=model_size, session_id=session_id)
# Use agent.run() so we can intercept paused runs for tool confirmation.
run_output = timmy.run(message, stream=False, session_id=session_id)
run_output = timmy.run(full_message, stream=False, session_id=session_id)
# Handle paused runs — dangerous tools need user approval
run_output = _handle_tool_confirmation(timmy, run_output, session_id, autonomous=autonomous)
@@ -328,12 +330,13 @@ def voice(
@app.command()
def route(
message: str = typer.Argument(..., help="Message to route"),
message: list[str] = typer.Argument(..., help="Message to route"),
):
"""Show which agent would handle a message (debug routing)."""
full_message = " ".join(message)
from timmy.agents.loader import route_request_with_match
agent_id, matched_pattern = route_request_with_match(message)
agent_id, matched_pattern = route_request_with_match(full_message)
if agent_id:
typer.echo(f"{agent_id} (matched: {matched_pattern})")
else: