Commit graph

740 commits

Author SHA1 Message Date
afjcjsbx
e667100117 Merge remote-tracking branch 'origin/main' into feat/echo-voice-audio-transcription
# Conflicts:
#	pkg/channels/telegram/telegram.go
#	pkg/config/config.go
#	pkg/config/defaults.go
2026-03-11 00:06:37 +01:00
Mauro
6645cc82ab Merge pull request #1207 from afjcjsbx/feat/debug-mode-no-truncate
feat: no-truncate param for debug
2026-03-10 17:13:44 +01:00
美電球
c207ee4ee8 Merge pull request #1291 from statxc/feat/telegram-forum-topics
feat(telegram): support forum topics with per-topic session isolation
2026-03-10 21:38:40 +08:00
statxc
c9d27a96a1 fix: Add IsForum check so only forum topic threads get session isolation, not regular group reply threads 2026-03-10 13:25:14 +00:00
lxowalle
8d890a682e feat:Modify the location where version is obtained, and insert version information into the context (#1300)
* feat:migrate version info from internal package to pkg/config

* * fix lint issue
2026-03-10 17:42:05 +08:00
yanhool
976b7f9f28 feat(web_search): add load balance and failover for api keys (#982)
* feat(web_search): add load balance and failover for api keys

* feat(web_search): add load balance and failover for api keys

* lint

* new iter to get api key

* deleted conflicts
2026-03-10 19:34:11 +11:00
is-Xiaoen
ba7c41d16f feat(session): integrate JSONL persistence into agent loop (#1170)
* feat(session): add SessionStore interface and JSONL backend adapter

Extract a SessionStore interface from the methods the agent loop uses
(AddMessage, GetHistory, SetSummary, TruncateHistory, Save, etc.).
Both SessionManager and the new JSONLBackend satisfy this interface,
allowing the persistence layer to be swapped transparently.

JSONLBackend wraps memory.Store and maps its error-returning API to
the fire-and-forget contract that the agent loop expects — write
errors are logged, reads return empty defaults on failure. Save()
triggers compaction to reclaim space after logical truncation.

Part of #1169

* test(session): add JSONLBackend integration tests

8 tests covering the full SessionStore contract through the JSONL
backend: message roundtrip, tool calls, summary, truncation with
compaction, history replacement, empty sessions, session isolation,
and the complete summarization flow (SetSummary → TruncateHistory →
Save).

Includes compile-time interface satisfaction checks for both
SessionManager and JSONLBackend.

Part of #1169

* feat(agent): wire JSONL session store into agent loop

Replace the concrete *SessionManager field with the SessionStore
interface and initialize the JSONL backend by default. Legacy .json
session files are auto-migrated on first startup. Falls back to
SessionManager if the JSONL store cannot be initialized.

The agent loop code (loop.go) requires zero changes — all method
calls work identically through the interface.

Closes #1169

* fix(session): propagate compact error from Save

Save() was swallowing the error returned by Compact and always
returning nil. Callers checking Save's return value would never
see a compaction failure. Return the error directly so the agent
loop can log or handle it as needed.

* feat(session): add Close to SessionStore interface

Add Close() error to SessionStore so callers can release resources
through the interface. JSONLBackend already had Close; this adds
a no-op implementation to SessionManager for compatibility.

* fix(session): close session stores on shutdown and harden migration

- Add Close() to AgentInstance, AgentRegistry, and AgentLoop so JSONL
  file handles are released during gateway shutdown and CLI exit.
- Fall back to SessionManager when migration fails, preventing a split
  state where some sessions live in JSONL and others remain in JSON.
- Add defer agentLoop.Close() in the CLI agent command path.
- Document SessionStore interface methods (fire-and-forget contract).
2026-03-10 15:14:09 +08:00
statxc
b3be7d835d fix: solve Lint errors 2026-03-10 04:22:00 +00:00
美電球
972eca6a43 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
statxc
b3b7f5b2c6 feat(telegram): support forum topics with per-topic session isolation 2026-03-10 02:54:10 +00:00
afjcjsbx
33df545b2d fix typo 2026-03-09 23:56:59 +01:00
Mauro
60a9310fd0 feat(mcp): tool search tools (#1243)
* feat(mcp): tool search tools

* removed unused call_discovered_tool

* improvements and optimizations

* fix gate mcp enabled

* fix TOCTOU race BM25 cache version check

* fix encapsulation bypass on registry internals

* safety comment on TickTTL

* added more unit tests

* enhanced logs
2026-03-09 18:21:49 +01:00
Meng Zhuo
3cf3a06334 chore: drop unnessary crypto/rand (#1267) 2026-03-09 22:45:01 +08:00
Meng Zhuo
dd9862edb9 Merge pull request #1107 from afjcjsbx/fix/deny-reading-binary-files
fix(tool) prevent read huge files in tool
2026-03-09 22:11:27 +08:00
lxowalle
b2da297612 * add minimax provider (#1273) 2026-03-09 18:43:58 +08:00
afjcjsbx
f9f54df719 sync sendmessage function 2026-03-09 11:38:23 +01:00
afjcjsbx
dd3db349b9 fix lint 2026-03-09 11:02:31 +01:00
lxowalle
83c9822165 feat: add /clear command to clear chat history (#1266)
* * add clear command to clear chat history

* check nil

* * update comment
2026-03-09 16:39:33 +08:00
afjcjsbx
5a10528400 refined code 2026-03-09 09:32:21 +01:00
lxowalle
5e81d868b2 fix: retryLLM return empty (#1264) 2026-03-09 14:39:26 +08:00
lxowalle
cecd7eaefc Fix: improve history compression with retry logic and multi-byte character support (#1167)
* first commit

* Reduce retry wait time to 100ms

* * Add incremental delay and modify the context truncation logic
2026-03-09 13:41:41 +08:00
afjcjsbx
a83951a931 Merge remote-tracking branch 'refs/remotes/origin/main' into fix/deny-reading-binary-files 2026-03-09 00:30:37 +01:00
afjcjsbx
43e6e04c09 Removed the old heavy logic 2026-03-08 18:22:15 +01:00
afjcjsbx
a073755568 fix empty strings on failed transcription 2026-03-08 18:00:02 +01:00
afjcjsbx
9422dc8527 telegram reply only on first message 2026-03-08 17:57:43 +01:00
afjcjsbx
f0110fc77d fixed double message on slack thread 2026-03-08 17:41:53 +01:00
美電球
f7ffaa0ee5 Merge pull request #1171 from mutezebra/feat/feishu-random-emoji-v2
feat(feishu): add random reaction emoji config
2026-03-08 23:47:45 +08:00
美電球
ac2c326971 Merge pull request #1220 from horsley/feat/matrix-channel-support
feat: add Matrix channel support
2026-03-08 22:58:16 +08:00
horsley
02b0d2fac5 fix(matrix): satisfy golines in mention regex test 2026-03-08 10:53:45 +00:00
mutezebra
9f1000b38f chore(config): gofmt 格式化 FeishuConfig 字段对齐 2026-03-08 17:32:24 +08:00
mutezebra
ac404b7b1f fix(feishu): 用 crypto/rand 选择随机表情并修正示例配置 2026-03-08 17:30:50 +08:00
horsley
0965380f2a fix(matrix): bound room cache and align temp media dir 2026-03-08 09:23:02 +00:00
horsley
0897c834b4 fix(ci): resolve linter and security check failures 2026-03-08 08:06:28 +00:00
mutezebra
4f6bad0239 Merge upstream/main and resolve conflicts in .env.example 2026-03-08 15:32:11 +08:00
Meng Zhuo
71ba68ff05 Merge pull request #1100 from zihan987/main
feat: add Vivgrid provider support
2026-03-08 11:03:13 +08:00
horsley
b0a541aa4c fix(matrix): improve group mention detection 2026-03-07 18:05:09 +00:00
afjcjsbx
994cc23d4d resolve conflicts 2026-03-07 18:56:38 +01:00
afjcjsbx
b27bf5418c Merge remote-tracking branch 'origin/main' into feat/echo-voice-audio-transcription
# Conflicts:
#	pkg/channels/telegram/telegram.go
2026-03-07 18:55:32 +01:00
afjcjsbx
8ed26a5547 slack reply message with audio transcription 2026-03-07 18:47:22 +01:00
horsley
ff022341ba feat: add Matrix channel support 2026-03-07 17:44:24 +00:00
zihan987
5e0aacfcbe Fix Vivgrid docs and inference logic 2026-03-07 09:20:56 -08:00
美電球
05fd3af7dd Merge pull request #935 from putueddy/feat/telegram-chunking
feat: add message chunking in Telegram Send method
2026-03-07 23:47:06 +08:00
afjcjsbx
49487350e4 fix lint 2026-03-07 16:45:21 +01:00
afjcjsbx
a9e13bb598 unit test placeholder logic 2026-03-07 16:40:26 +01:00
afjcjsbx
bf5cfcce57 fix lint 2026-03-07 16:24:49 +01:00
afjcjsbx
2b8d794847 discord reply message on transcript echo 2026-03-07 16:18:53 +01:00
I Putu Eddy Irawan
2037e4e09c fix: remove redundant SplitMessage in Send() per review feedback
WithMaxMessageLength(4000) already ensures msg.Content ≤ 4000 chars
before reaching Send(), making the SplitMessage call redundant.
The HTML expansion safety net (re-split when >4096 after conversion)
is still preserved.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 22:01:04 +07:00
afjcjsbx
f97ebfedd0 feat(channel): echo voice audio transcription 2026-03-07 15:49:33 +01:00
Hua Audio
75c46e84e8 feat(agent) fallback to reasoning content (#992) 2026-03-07 14:17:33 +01:00
Meng Zhuo
e39d741148 Merge pull request #1138 from amirmamaghani/feat/irc-channel
feat(channels): add IRC channel integration
2026-03-07 20:25:26 +08:00