Skip to content

Fix Reasoning Content Being Silently Dropped by Adding Channel-Aware Reasoning Routing #645#802

Open
biisal wants to merge 2 commits intosipeed:refactor/channel-systemfrom
biisal:reasoning-chnl
Open

Fix Reasoning Content Being Silently Dropped by Adding Channel-Aware Reasoning Routing #645#802
biisal wants to merge 2 commits intosipeed:refactor/channel-systemfrom
biisal:reasoning-chnl

Conversation

@biisal
Copy link
Contributor

@biisal biisal commented Feb 26, 2026

closes #645

📝 Description

Implements reasoning output handling so reasoning is no longer silently dropped.

This PR:

  • adds reasoning_channel_id support to all channel configs
  • routes reasoning by source channel via agent loop logic
  • forwards reasoning to configured destination channel/chat
  • updates config/config.example.json with concrete reasoning_channel_id examples
  • adds tests for reasoning channel ,publish flow, ctx expiration
  • refactor PublishOutboundMedia and PublishOutbound to early check if context is expired

Used different channel id for reasoning output so the main chat looks clean even though user can provide same chat id if they want reasoning output to the same channel.

🗣️ Type of Change

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 📖 Documentation update
  • ⚡ Code refactoring (no functional changes, no api changes)

🤖 AI Code Generation

  • 🤖 Fully AI-generated (100% AI, 0% Human)
  • 🛠️ Mostly AI-generated (AI draft, Human verified/modified)
  • 👨‍💻 Mostly Human-written (Human lead, AI assisted or none)
  • Feature is fully human written and refactored by AI and test cases mostly written by AI

🔗 Related Issue

📚 Technical Context (Skip for Docs)

  • Reference URL: N/A
  • Reasoning: Reasoning-capable provider responses included reasoning fields, but they were not consistently surfaced. This change introduces explicit reasoning routing with opt-in per-channel config and test coverage to prevent regressions.

🧪 Test Environment

  • Hardware: PC (local dev) and laptop
  • OS: MacOS and Arch Linux
  • Model/Provider: OpenAI-compatible provider
  • Channels: logic covered for all configured channel types

📸 Evidence (Optional)

Click to view Logs/Screenshots
avisek@codeltix-dot-com   make check
all modules verified
?   	github.com/sipeed/picoclaw/cmd/picoclaw	[no test files]
ok  	github.com/sipeed/picoclaw/pkg/agent	(cached)
ok  	github.com/sipeed/picoclaw/pkg/auth	(cached)
ok  	github.com/sipeed/picoclaw/pkg/bus	(cached)
ok  	github.com/sipeed/picoclaw/pkg/channels	(cached)
?   	github.com/sipeed/picoclaw/pkg/channels/dingtalk	[no test files]
?   	github.com/sipeed/picoclaw/pkg/channels/discord	[no test files]
?   	github.com/sipeed/picoclaw/pkg/channels/feishu	[no test files]
?   	github.com/sipeed/picoclaw/pkg/channels/line	[no test files]
?   	github.com/sipeed/picoclaw/pkg/channels/maixcam	[no test files]
?   	github.com/sipeed/picoclaw/pkg/channels/onebot	[no test files]
?   	github.com/sipeed/picoclaw/pkg/channels/pico	[no test files]
?   	github.com/sipeed/picoclaw/pkg/channels/qq	[no test files]
ok  	github.com/sipeed/picoclaw/pkg/channels/slack	(cached)
?   	github.com/sipeed/picoclaw/pkg/channels/telegram	[no test files]
ok  	github.com/sipeed/picoclaw/pkg/channels/wecom	(cached)
?   	github.com/sipeed/picoclaw/pkg/channels/whatsapp	[no test files]
ok  	github.com/sipeed/picoclaw/pkg/config	(cached)
?   	github.com/sipeed/picoclaw/pkg/constants	[no test files]
ok  	github.com/sipeed/picoclaw/pkg/cron	(cached)
?   	github.com/sipeed/picoclaw/pkg/devices	[no test files]
?   	github.com/sipeed/picoclaw/pkg/devices/events	[no test files]
?   	github.com/sipeed/picoclaw/pkg/devices/sources	[no test files]
?   	github.com/sipeed/picoclaw/pkg/health	[no test files]
ok  	github.com/sipeed/picoclaw/pkg/heartbeat	(cached)
ok  	github.com/sipeed/picoclaw/pkg/identity	(cached)
ok  	github.com/sipeed/picoclaw/pkg/logger	(cached)
ok  	github.com/sipeed/picoclaw/pkg/media	(cached)
ok  	github.com/sipeed/picoclaw/pkg/migrate	(cached)
ok  	github.com/sipeed/picoclaw/pkg/providers	(cached)
ok  	github.com/sipeed/picoclaw/pkg/providers/anthropic	(cached)
ok  	github.com/sipeed/picoclaw/pkg/providers/openai_compat	(cached)
?   	github.com/sipeed/picoclaw/pkg/providers/protocoltypes	[no test files]
ok  	github.com/sipeed/picoclaw/pkg/routing	(cached)
ok  	github.com/sipeed/picoclaw/pkg/session	(cached)
ok  	github.com/sipeed/picoclaw/pkg/skills	(cached)
ok  	github.com/sipeed/picoclaw/pkg/state	(cached)
ok  	github.com/sipeed/picoclaw/pkg/tools	(cached)
ok  	github.com/sipeed/picoclaw/pkg/utils	(cached)
?   	github.com/sipeed/picoclaw/pkg/voice	[no test files]
avisek@codeltix-dot-com  

☑️ Checklist

  • My code/docs follow the style of this project.
  • I have performed a self-review of my own changes.
  • I have updated the documentation accordingly.

…ions and improve message bus context cancellation handling.
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.

1 participant