Thinking improvements.
This commit is contained in:
@@ -832,13 +832,9 @@ async def cmd_reload(session: Session, args: str) -> bool:
|
||||
return True
|
||||
|
||||
|
||||
@command(["/thinking"], "Show the thinking output from the last response")
|
||||
@command(["/thinking"], "Browse thinking output history for this session")
|
||||
async def cmd_thinking(session: Session, args: str) -> bool:
|
||||
last = ui.get_last_thinking()
|
||||
if not last:
|
||||
ui.print_system("No thinking output recorded — thinking mode may not be active.")
|
||||
else:
|
||||
ui.print_thinking_expansion(last)
|
||||
await ui.show_thinking_picker()
|
||||
return True
|
||||
|
||||
|
||||
@@ -897,6 +893,11 @@ def _dispatch_command(name: str):
|
||||
return None
|
||||
|
||||
|
||||
# Register all slash command names for tab completion.
|
||||
# This runs once at import time, after all @command decorators have executed.
|
||||
ui.set_completions([(name, desc) for names, desc, _ in COMMANDS for name in names])
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Direct Agent Session
|
||||
# Opens an interactive REPL with one named agent.
|
||||
@@ -920,7 +921,7 @@ async def direct_agent_session(agent_name: str, dry_run: bool = False):
|
||||
|
||||
while True:
|
||||
try:
|
||||
user_input = ui.get_directive()
|
||||
user_input = await ui.get_directive()
|
||||
except (EOFError, KeyboardInterrupt):
|
||||
break
|
||||
|
||||
@@ -928,11 +929,7 @@ async def direct_agent_session(agent_name: str, dry_run: bool = False):
|
||||
break
|
||||
|
||||
if user_input.lower() == "/thinking":
|
||||
last = ui.get_last_thinking()
|
||||
if not last:
|
||||
ui.print_system("No thinking output recorded — thinking mode may not be active.")
|
||||
else:
|
||||
ui.print_thinking_expansion(last)
|
||||
await ui.show_thinking_picker()
|
||||
continue
|
||||
|
||||
response = await call_agent_async(agent, user_input, dry_run=dry_run, stream=True)
|
||||
@@ -955,7 +952,7 @@ async def principal_session(dry_run: bool = False):
|
||||
|
||||
while True:
|
||||
try:
|
||||
raw = ui.get_directive()
|
||||
raw = await ui.get_directive()
|
||||
except (EOFError, KeyboardInterrupt):
|
||||
ui.console.print()
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user