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:
sushi30 2026-03-29 22:52:37 +02:00 committed by github-actions[bot]
parent 3bd90a2212
commit 556d236c46
5 changed files with 37 additions and 9 deletions

View file

@ -95,6 +95,9 @@
"proxy": "",
"allow_from": ["YOUR_USER_ID"],
"use_markdown_v2": false,
"group_trigger": {
"mention_only": true
},
"reasoning_channel_id": "",
"streaming": {
"enabled": true
@ -115,6 +118,9 @@
"app_id": "YOUR_QQ_APP_ID",
"app_secret": "YOUR_QQ_APP_SECRET",
"allow_from": [],
"group_trigger": {
"mention_only": true
},
"reasoning_channel_id": ""
},
"maixcam": {
@ -130,6 +136,9 @@
"use_native": false,
"session_store_path": "",
"allow_from": [],
"group_trigger": {
"mention_only": false
},
"reasoning_channel_id": ""
},
"feishu": {
@ -139,6 +148,9 @@
"encrypt_key": "",
"verification_token": "",
"allow_from": [],
"group_trigger": {
"mention_only": true
},
"placeholder": {
"enabled": true,
"text": ["Thinking...", "Processing...", "Typing..."]
@ -152,6 +164,9 @@
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"allow_from": [],
"group_trigger": {
"mention_only": true
},
"reasoning_channel_id": ""
},
"slack": {
@ -159,6 +174,9 @@
"bot_token": "xoxb-YOUR-BOT-TOKEN",
"app_token": "xapp-YOUR-APP-TOKEN",
"allow_from": [],
"group_trigger": {
"mention_only": true
},
"reasoning_channel_id": ""
},
"matrix": {
@ -186,6 +204,9 @@
"channel_access_token": "YOUR_LINE_CHANNEL_ACCESS_TOKEN",
"webhook_path": "/webhook/line",
"allow_from": [],
"group_trigger": {
"mention_only": true
},
"reasoning_channel_id": ""
},
"onebot": {
@ -195,6 +216,9 @@
"reconnect_interval": 5,
"group_trigger_prefix": [],
"allow_from": [],
"group_trigger": {
"mention_only": true
},
"reasoning_channel_id": ""
},
"wecom": {

View file

@ -1448,7 +1448,7 @@ func (al *AgentLoop) observeMessage(ctx context.Context, msg bus.InboundMessage)
"channel": msg.Channel,
"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)

View file

@ -367,7 +367,9 @@ func (c *LINEChannel) processEvent(event lineEvent) {
"platform": "line",
"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
}
content = cleaned

View file

@ -728,7 +728,9 @@ func (c *MatrixChannel) handleMessageEvent(ctx context.Context, evt *event.Event
"room_id": roomID,
"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
}
content = cleaned

View file

@ -353,13 +353,13 @@ type StreamingConfig struct {
}
type WhatsAppConfig struct {
Enabled bool `json:"enabled" yaml:"-" env:"PICOCLAW_CHANNELS_WHATSAPP_ENABLED"`
BridgeURL string `json:"bridge_url" yaml:"-" env:"PICOCLAW_CHANNELS_WHATSAPP_BRIDGE_URL"`
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"`
AllowFrom FlexibleStringSlice `json:"allow_from" yaml:"-" env:"PICOCLAW_CHANNELS_WHATSAPP_ALLOW_FROM"`
Enabled bool `json:"enabled" yaml:"-" env:"PICOCLAW_CHANNELS_WHATSAPP_ENABLED"`
BridgeURL string `json:"bridge_url" yaml:"-" env:"PICOCLAW_CHANNELS_WHATSAPP_BRIDGE_URL"`
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"`
AllowFrom FlexibleStringSlice `json:"allow_from" yaml:"-" env:"PICOCLAW_CHANNELS_WHATSAPP_ALLOW_FROM"`
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 {