feat: Add reasoning_channel_id to communication platform configurations and improve message bus context cancellation handling.

This commit is contained in:
Avisek 2026-02-26 11:33:01 +05:30 committed by Hoshina
parent 9f95aad5f3
commit f96cf3f8cc
2 changed files with 34 additions and 13 deletions

View file

@ -52,30 +52,35 @@
"proxy": "", "proxy": "",
"allow_from": [ "allow_from": [
"YOUR_USER_ID" "YOUR_USER_ID"
] ],
"reasoning_channel_id": ""
}, },
"discord": { "discord": {
"enabled": false, "enabled": false,
"token": "YOUR_DISCORD_BOT_TOKEN", "token": "YOUR_DISCORD_BOT_TOKEN",
"allow_from": [], "allow_from": [],
"mention_only": false "mention_only": false,
"reasoning_channel_id": ""
}, },
"qq": { "qq": {
"enabled": false, "enabled": false,
"app_id": "YOUR_QQ_APP_ID", "app_id": "YOUR_QQ_APP_ID",
"app_secret": "YOUR_QQ_APP_SECRET", "app_secret": "YOUR_QQ_APP_SECRET",
"allow_from": [] "allow_from": [],
"reasoning_channel_id": ""
}, },
"maixcam": { "maixcam": {
"enabled": false, "enabled": false,
"host": "0.0.0.0", "host": "0.0.0.0",
"port": 18790, "port": 18790,
"allow_from": [] "allow_from": [],
"reasoning_channel_id": ""
}, },
"whatsapp": { "whatsapp": {
"enabled": false, "enabled": false,
"bridge_url": "ws://localhost:3001", "bridge_url": "ws://localhost:3001",
"allow_from": [] "allow_from": [],
"reasoning_channel_id": ""
}, },
"feishu": { "feishu": {
"enabled": false, "enabled": false,
@ -83,19 +88,22 @@
"app_secret": "", "app_secret": "",
"encrypt_key": "", "encrypt_key": "",
"verification_token": "", "verification_token": "",
"allow_from": [] "allow_from": [],
"reasoning_channel_id": ""
}, },
"dingtalk": { "dingtalk": {
"enabled": false, "enabled": false,
"client_id": "YOUR_CLIENT_ID", "client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET", "client_secret": "YOUR_CLIENT_SECRET",
"allow_from": [] "allow_from": [],
"reasoning_channel_id": ""
}, },
"slack": { "slack": {
"enabled": false, "enabled": false,
"bot_token": "xoxb-YOUR-BOT-TOKEN", "bot_token": "xoxb-YOUR-BOT-TOKEN",
"app_token": "xapp-YOUR-APP-TOKEN", "app_token": "xapp-YOUR-APP-TOKEN",
"allow_from": [] "allow_from": [],
"reasoning_channel_id": ""
}, },
"line": { "line": {
"enabled": false, "enabled": false,
@ -104,7 +112,8 @@
"webhook_host": "0.0.0.0", "webhook_host": "0.0.0.0",
"webhook_port": 18791, "webhook_port": 18791,
"webhook_path": "/webhook/line", "webhook_path": "/webhook/line",
"allow_from": [] "allow_from": [],
"reasoning_channel_id": ""
}, },
"onebot": { "onebot": {
"enabled": false, "enabled": false,
@ -112,7 +121,8 @@
"access_token": "", "access_token": "",
"reconnect_interval": 5, "reconnect_interval": 5,
"group_trigger_prefix": [], "group_trigger_prefix": [],
"allow_from": [] "allow_from": [],
"reasoning_channel_id": ""
}, },
"wecom": { "wecom": {
"_comment": "WeCom Bot (智能机器人) - Easier setup, supports group chats", "_comment": "WeCom Bot (智能机器人) - Easier setup, supports group chats",
@ -124,7 +134,8 @@
"webhook_port": 18793, "webhook_port": 18793,
"webhook_path": "/webhook/wecom", "webhook_path": "/webhook/wecom",
"allow_from": [], "allow_from": [],
"reply_timeout": 5 "reply_timeout": 5,
"reasoning_channel_id": ""
}, },
"wecom_app": { "wecom_app": {
"_comment": "WeCom App (自建应用) - More features, proactive messaging, private chat only. See docs/wecom-app-configuration.md", "_comment": "WeCom App (自建应用) - More features, proactive messaging, private chat only. See docs/wecom-app-configuration.md",
@ -138,7 +149,8 @@
"webhook_port": 18792, "webhook_port": 18792,
"webhook_path": "/webhook/wecom-app", "webhook_path": "/webhook/wecom-app",
"allow_from": [], "allow_from": [],
"reply_timeout": 5 "reply_timeout": 5,
"reasoning_channel_id": ""
} }
}, },
"providers": { "providers": {

View file

@ -34,6 +34,9 @@ func (mb *MessageBus) PublishInbound(ctx context.Context, msg InboundMessage) er
if mb.closed.Load() { if mb.closed.Load() {
return ErrBusClosed return ErrBusClosed
} }
if err := ctx.Err(); err != nil {
return err
}
select { select {
case mb.inbound <- msg: case mb.inbound <- msg:
return nil return nil
@ -59,6 +62,9 @@ func (mb *MessageBus) PublishOutbound(ctx context.Context, msg OutboundMessage)
if mb.closed.Load() { if mb.closed.Load() {
return ErrBusClosed return ErrBusClosed
} }
if err := ctx.Err(); err != nil {
return err
}
select { select {
case mb.outbound <- msg: case mb.outbound <- msg:
return nil return nil
@ -84,6 +90,9 @@ func (mb *MessageBus) PublishOutboundMedia(ctx context.Context, msg OutboundMedi
if mb.closed.Load() { if mb.closed.Load() {
return ErrBusClosed return ErrBusClosed
} }
if err := ctx.Err(); err != nil {
return err
}
select { select {
case mb.outboundMedia <- msg: case mb.outboundMedia <- msg:
return nil return nil