Skip to content

Conversation

@dayal-arnav05
Copy link

Add support for displaying agent reasoning/thinking process in the CLI.

Changes:

  • Add --show-thinking command-line flag to main.py
  • Extend SessionState with show_thinking field in config.py
  • Display reasoning blocks in dim style when flag is enabled in execution.py
  • Update help documentation and examples in ui.py

When enabled with --show-thinking, the agent's reasoning blocks from LangChain content blocks are displayed in real-time as dim text, providing transparency into the agent's thought process.

Resolves #311

Arnav Dayal added 2 commits November 7, 2025 18:29
Add support for displaying agent reasoning/thinking process in the CLI.

Changes:
- Add --show-thinking command-line flag to main.py
- Extend SessionState with show_thinking field in config.py
- Display reasoning blocks in dim style when flag is enabled in execution.py
- Update help documentation and examples in ui.py

When enabled with --show-thinking, the agent's reasoning blocks from
LangChain content blocks are displayed in real-time as dim text,
providing transparency into the agent's thought process.

Resolves langchain-ai#311
Add universal tool output toggle that works with all tools including MCP servers.

Changes:
- Add show_tool_outputs field and toggle method to SessionState in config.py
- Add Ctrl+O keybinding to toggle tool outputs in input.py
- Display tool outputs in dim cyan when toggle is enabled in execution.py
- Add toolbar indicator showing current toggle state
- Update help documentation and tips to include Ctrl+O

When enabled, tool outputs are displayed using existing format_tool_message_content()
function. No smart parsing needed - works universally with any tool type.

Features:
- Universal: Works with ALL tools (file ops, web search, MCP servers, custom tools)
- Session-persistent: Toggle stays active throughout session
- Visual indicator: Toolbar shows current state (cyan when ON, gray when OFF)
- Clean display: Outputs shown in dim cyan without interfering with existing UI
@dayal-arnav05 dayal-arnav05 changed the title feat: Add --show-thinking flag to CLI (#311) feat: Add --show-thinking flag to CLI (#311) and Show Tool Outputs in a Collapsible Pane #326 Nov 8, 2025
ma1688 added a commit to HK-CCASS/deepagents-hk that referenced this pull request Nov 10, 2025
…chain-ai#333)

- Add --show-thinking CLI flag to display agent reasoning process
- Add Ctrl+O keybinding to toggle tool output visibility
- Update toolbar to show tool output state with color indicators
- Display tool outputs with ↳ symbol in dim cyan style
- Update help documentation and README with new features
- Add comprehensive testing guide (docs/PR333_TESTING_GUIDE.md)

Changes:
- src/cli/config.py: Add show_thinking and show_tool_outputs to SessionState
- src/cli/execution.py: Add logic to display tool outputs and reasoning
- src/cli/input.py: Add Ctrl+O keybinding and toolbar indicators
- src/cli/main.py: Add --show-thinking argument and tips
- src/cli/ui.py: Update help documentation
- README.md: Document new CLI features
- docs/PR333_TESTING_GUIDE.md: Add comprehensive testing guide
ma1688 added a commit to HK-CCASS/deepagents-hk that referenced this pull request Nov 10, 2025
Implements PR langchain-ai#333: Add --show-thinking flag and Ctrl+O tool output toggle for enhanced CLI observability
ma1688 added a commit to HK-CCASS/deepagents-hk that referenced this pull request Nov 10, 2025
- Add CLI enhancements to architecture diagram:
  * Show Thinking (--show-thinking flag)
  * Tool Outputs Toggle (Ctrl+O)
  * Auto-Approve Toggle (Ctrl+T)

- Update Storage layer to reflect Virtual Mode:
  * Mark all backends with [Virtual Mode]
  * Highlight Default Filesystem with sandbox security
  * Explain path mapping: /file.txt → {cwd}/file.txt

- Update Key Features section:
  * File System Sandbox (Virtual Mode)
  * CLI Enhancements (Show Thinking + Tool Outputs)
  * Better debugging and understanding capabilities

Reflects changes from PR langchain-ai#331 and PR langchain-ai#333
@vtrivedy vtrivedy self-assigned this Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show Thinking Tags in CLI

2 participants