Xubin Ren a6b059d379 refactor(reasoning): make channel plugins own reasoning rendering
Reasoning was being shipped to every channel as a generic progress
message with a `_reasoning: true` flag. Two problems with that:

1. Channels without a low-emphasis UI primitive (Telegram, Slack,
   Discord, Feishu...) would dump raw model thoughts as ordinary
   replies, polluting the conversation.
2. The agent loop double-gated by inspecting `channels_config`, which
   coupled the loop to display policy.

Treat reasoning as its own plugin action — `BaseChannel.send_reasoning`
defaults to a documented no-op; channels that have a fitting affordance
override. ChannelManager routes `_reasoning` outbounds to that method
only when the channel opts in via `show_reasoning` (camelCase alias
`showReasoning` mirrors `sendProgress`). Plugins that don't override
silently drop reasoning — "no fit, no leak" is the contract.

Reference implementation lands for WebSocket / WebUI: a new
`kind: "reasoning"` frame, parked on the active assistant bubble as a
collapsible `Thinking` group above the answer. CLI keeps its existing
direct path (it doesn't go through the bus). `ChannelsConfig.show_reasoning`
flips to `true` by default — only adapted channels surface anything,
others stay quiet.

Loop net diff is -3 lines: the `channels_config.show_reasoning` check
moves out, leaving emit_reasoning a one-liner that publishes and trusts
the channel to decide.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-13 06:27:53 +00:00
..

nanobot Docs

For the latest documentation, visit nanobot.wiki.

The pages in this directory track the current repository and may move faster than the published website.

Core Docs

Start here for setup, everyday usage, and deployment.

Topic Repo docs What it covers
Install and quick start quick-start.md Installation, onboarding, and first-run setup
Chat apps chat-apps.md Connect nanobot to Telegram, Discord, WeChat, and more
Agent social network agent-social-network.md Join external agent communities from nanobot
Configuration configuration.md Providers, tools, channels, MCP, and runtime settings
Image generation image-generation.md Configure image providers, WebUI image mode, and generated artifacts
Multiple instances multiple-instances.md Run isolated bots with separate configs and workspaces
CLI reference cli-reference.md Core CLI commands and common entrypoints
In-chat commands chat-commands.md Slash commands and periodic task behavior
OpenAI-compatible API openai-api.md Local API endpoints, request format, and file uploads
Deployment deployment.md Docker, Linux service, and macOS LaunchAgent setup

Advanced Docs

Use these when you want deeper customization, integration, or extension details.

Topic Repo docs What it covers
Memory memory.md How nanobot stores, consolidates, and restores memory
Python SDK python-sdk.md Use nanobot programmatically from Python
Channel plugin guide channel-plugin-guide.md Build and test custom chat channel plugins
WebSocket channel websocket.md Real-time WebSocket access and protocol details
Custom tools my-tool.md Inspect and tune runtime state with the my tool