feat(cli): display model reasoning content during streaming

Add show_reasoning config (default: False) to display model
thinking/reasoning content in the TUI during streaming.  Reasoning
is emitted via a new emit_reasoning hook on AgentHook, gated by the
channels config.  Display uses ✻ prefix with dim italic styling.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Flinn Xie
2026-05-11 01:02:49 +08:00
co-authored by Claude Opus 4.7
parent d630ac90d1
commit 3a27af0018
9 changed files with 182 additions and 13 deletions
+6
View File
@@ -48,6 +48,9 @@ class AgentHook:
async def before_execute_tools(self, context: AgentHookContext) -> None:
pass
async def emit_reasoning(self, reasoning_content: str | None) -> None:
pass
async def after_iteration(self, context: AgentHookContext) -> None:
pass
@@ -95,6 +98,9 @@ class CompositeHook(AgentHook):
async def before_execute_tools(self, context: AgentHookContext) -> None:
await self._for_each_hook_safe("before_execute_tools", context)
async def emit_reasoning(self, reasoning_content: str | None) -> None:
await self._for_each_hook_safe("emit_reasoning", reasoning_content)
async def after_iteration(self, context: AgentHookContext) -> None:
await self._for_each_hook_safe("after_iteration", context)