picoclaw/pkg
美電球 2312553286
feat(channels): enhance QQ channel with group/typing/media support and URL sanitization (#1208)
* feat(channels): enhance QQ channel with group support, typing, media, and URL sanitization

Add group message routing alongside existing C2C (direct) support using
chatType sync.Map to track whether a chatID is group or direct. Implement
passive reply with msg_id/msg_seq tracking for multi-part responses.

Add StartTyping (InputNotify msg_type=6 with periodic resend), SendMedia
(RichMediaMessage for HTTP/HTTPS URLs), and configurable Markdown message
support. Replace unbounded dedup map with TTL-based expiry and janitor
goroutine.

Sanitize URLs in group messages by replacing dots in domains with fullwidth
period to avoid QQ's URL blacklist rejection (error 40054010). Add rate
limit config (5 msg/s) and MaxMessageLength/SendMarkdown config fields.

* fix(channels): address review feedback on QQ channel implementation

- Fix goroutine leak: reinitialize done channel and sync.Once in Start()
  to prevent multiple janitor goroutines on restart
- Fix double-close panic: guard close(done) with sync.Once in Stop()
- Fix StartTyping context: use c.ctx (channel lifecycle) instead of
  caller's ctx (request lifecycle) for typing goroutine
- Refactor: extract getChatKind() helper to deduplicate chatType lookup
  across Send(), StartTyping(), and SendMedia()
- Fix: use new(atomic.Uint64) instead of taking address of local var
- Fix: require explicit http(s):// scheme in URL regex to avoid false
  positives on version strings like "1.2.3"
- Optimize: collect expired keys before deleting in dedupJanitor to
  reduce lock hold time
- Fix: remove MaxMessageLength zero-value override in NewQQChannel
  since defaults.go already sets 2000

* fix(channels): address second round of review feedback on QQ channel

- Fix SendMedia: bypass media store for direct http(s) URLs in part.Ref;
  only fall back to store.Resolve for media:// refs; log clear warning
  for local-only paths instead of silently skipping
- Fix chatType routing: default unknown chatIDs to "group" (safer for QQ
  since outbound-only destinations like reasoning_channel_id are groups);
  pre-register reasoning_channel_id as group at Start() time; add debug
  log for untracked chatIDs
- Add dedup hard cap (10000 entries): evict oldest entry when map
  exceeds capacity to prevent unbounded memory growth under high traffic
2026-03-10 12:07:02 +08:00
..
agent feat(mcp): tool search tools (#1243) 2026-03-09 18:21:49 +01:00
auth feat(auth): add Anthropic OAuth setup-token login (#926) 2026-03-06 19:58:23 +08:00
bus chore: resolve conflicts with upstream/main 2026-02-28 12:21:54 +08:00
channels feat(channels): enhance QQ channel with group/typing/media support and URL sanitization (#1208) 2026-03-10 12:07:02 +08:00
commands feat: add /clear command to clear chat history (#1266) 2026-03-09 16:39:33 +08:00
config feat(channels): enhance QQ channel with group/typing/media support and URL sanitization (#1208) 2026-03-10 12:07:02 +08:00
constants refactor: replace bool map with set-style map for internal channels (#472) 2026-02-19 11:48:17 +01:00
cron feat(cron): add execution lifecycle logging (#1185) 2026-03-06 20:46:52 +08:00
devices refactor: cleanup dead code and turn on dead code detection in CI (#515) 2026-02-24 21:52:25 +08:00
fileutil refactor(pkg): move atomic file write to dedicated fileutil package 2026-02-24 23:57:13 +08:00
health chore: resolve conflicts with upstream/main 2026-02-28 12:21:54 +08:00
heartbeat enable dupl check 2026-03-01 18:17:32 +11:00
identity feat(identity): add unified user identity with canonical platform:id format 2026-02-23 06:56:48 +08:00
logger enable prealloc 2026-02-25 21:31:07 +11:00
mcp Feat/add tool enable or disable configuration (#1071) 2026-03-05 14:53:26 +08:00
media chore: resolve conflicts with upstream/main 2026-02-28 12:21:54 +08:00
memory fix(memory): fsync appended message for consistent durability 2026-03-04 19:21:34 +08:00
migrate feat: add Matrix channel support 2026-03-07 17:44:24 +00:00
providers * add minimax provider (#1273) 2026-03-09 18:43:58 +08:00
routing fix(routing): address review feedback on CJK estimation and observability 2026-03-06 13:10:20 +08:00
session feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
skills refactor(skills): reuse shared HTTP retry helper 2026-03-05 19:10:36 +08:00
state fix: error check on state (#864) 2026-03-02 11:59:26 +11:00
tools feat(mcp): tool search tools (#1243) 2026-03-09 18:21:49 +01:00
utils feat(mcp): tool search tools (#1243) 2026-03-09 18:21:49 +01:00
voice Fix lint 2026-03-04 10:21:59 +00:00