fix: lint cleanup and document group_trigger in example config
Add group_trigger entries to all channels in config.example.json that support mention-only mode. Fix golines formatting in line.go, matrix.go, config.go, and suppress nilerr for intentional silent skip in observeMessage. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
3bd90a2212
commit
556d236c46
5 changed files with 37 additions and 9 deletions
|
|
@ -95,6 +95,9 @@
|
||||||
"proxy": "",
|
"proxy": "",
|
||||||
"allow_from": ["YOUR_USER_ID"],
|
"allow_from": ["YOUR_USER_ID"],
|
||||||
"use_markdown_v2": false,
|
"use_markdown_v2": false,
|
||||||
|
"group_trigger": {
|
||||||
|
"mention_only": true
|
||||||
|
},
|
||||||
"reasoning_channel_id": "",
|
"reasoning_channel_id": "",
|
||||||
"streaming": {
|
"streaming": {
|
||||||
"enabled": true
|
"enabled": true
|
||||||
|
|
@ -115,6 +118,9 @@
|
||||||
"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": [],
|
||||||
|
"group_trigger": {
|
||||||
|
"mention_only": true
|
||||||
|
},
|
||||||
"reasoning_channel_id": ""
|
"reasoning_channel_id": ""
|
||||||
},
|
},
|
||||||
"maixcam": {
|
"maixcam": {
|
||||||
|
|
@ -130,6 +136,9 @@
|
||||||
"use_native": false,
|
"use_native": false,
|
||||||
"session_store_path": "",
|
"session_store_path": "",
|
||||||
"allow_from": [],
|
"allow_from": [],
|
||||||
|
"group_trigger": {
|
||||||
|
"mention_only": false
|
||||||
|
},
|
||||||
"reasoning_channel_id": ""
|
"reasoning_channel_id": ""
|
||||||
},
|
},
|
||||||
"feishu": {
|
"feishu": {
|
||||||
|
|
@ -139,6 +148,9 @@
|
||||||
"encrypt_key": "",
|
"encrypt_key": "",
|
||||||
"verification_token": "",
|
"verification_token": "",
|
||||||
"allow_from": [],
|
"allow_from": [],
|
||||||
|
"group_trigger": {
|
||||||
|
"mention_only": true
|
||||||
|
},
|
||||||
"placeholder": {
|
"placeholder": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"text": ["Thinking...", "Processing...", "Typing..."]
|
"text": ["Thinking...", "Processing...", "Typing..."]
|
||||||
|
|
@ -152,6 +164,9 @@
|
||||||
"client_id": "YOUR_CLIENT_ID",
|
"client_id": "YOUR_CLIENT_ID",
|
||||||
"client_secret": "YOUR_CLIENT_SECRET",
|
"client_secret": "YOUR_CLIENT_SECRET",
|
||||||
"allow_from": [],
|
"allow_from": [],
|
||||||
|
"group_trigger": {
|
||||||
|
"mention_only": true
|
||||||
|
},
|
||||||
"reasoning_channel_id": ""
|
"reasoning_channel_id": ""
|
||||||
},
|
},
|
||||||
"slack": {
|
"slack": {
|
||||||
|
|
@ -159,6 +174,9 @@
|
||||||
"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": [],
|
||||||
|
"group_trigger": {
|
||||||
|
"mention_only": true
|
||||||
|
},
|
||||||
"reasoning_channel_id": ""
|
"reasoning_channel_id": ""
|
||||||
},
|
},
|
||||||
"matrix": {
|
"matrix": {
|
||||||
|
|
@ -186,6 +204,9 @@
|
||||||
"channel_access_token": "YOUR_LINE_CHANNEL_ACCESS_TOKEN",
|
"channel_access_token": "YOUR_LINE_CHANNEL_ACCESS_TOKEN",
|
||||||
"webhook_path": "/webhook/line",
|
"webhook_path": "/webhook/line",
|
||||||
"allow_from": [],
|
"allow_from": [],
|
||||||
|
"group_trigger": {
|
||||||
|
"mention_only": true
|
||||||
|
},
|
||||||
"reasoning_channel_id": ""
|
"reasoning_channel_id": ""
|
||||||
},
|
},
|
||||||
"onebot": {
|
"onebot": {
|
||||||
|
|
@ -195,6 +216,9 @@
|
||||||
"reconnect_interval": 5,
|
"reconnect_interval": 5,
|
||||||
"group_trigger_prefix": [],
|
"group_trigger_prefix": [],
|
||||||
"allow_from": [],
|
"allow_from": [],
|
||||||
|
"group_trigger": {
|
||||||
|
"mention_only": true
|
||||||
|
},
|
||||||
"reasoning_channel_id": ""
|
"reasoning_channel_id": ""
|
||||||
},
|
},
|
||||||
"wecom": {
|
"wecom": {
|
||||||
|
|
|
||||||
|
|
@ -1448,7 +1448,7 @@ func (al *AgentLoop) observeMessage(ctx context.Context, msg bus.InboundMessage)
|
||||||
"channel": msg.Channel,
|
"channel": msg.Channel,
|
||||||
"error": err.Error(),
|
"error": err.Error(),
|
||||||
})
|
})
|
||||||
return "", nil
|
return "", nil //nolint:nilerr // route resolution failure is not an error for observe-only messages
|
||||||
}
|
}
|
||||||
|
|
||||||
sessionKey := resolveScopeKey(route, msg.SessionKey)
|
sessionKey := resolveScopeKey(route, msg.SessionKey)
|
||||||
|
|
|
||||||
|
|
@ -367,7 +367,9 @@ func (c *LINEChannel) processEvent(event lineEvent) {
|
||||||
"platform": "line",
|
"platform": "line",
|
||||||
"source_type": event.Source.Type,
|
"source_type": event.Source.Type,
|
||||||
}
|
}
|
||||||
c.ObserveGroupMessage(c.ctx, observePeer, msg.ID, senderID, chatID, content, mediaPaths, observeMeta, observeSender)
|
c.ObserveGroupMessage(
|
||||||
|
c.ctx, observePeer, msg.ID, senderID, chatID, content, mediaPaths, observeMeta, observeSender,
|
||||||
|
)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
content = cleaned
|
content = cleaned
|
||||||
|
|
|
||||||
|
|
@ -728,7 +728,9 @@ func (c *MatrixChannel) handleMessageEvent(ctx context.Context, evt *event.Event
|
||||||
"room_id": roomID,
|
"room_id": roomID,
|
||||||
"platform": "matrix",
|
"platform": "matrix",
|
||||||
}
|
}
|
||||||
c.ObserveGroupMessage(ctx, observePeer, evt.ID.String(), senderID, roomID, content, mediaPaths, observeMeta, sender)
|
c.ObserveGroupMessage(
|
||||||
|
ctx, observePeer, evt.ID.String(), senderID, roomID, content, mediaPaths, observeMeta, sender,
|
||||||
|
)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
content = cleaned
|
content = cleaned
|
||||||
|
|
|
||||||
|
|
@ -353,13 +353,13 @@ type StreamingConfig struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type WhatsAppConfig struct {
|
type WhatsAppConfig struct {
|
||||||
Enabled bool `json:"enabled" yaml:"-" env:"PICOCLAW_CHANNELS_WHATSAPP_ENABLED"`
|
Enabled bool `json:"enabled" yaml:"-" env:"PICOCLAW_CHANNELS_WHATSAPP_ENABLED"`
|
||||||
BridgeURL string `json:"bridge_url" yaml:"-" env:"PICOCLAW_CHANNELS_WHATSAPP_BRIDGE_URL"`
|
BridgeURL string `json:"bridge_url" yaml:"-" env:"PICOCLAW_CHANNELS_WHATSAPP_BRIDGE_URL"`
|
||||||
UseNative bool `json:"use_native" yaml:"-" env:"PICOCLAW_CHANNELS_WHATSAPP_USE_NATIVE"`
|
UseNative bool `json:"use_native" yaml:"-" env:"PICOCLAW_CHANNELS_WHATSAPP_USE_NATIVE"`
|
||||||
SessionStorePath string `json:"session_store_path" yaml:"-" env:"PICOCLAW_CHANNELS_WHATSAPP_SESSION_STORE_PATH"`
|
SessionStorePath string `json:"session_store_path" yaml:"-" env:"PICOCLAW_CHANNELS_WHATSAPP_SESSION_STORE_PATH"`
|
||||||
AllowFrom FlexibleStringSlice `json:"allow_from" yaml:"-" env:"PICOCLAW_CHANNELS_WHATSAPP_ALLOW_FROM"`
|
AllowFrom FlexibleStringSlice `json:"allow_from" yaml:"-" env:"PICOCLAW_CHANNELS_WHATSAPP_ALLOW_FROM"`
|
||||||
GroupTrigger GroupTriggerConfig `json:"group_trigger,omitempty" yaml:"-"`
|
GroupTrigger GroupTriggerConfig `json:"group_trigger,omitempty" yaml:"-"`
|
||||||
ReasoningChannelID string `json:"reasoning_channel_id" yaml:"-" env:"PICOCLAW_CHANNELS_WHATSAPP_REASONING_CHANNEL_ID"`
|
ReasoningChannelID string `json:"reasoning_channel_id" yaml:"-" env:"PICOCLAW_CHANNELS_WHATSAPP_REASONING_CHANNEL_ID"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type TelegramConfig struct {
|
type TelegramConfig struct {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue