Compare commits

..

225 Commits

Author SHA1 Message Date
Tak Hoffman
ace3068fe3 docs: fix active memory gateway command 2026-04-10 23:01:11 -05:00
Tak Hoffman
1fb8a8cdff fix: prefer target entry for inline command dispatch 2026-04-10 21:22:58 -05:00
Peter Steinberger
3b6fac85ea chore: prepare 2026.4.10 release 2026-04-11 03:22:18 +01:00
Tak Hoffman
8f94032dc1 fix: prefer target entry for inline abort cutoff 2026-04-10 21:20:53 -05:00
Tak Hoffman
f1b6934700 fix: prefer target entry for reply directives 2026-04-10 21:18:29 -05:00
Balaji Siva
efab9763dc Fix vLLM reasoning model response parsing (empty tool_calls array) (#61534)
Merged via squash.

Prepared head SHA: dfe6a3581c
Co-authored-by: balajisiva <13068516+balajisiva@users.noreply.github.com>
Co-authored-by: scoootscooob <167050519+scoootscooob@users.noreply.github.com>
Reviewed-by: @scoootscooob
2026-04-10 19:14:48 -07:00
Tak Hoffman
4360a59c6d fix: prefer target entry for usage footer 2026-04-10 21:12:11 -05:00
Vincent Koc
db546f8d33 test(auto-reply): update compaction result fixture 2026-04-11 03:10:59 +01:00
Tak Hoffman
f6f81960f3 fix: prefer target entry for fast status 2026-04-10 21:10:23 -05:00
Peter Steinberger
1c7444dab6 perf: optimize test import surfaces 2026-04-11 03:08:58 +01:00
Tak Hoffman
84fb20aa52 fix: prefer target entry for inline status 2026-04-10 21:08:03 -05:00
Peter Steinberger
da1e60a6aa fix(ci): guard venice model discovery fetch 2026-04-11 03:07:48 +01:00
Tak Hoffman
ef5b257c30 fix: prefer target entry for tools wrapper 2026-04-10 21:05:46 -05:00
Tak Hoffman
2fe860b803 fix: prefer target entry for status wrapper 2026-04-10 21:04:01 -05:00
Tak Hoffman
e5e95f30ea fix: prefer target entry for compact counters 2026-04-10 21:01:40 -05:00
Peter Steinberger
fb5611b0c4 fix(ci): omit default config write type args 2026-04-11 03:01:03 +01:00
Tak Hoffman
78a4b0e8d3 fix: keep stop hook aligned with target session 2026-04-10 20:59:20 -05:00
Peter Steinberger
07edaffb04 fix: finalize OpenAI replay liveness landing 2026-04-11 02:58:31 +01:00
Peter Steinberger
8a5b4b07f9 fix(openai): suppress expected tool schema diagnostics 2026-04-11 02:58:04 +01:00
Peter Steinberger
c3aeb71f74 feat(fal): add HeyGen video-agent model 2026-04-11 02:58:04 +01:00
Peter Steinberger
c40d2a424d fix(ci): complete compact session fixture 2026-04-11 02:56:02 +01:00
Peter Steinberger
c88a3d5152 fix(ci): restore split seam type exports 2026-04-11 02:56:02 +01:00
Peter Steinberger
94a90fcb85 test(ci): retry canvas auth reset fetches 2026-04-11 02:55:35 +01:00
Tak Hoffman
ecb10c1de9 fix: prefer requester key for subagent info 2026-04-10 20:55:18 -05:00
Coy Geek
192ee081e7 fix: Implicit latest-device approval can pair the wrong requester (#64160)
* fix: require confirmation before implicit device approval

Keep re-requested pairing entries from jumping the queue and force operators to confirm implicit latest-request approval so a refreshed attacker request cannot be silently approved.

* fix: require exact device pairing approval

* fix: stabilize reply CI checks

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-04-11 02:55:01 +01:00
Peter Steinberger
f2065a7651 test: skip unneeded thinking resolution 2026-04-11 02:53:14 +01:00
Tak Hoffman
daccfa2152 fix: prefer target entry for subagent spawn 2026-04-10 20:52:52 -05:00
Peter Steinberger
9d63e54e33 test: mock mcp config command storage 2026-04-11 02:51:09 +01:00
Tak Hoffman
9403008c6c fix: prefer target entry for reset hooks 2026-04-10 20:50:52 -05:00
Tak Hoffman
f5d0b54563 fix: prefer target entry for btw command 2026-04-10 20:49:28 -05:00
Vincent Koc
8ae6d42faa fix(agents): respect overridden home for personal skills 2026-04-11 02:48:36 +01:00
Tak Hoffman
1e4036a2f1 fix: prefer target entry for compact command 2026-04-10 20:47:44 -05:00
Vincent Koc
7198a9f0ee fix(cycles): reduce remaining static import seams 2026-04-11 02:46:41 +01:00
Vincent Koc
350299401f fix(cycles): continue shared seam extraction 2026-04-11 02:46:41 +01:00
Vincent Koc
81235fd923 fix(cycles): split shared contract seams 2026-04-11 02:46:40 +01:00
Vincent Koc
95bc417944 fix(cycles): split residual shared type seams 2026-04-11 02:46:40 +01:00
Peter Steinberger
707cc315cc test: avoid context discovery in fast unit tests 2026-04-11 02:46:13 +01:00
Tak Hoffman
58020ab759 fix: prefer target entry for models command 2026-04-10 20:45:58 -05:00
Peter Steinberger
efbab8ff8c docs: reshuffle unreleased changelog 2026-04-11 02:45:48 +01:00
Tak Hoffman
c2f6ad9b38 fix: prefer target entry for command system prompt 2026-04-10 20:44:27 -05:00
Tak Hoffman
42a4dee8b6 fix: prefer target entry for plugin commands 2026-04-10 20:42:19 -05:00
Peter Steinberger
569751898f fix: route gateway plugin logs through plugins 2026-04-11 02:40:46 +01:00
Peter Steinberger
69244f837f test: speed provider retry imports 2026-04-11 02:37:51 +01:00
Peter Steinberger
25f56eb317 fix(ci): mock default fs export in session export test 2026-04-11 02:36:53 +01:00
Peter Steinberger
32a25b865f fix: summarize provider tool schema diagnostics 2026-04-11 02:35:13 +01:00
Peter Steinberger
0e56140dba test(auto-reply): align rebase type fixes 2026-04-11 02:30:31 +01:00
Peter Steinberger
bb70a59b36 test(auto-reply): keep model list coverage focused 2026-04-11 02:30:07 +01:00
Peter Steinberger
54cb10e79a test(auto-reply): move directive event coverage lower 2026-04-11 02:30:07 +01:00
Peter Steinberger
48a66a647d test(auto-reply): reduce directive behavior imports 2026-04-11 02:30:07 +01:00
Peter Steinberger
541f768249 fix(ci): align context and plugin loader tests 2026-04-11 02:28:58 +01:00
sudie-codes
0f19271092 msteams: add message actions — pin, unpin, read, react, reactions (#53432)
* msteams: add pin/unpin, list-pins, and read message actions

Wire up Graph API endpoints for message read, pin, unpin, and list-pins
in the MS Teams extension, following the same patterns as edit/delete.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* msteams: address PR review comments for pin/unpin/read actions

- Handle 204 No Content in postGraphJson (Graph mutations may return empty body)
- Strip conversation:/user: prefixes in resolveConversationPath to avoid Graph 404s
- Remove dead variable in channel pin branch
- Rename unpin param from messageId to pinnedMessageId for semantic clarity
- Accept both pinnedMessageId and messageId in unpin action handler for compat

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* msteams: resolve user targets + add User-Agent to Graph helpers

- Resolve user:<aadId> targets to actual conversation IDs via conversation
  store before Graph API calls (fixes 404 for DM-context actions)
- Add User-Agent header to postGraphJson/deleteGraphRequest for consistency
  with fetchGraphJson after rebase onto main

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* msteams: resolve DM targets to Graph chat IDs + expose pin IDs

- Prefer cached graphChatId over Bot Framework conversation IDs for user
  targets; throw descriptive error when no Graph-compatible ID is available
- Add `id` field to list-pins rows so default formatters surface the pinned
  resource ID needed for the unpin flow

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* msteams: add react and reactions (list) message actions

* msteams: fix reaction count undercount and remove unpin messageId fallback

* msteams: wire pinnedMessageId through CLI/tool schema, add channel pin beta warnings, add list-pins pagination

* msteams: address PR #53432 remaining review feedback

* fix(msteams): route channel actions via teamId/channelId path (#53432)

* msteams: add unpin pinnedMessageId test coverage (#53432)

* fix(msteams): keep graph routing scoped to graph actions

* fix(msteams): align graph routing context types

* msteams: route fetchGraphAbsoluteUrl through fetchWithSsrFGuard

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Brad Groux <3053586+BradGroux@users.noreply.github.com>
2026-04-10 20:25:57 -05:00
Peter Steinberger
6c574d726b fix(ci): align model list session metadata 2026-04-11 02:24:31 +01:00
Tak Hoffman
7e7a269ad1 fix: prefer target entry for send policy 2026-04-10 20:23:38 -05:00
Tak Hoffman
831386bd60 fix: use target session entry for usage cost 2026-04-10 20:21:28 -05:00
Tak Hoffman
07232b90c9 fix: prefer target session data for context report 2026-04-10 20:19:28 -05:00
Peter Steinberger
b56cd114e7 feat: add Seedance 2 fal video models 2026-04-11 02:18:31 +01:00
Peter Steinberger
21dfea837c fix: list loaded plugins in gateway ready log 2026-04-11 02:17:40 +01:00
Peter Steinberger
dc008f956c fix: preserve configured plugins in allowlist 2026-04-11 02:17:39 +01:00
Peter Steinberger
202f80792e feat: add plugin text transforms 2026-04-11 02:17:39 +01:00
Tak Hoffman
a2dbc1b63c fix: use target session entry for export 2026-04-10 20:17:06 -05:00
Peter Steinberger
343541217a test(ci): align btw session agent assertion 2026-04-11 02:15:25 +01:00
Peter Steinberger
7e28bd23ae fix(ci): stabilize auto reply and agentic tests 2026-04-11 02:15:25 +01:00
Peter Steinberger
39d1a817fa lint: enable small oxlint rules 2026-04-11 02:15:21 +01:00
Tak Hoffman
ce87edbad4 fix: preserve agent context for legacy model list 2026-04-10 20:14:49 -05:00
Tak Hoffman
3182dac7b1 fix: preserve inline status store path 2026-04-10 20:12:47 -05:00
Peter Steinberger
60b61288c4 test: fix cron and binding stability 2026-04-11 02:10:47 +01:00
Tak Hoffman
70cfdc890b fix: preserve status store path in info wrapper 2026-04-10 20:10:22 -05:00
Tak Hoffman
dcf49fa5d8 fix: use target agent dir for btw command 2026-04-10 20:06:47 -05:00
Tak Hoffman
29018b4af5 fix: use target agent dir for compact command 2026-04-10 20:04:35 -05:00
Tak Hoffman
aaec5c3283 fix: use target agent dir for directive persistence 2026-04-10 20:02:09 -05:00
Peter Steinberger
dbe4cf24a5 fix(ci): guard compact agent directory resolution 2026-04-11 02:01:01 +01:00
Peter Steinberger
4c74c0db18 fix(ci): satisfy strict agent model types 2026-04-11 01:59:17 +01:00
Tak Hoffman
bef2fde77f fix: use target agent dir for compaction 2026-04-10 19:56:40 -05:00
Peter Steinberger
a775051ac6 fix(ci): tolerate doctor preview wording variants 2026-04-11 01:55:04 +01:00
Tak Hoffman
187449d149 fix: disambiguate persisted agent binding keys 2026-04-10 19:52:49 -05:00
Peter Steinberger
0bd008ca83 refactor: reduce redaction type assertions 2026-04-11 01:52:29 +01:00
Tak Hoffman
0c0cb1a3c0 Prefer active store path for session export 2026-04-10 19:52:14 -05:00
Tak Hoffman
de74d843f5 fix: use target agent for models wrapper 2026-04-10 19:51:32 -05:00
Peter Steinberger
edb8f52c07 style: apply oxfmt updates 2026-04-11 01:50:19 +01:00
Peter Steinberger
bbdcf2963b refactor: reduce unsafe assertions in secrets 2026-04-11 01:50:19 +01:00
Tak Hoffman
4ba3ea30b0 Avoid stale agentDir in tools sessions 2026-04-10 19:49:20 -05:00
Tak Hoffman
9b95d65ea2 fix: use target agent for bash wrapper 2026-04-10 19:48:39 -05:00
Tak Hoffman
a46606924f Use session agent for btw fallback dir 2026-04-10 19:46:50 -05:00
Tak Hoffman
562025f8dc fix: disambiguate device-pair notify subscribers 2026-04-10 19:46:23 -05:00
Peter Steinberger
85c7748520 lint: enable no extraneous class 2026-04-11 01:45:06 +01:00
Peter Steinberger
c254ebfbef fix(ci): align protocol and cron gates 2026-04-11 01:44:36 +01:00
Vincent Koc
d014567246 Update INCIDENT_RESPONSE.md 2026-04-11 01:43:58 +01:00
Tak Hoffman
133b90d5c5 Use session agent for compact session files 2026-04-10 19:43:44 -05:00
Peter Steinberger
761b71e268 refactor: consolidate embedded replay state 2026-04-11 01:40:23 +01:00
Tak Hoffman
9ec0dc7ac5 fix: avoid qqbot session file key collisions 2026-04-10 19:40:18 -05:00
Tak Hoffman
24ac5ddf7f fix: normalize bound delivery binding matches 2026-04-10 19:40:18 -05:00
Tak Hoffman
957171b2e0 fix: normalize focused binding conversation ids 2026-04-10 19:40:18 -05:00
Tak Hoffman
754aaa2670 fix: normalize binding context restore ids 2026-04-10 19:40:17 -05:00
Peter Steinberger
7d3062270c lint: enable unnecessary type conversion rule 2026-04-11 01:38:44 +01:00
Peter Steinberger
3e80bd33e4 refactor: simplify extension conversions 2026-04-11 01:37:23 +01:00
Peter Steinberger
780e0898b0 test: simplify typed conversions 2026-04-11 01:34:25 +01:00
Peter Steinberger
d41f3d6eb6 fix(ci): type usage command cost mocks 2026-04-11 01:31:54 +01:00
Peter Steinberger
d46d0d070a fix(ci): guard routed reply runtime 2026-04-11 01:30:09 +01:00
Tak Hoffman
a77f76b4d0 fix: normalize subagent registry session keys 2026-04-10 19:29:41 -05:00
Tak Hoffman
d369dbe65c fix: use target agent for session cost usage 2026-04-10 19:29:40 -05:00
Tak Hoffman
a3b047b5fc Preserve Discord lifecycle windows on rebind 2026-04-10 19:29:29 -05:00
Tak Hoffman
32ad88da98 fix: avoid teams sso token key collisions 2026-04-10 19:29:09 -05:00
Peter Steinberger
1fb2e18f47 refactor: simplify cli conversions 2026-04-11 01:27:48 +01:00
Peter Steinberger
5c0d1c6a40 fix: guard routed reply runtime narrowing 2026-04-11 01:27:31 +01:00
Peter Steinberger
ab687f4637 fix: harden OpenAI tool replay compatibility 2026-04-11 01:27:31 +01:00
Eva
f9a5e0a64f test(replay): assert abandoned state after compaction retry 2026-04-11 01:27:31 +01:00
Eva
7f54cf73e2 fix(replay): preserve invalid state across compaction retries 2026-04-11 01:27:31 +01:00
Eva
eb185f4a03 fix(retry): preserve replay metadata on retry exhaustion 2026-04-11 01:27:31 +01:00
Eva
b9a9472cfd fix: preserve replay invalid on mutating retries 2026-04-11 01:27:31 +01:00
Eva
6b100ca559 agents: preserve replay invalid lifecycle truth 2026-04-11 01:27:31 +01:00
Eva
fc132acfc4 agents: fix replay liveness follow-up regressions 2026-04-11 01:27:31 +01:00
Eva
f65ffdff96 agents: address execution correctness review fixes 2026-04-11 01:27:31 +01:00
Eva
aa5bec4bdf fix: surface replay and liveness state 2026-04-11 01:27:31 +01:00
Eva
1038c1b8f3 test: keep provider family inventory stable 2026-04-11 01:27:31 +01:00
Eva
4a20e9f257 fix: preserve openai properties maps 2026-04-11 01:27:31 +01:00
Eva
626eaf8496 test: align openai shared-family inventory 2026-04-11 01:27:31 +01:00
Eva
6aa63b4fdd agents: add openai provider-owned tool compat 2026-04-11 01:27:31 +01:00
Tak Hoffman
13337d7048 fix: preserve task registry task kinds 2026-04-10 19:24:17 -05:00
Peter Steinberger
9e0d358695 refactor: simplify runtime conversions 2026-04-11 01:23:34 +01:00
Peter Steinberger
37b91be894 fix(ci): reset BlueBubbles binding adapter fixtures 2026-04-11 01:21:59 +01:00
Peter Steinberger
950ecd30ec test: stabilize media and contract shards 2026-04-11 01:21:52 +01:00
Tak Hoffman
99fc830b73 fix: preserve disabled cron jobs on restore 2026-04-10 19:20:10 -05:00
Tak Hoffman
2a57127e52 Preserve Discord binding metadata on rebind 2026-04-10 19:20:10 -05:00
Tak Hoffman
b2475884fd Preserve Discord binding metadata on rebind 2026-04-10 19:19:53 -05:00
Peter Steinberger
fe6341f702 test: widen auto-reply full access timeout (#64439) (thanks @100yenadmin) 2026-04-11 01:19:32 +01:00
Peter Steinberger
55578a5c40 fix: stabilize Codex runtime truthfulness (#64439) (thanks @100yenadmin) 2026-04-11 01:19:32 +01:00
Eva
d744073d67 fix(errors): narrow proxy transport detection 2026-04-11 01:19:32 +01:00
Eva
b4fdd9c495 fix(runtime): tighten auth-scope and full-access hints 2026-04-11 01:19:32 +01:00
Eva
756d715ce0 test(oauth): cover slash-terminated authorize urls 2026-04-11 01:19:32 +01:00
Eva
4c0eb14985 fix: address remaining runtime truthfulness review 2026-04-11 01:19:32 +01:00
Eva
0ff47c8720 tests: preserve session-key exports in media-only mock 2026-04-11 01:19:32 +01:00
Eva
9f476107ea agents: keep full-access truth for host runs 2026-04-11 01:19:32 +01:00
Eva
dba2e189e7 tests: keep session-key mock aligned with agent defaults 2026-04-11 01:19:32 +01:00
Eva
ef8281b018 agents: address runtime truthfulness review fixes 2026-04-11 01:19:32 +01:00
Eva
6757f78662 test: align full-access sandbox info expectation 2026-04-11 01:19:32 +01:00
Eva
b78d9df90e fix: keep commands prompt full-access aware 2026-04-11 01:19:32 +01:00
Eva
aed57c95ec fix: make elevated full truthful 2026-04-11 01:19:32 +01:00
Eva
551b6a61e6 fix: export provider runtime failure kind type 2026-04-11 01:19:32 +01:00
Eva
9ec96f476d openai-codex: polish auth review fixes 2026-04-11 01:19:32 +01:00
Eva
0b02b5abd2 openai-codex: gate scope failures to codex 2026-04-11 01:19:32 +01:00
Eva
8166d592d9 openai-codex: classify auth and runtime failures 2026-04-11 01:19:32 +01:00
Peter Steinberger
776c8e037e perf: avoid heavy reply runtime imports 2026-04-11 01:18:11 +01:00
Peter Steinberger
b146c0c26b perf: skip bundled session fallback on hot paths 2026-04-11 01:18:11 +01:00
Peter Steinberger
7392060c3f perf: narrow config test imports 2026-04-11 01:18:10 +01:00
Peter Steinberger
d44cd0d452 style: apply oxformat cleanup 2026-04-11 01:17:51 +01:00
Peter Steinberger
d85b2a0e81 refactor: simplify core conversions 2026-04-11 01:17:51 +01:00
Gustavo Madeira Santana
00837f05bf qa-lab: drain Matrix sync batch before returning match 2026-04-10 20:17:30 -04:00
Peter Steinberger
b9862a36b2 fix(ci): align sandbox and WhatsApp test fixtures 2026-04-11 01:16:44 +01:00
Peter Steinberger
aaac83f392 fix(ci): keep WhatsApp test helper inside plugin boundary 2026-04-11 01:15:16 +01:00
Tak Hoffman
6d344d28a1 test: update bash stop sandbox policy fixture 2026-04-10 19:13:18 -05:00
Tak Hoffman
1bb2807aca fix: normalize device-pair notify thread ids 2026-04-10 19:13:00 -05:00
Tak Hoffman
6afff0642e fix: preserve account binding metadata on rebind 2026-04-10 19:12:02 -05:00
Peter Steinberger
270630ba35 refactor: simplify channel setup conversions 2026-04-11 01:11:05 +01:00
Tak Hoffman
55f35708e1 fix: use target session for bash sandbox hints 2026-04-10 19:09:14 -05:00
Tak Hoffman
6504087b97 fix: restore voice call replay dedupe keys 2026-04-10 19:09:00 -05:00
Peter Steinberger
5ed410b79e docs: polish unreleased changelog 2026-04-11 01:08:44 +01:00
Peter Steinberger
11b0016e9e refactor: simplify provider channel conversions 2026-04-11 01:08:23 +01:00
Tak Hoffman
b9ddfa6d90 fix: ignore stale embedded auth refreshes 2026-04-10 19:07:45 -05:00
Tak Hoffman
2c9c6207fa Preserve Feishu binding delivery metadata 2026-04-10 19:07:22 -05:00
Peter Steinberger
f43140a50f test: pin WhatsApp media DNS through SDK helper 2026-04-11 01:05:38 +01:00
Peter Steinberger
a94b926944 refactor: simplify messaging conversions 2026-04-11 01:04:46 +01:00
Tak Hoffman
0f39df348d fix: preserve task requester session ownership 2026-04-10 19:03:13 -05:00
Peter Steinberger
ebfd468ee0 refactor: simplify typed conversions 2026-04-11 01:01:30 +01:00
Tak Hoffman
7c02b6df84 fix: tighten telegram allowFrom sender validation 2026-04-10 19:00:32 -05:00
Tak Hoffman
fa040b41de Persist generic binding touch updates 2026-04-10 18:59:35 -05:00
Peter Steinberger
58531530d9 test: tighten qa live scenarios 2026-04-11 00:58:40 +01:00
Peter Steinberger
85ee6f2967 fix: stabilize live qa suite routing 2026-04-11 00:58:40 +01:00
Tak Hoffman
a9100a33c2 fix teams feedback learning filename collisions 2026-04-10 18:57:47 -05:00
Peter Steinberger
f2d9b9c69c refactor: simplify acp spawn thread ids 2026-04-11 00:55:11 +01:00
Peter Steinberger
22e7b462c5 refactor: simplify agent command lane values 2026-04-11 00:53:50 +01:00
Tak Hoffman
fdb08dd35b fix: use target agent for task fallback 2026-04-10 18:53:06 -05:00
Peter Steinberger
2202392849 refactor: simplify exec stream chunks 2026-04-11 00:51:50 +01:00
Peter Steinberger
0f9de014e9 refactor: simplify model alias strings 2026-04-11 00:50:44 +01:00
Peter Steinberger
725fa51ac0 test: simplify embedded extra params model ids 2026-04-11 00:49:36 +01:00
Peter Steinberger
d2e2798f39 test: simplify sandbox docker arg helpers 2026-04-11 00:48:03 +01:00
Peter Steinberger
1edd47ac08 test: simplify skills download tar args 2026-04-11 00:46:59 +01:00
Tak Hoffman
c53a1b167f fix: use target agent for tools inventory 2026-04-10 18:46:55 -05:00
Peter Steinberger
fe3d143854 refactor: simplify verbose gate normalization 2026-04-11 00:45:48 +01:00
Peter Steinberger
9469ffc095 test: normalize command context text safely 2026-04-11 00:44:33 +01:00
Peter Steinberger
2b45a90f71 test: clarify lazy web auth string reads 2026-04-11 00:43:08 +01:00
Peter Steinberger
39553b1b4b refactor: simplify secrets string handling 2026-04-11 00:40:51 +01:00
Peter Steinberger
369d8a6c53 test: keep WhatsApp harness on plugin SDK seams (#64491) 2026-04-11 00:39:21 +01:00
Peter Steinberger
cfc1ce7547 test: satisfy temp path guard (#64491) 2026-04-11 00:39:21 +01:00
Peter Steinberger
9cbfbd18e3 fix: resolve scoped group tool policies (#64491) 2026-04-11 00:39:21 +01:00
Peter Steinberger
c94888dbee fix: honor heartbeat timeoutSeconds (#64491) 2026-04-11 00:39:21 +01:00
Bulloda
2e8b6eac8d fix(config): add timeoutSeconds support to agents.defaults.heartbeat
The heartbeat config schema was missing the timeoutSeconds field that was
documented in heartbeat.md. This caused config validation to fail when users
set timeoutSeconds under agents.defaults.heartbeat.

Changes:
- Add timeoutSeconds to HeartbeatSchema (z.number().int().positive().optional())
- Add timeoutSeconds type definition in AgentDefaultsConfig
- Add JSDoc comment for the new field

Fixes #64437

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 00:39:21 +01:00
Peter Steinberger
5c126dc6ac refactor: simplify container tty defaults 2026-04-11 00:39:04 +01:00
Vincent Koc
fa44a31920 fix(auth): brand codex oauth as openclaw 2026-04-11 00:38:09 +01:00
Peter Steinberger
985ae5edca refactor: simplify gateway discovery sort keys 2026-04-11 00:37:53 +01:00
Peter Steinberger
fe395cf045 test: isolate remaining extension network tests 2026-04-11 00:37:17 +01:00
Peter Steinberger
c05107adcb refactor: simplify nodes notify inputs 2026-04-11 00:36:42 +01:00
Vincent Koc
84d4e5deac docs(ci): refresh release notes lane references 2026-04-11 00:36:06 +01:00
Vincent Koc
9e2e4cde19 ci(test): align node lane names with boundary split 2026-04-11 00:36:06 +01:00
Peter Steinberger
f4c9248a31 refactor: simplify gateway agent values 2026-04-11 00:35:31 +01:00
Tak Hoffman
fa0b086a99 fix: use target agent for commands list 2026-04-10 18:35:28 -05:00
Gustavo Madeira Santana
25445a9f2e qa-lab: add Matrix live transport QA lane (#64489)
Merged via squash.

Prepared head SHA: ae9bb37751
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
2026-04-10 19:35:08 -04:00
Peter Steinberger
cca7755c63 refactor: reuse raw channel input 2026-04-11 00:34:28 +01:00
EVA
3b289c7942 fix(subagents): retry archived session deletes after sweep failures (#61801)
Merged via squash.

Prepared head SHA: 1152c26a78
Co-authored-by: 100yenadmin <239388517+100yenadmin@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
2026-04-10 16:34:27 -07:00
Peter Steinberger
a403e611c7 refactor: simplify configure wizard prompt values 2026-04-11 00:33:20 +01:00
Tak Hoffman
ead1ee42cb fix: use target agent for command tool context 2026-04-10 18:32:48 -05:00
Peter Steinberger
926c70f35f refactor: simplify doctor platform notes 2026-04-11 00:31:36 +01:00
Peter Steinberger
a23108c795 refactor: simplify gateway status issue filters 2026-04-11 00:30:35 +01:00
Tak Hoffman
242a91bd0d fix: use target agent for session exports 2026-04-10 18:30:24 -05:00
Peter Steinberger
4ad2006811 test: simplify provider auth error messages 2026-04-11 00:29:00 +01:00
Peter Steinberger
25d1f65296 test: simplify onboard search selections 2026-04-11 00:27:48 +01:00
Peter Steinberger
bdf3b4a317 refactor: simplify sessions cleanup mutation checks 2026-04-11 00:26:45 +01:00
Peter Steinberger
a0158a9dad test: simplify control ui auth nonces 2026-04-11 00:25:16 +01:00
Peter Steinberger
e3af3dd28a test: simplify gateway default auth errors 2026-04-11 00:23:56 +01:00
Tak Hoffman
119a546f6d fix: use target session for command runtime context 2026-04-10 18:23:32 -05:00
Peter Steinberger
47ef79051e test: isolate telegram reply media fetch 2026-04-11 00:22:19 +01:00
Peter Steinberger
fe4a74a716 refactor: simplify gateway session resolution 2026-04-11 00:22:12 +01:00
Peter Steinberger
df95949fe4 refactor: simplify gateway startup auth checks 2026-04-11 00:20:55 +01:00
Tak Hoffman
68a39c2f82 fix: prefer persisted parent session in status 2026-04-10 18:20:27 -05:00
EVA
71bd9e0df0 fix(agents): preserve malformed function-call arguments instead of silent {} replacement (#61956)
Merged via squash.

Prepared head SHA: 4185913276
Co-authored-by: 100yenadmin <239388517+100yenadmin@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
2026-04-10 16:20:26 -07:00
Peter Steinberger
6710358eda test: simplify tools invoke session keys 2026-04-11 00:19:43 +01:00
Peter Steinberger
61718d2da5 refactor: simplify exec approval booleans 2026-04-11 00:18:38 +01:00
Peter Steinberger
4c0f6f8ce1 refactor: simplify outbound channel errors 2026-04-11 00:17:29 +01:00
Tak Hoffman
3de092b001 fix: keep whoami allowfrom in sync with command auth 2026-04-10 18:16:28 -05:00
Peter Steinberger
456a263080 test: simplify apns relay pem exports 2026-04-11 00:15:50 +01:00
Peter Steinberger
ded9052689 refactor: simplify telegram command config 2026-04-11 00:14:23 +01:00
Peter Steinberger
46a6746bca docs: clarify codex harness validation 2026-04-11 00:13:08 +01:00
Peter Steinberger
9ac7a03982 fix: harden codex app-server harness 2026-04-11 00:13:08 +01:00
Peter Steinberger
47c0ce5f85 refactor: narrow codex harness selection 2026-04-11 00:13:08 +01:00
Tak Hoffman
cfae8fd1e9 fix: preserve sender identity in compaction tools 2026-04-10 18:12:46 -05:00
Peter Steinberger
66ac60acbd test: simplify plugin metadata assertions 2026-04-11 00:12:26 +01:00
875 changed files with 18559 additions and 3444 deletions

View File

@@ -8,23 +8,23 @@
},
"rules": {
"curly": "error",
"eslint-plugin-unicorn/prefer-array-find": "off",
"eslint-plugin-unicorn/prefer-array-find": "error",
"eslint/no-await-in-loop": "off",
"eslint/no-new": "off",
"eslint/no-new": "error",
"eslint/no-shadow": "off",
"eslint/no-unmodified-loop-condition": "off",
"eslint-plugin-unicorn/prefer-set-size": "off",
"oxc/no-accumulating-spread": "off",
"eslint/no-unmodified-loop-condition": "error",
"eslint-plugin-unicorn/prefer-set-size": "error",
"oxc/no-accumulating-spread": "error",
"oxc/no-async-endpoint-handlers": "off",
"oxc/no-map-spread": "off",
"typescript/consistent-return": "error",
"typescript/no-explicit-any": "error",
"typescript/no-extraneous-class": "off",
"typescript/no-unnecessary-type-conversion": "off",
"typescript/no-extraneous-class": "error",
"typescript/no-unnecessary-type-conversion": "error",
"typescript/no-unsafe-type-assertion": "off",
"unicorn/consistent-function-scoping": "off",
"unicorn/prefer-set-size": "off",
"unicorn/require-post-message-target-origin": "off"
"unicorn/prefer-set-size": "error",
"unicorn/require-post-message-target-origin": "error"
},
"ignorePatterns": [
"assets/",

View File

@@ -6,44 +6,61 @@ Docs: https://docs.openclaw.ai
### Changes
### Fixes
## 2026.4.10
### Changes
- Models/Codex: add the bundled Codex provider and plugin-owned app-server harness so `codex/gpt-*` models use Codex-managed auth, native threads, model discovery, and compaction while `openai/gpt-*` stays on the normal OpenAI provider path. (#64298)
- Memory/Active Memory: add a new optional Active Memory plugin that gives OpenClaw a dedicated memory sub-agent right before the main reply, so ongoing chats can automatically pull in relevant preferences, context, and past details without making users remember to manually say "remember this" or "search memory" first. Includes configurable message/recent/full context modes, live `/verbose` inspection, advanced prompt/thinking overrides for tuning, and opt-in transcript persistence for debugging. Docs: https://docs.openclaw.ai/concepts/active-memory. (#63286) Thanks @Takhoffman.
- macOS/Talk: add an experimental local MLX speech provider for Talk Mode, with explicit provider selection, local utterance playback, interruption handling, and system-voice fallback. (#63539) Thanks @ImLukeF.
- Tools/video generation: add Seedance 2.0 model refs to the bundled fal provider and submit the provider-specific duration, resolution, audio, and seed metadata fields needed for live Seedance 2.0 runs.
- Microsoft Teams: add message actions for pin, unpin, read, react, and listing reactions. (#53432) Thanks @sudie-codes.
- QA/Matrix: add a live `openclaw qa matrix` lane backed by a disposable Matrix homeserver, shared live-transport seams, and Matrix-specific transport coverage for threading, reactions, restart, and allowlist behavior. (#64489) Thanks @gumadeiras.
- QA/Telegram: add a live `openclaw qa telegram` lane for private-group bot-to-bot checks, harden its artifact handling, and preserve native Telegram command reply threading for QA verification. (#64303) Thanks @obviyus.
- QA/testing: add a `--runner multipass` lane for `openclaw qa suite` so repo-backed QA scenarios can run inside a disposable Linux VM and write back the usual report, summary, and VM logs. (#63426) Thanks @shakkernerd.
- CLI/exec policy: add a local `openclaw exec-policy` command with `show`, `preset`, and `set` subcommands for synchronizing requested `tools.exec.*` config with the local exec approvals file, plus follow-up hardening for node-host rejection, rollback safety, and sync conflict detection. (#64050)
- Gateway: add a `commands.list` RPC so remote gateway clients can discover runtime-native, text, skill, and plugin commands with surface-aware naming and serialized argument metadata. (#62656) Thanks @samzong.
- Models/providers: add per-provider `models.providers.*.request.allowPrivateNetwork` for trusted self-hosted OpenAI-compatible endpoints, keep the opt-in scoped to model request surfaces, and refresh cached WebSocket managers when request transport overrides change. (#63671) Thanks @qas.
- QA/testing: add a `--runner multipass` lane for `openclaw qa suite` so repo-backed QA scenarios can run inside a disposable Linux VM and write back the usual report, summary, and VM logs. (#63426) Thanks @shakkernerd.
- Docs i18n: chunk raw doc translation, reject truncated tagged outputs, avoid ambiguous body-only wrapper unwrapping, and recover from terminated Pi translation sessions without changing the default `openai/gpt-5.4` path. (#62969, #63808) Thanks @hxy91819.
- Control UI/dreaming: simplify the Scene and Diary surfaces, preserve unknown phase state for partial status payloads, and stabilize waiting-entry recency ordering so Dreaming status and review lists stay clear and deterministic. (#64035) Thanks @davemorin.
- Gateway: split startup and runtime seams so gateway lifecycle sequencing, reload state, and shutdown behavior stay easier to maintain without changing observed behavior. (#63975) Thanks @gumadeiras.
- Feishu: standardize request user agents and register the bot as an AI agent so Feishu deployments identify OpenClaw consistently. (#63835) Thanks @evandance.
- Matrix/partial streaming: add MSC4357 live markers to draft preview sends and edits so supporting Matrix clients can render a live/typewriter animation and stop it when the final edit lands. (#63513) Thanks @TigerInYourDream.
- QA/Telegram: add a live `openclaw qa telegram` lane for private-group bot-to-bot checks, harden its artifact handling, and preserve native Telegram command reply threading for QA verification. (#64303) Thanks @obviyus.
- Models/Codex: add the bundled Codex provider and plugin-owned app-server harness so `codex/gpt-*` models use Codex-managed auth, native threads, model discovery, and compaction while `openai/gpt-*` stays on the normal OpenAI provider path. (#64298) Thanks @steipete.
- Control UI/dreaming: simplify the Scene and Diary surfaces, preserve unknown phase state for partial status payloads, and stabilize waiting-entry recency ordering so Dreaming status and review lists stay clear and deterministic. (#64035) Thanks @davemorin.
- Agents: add an opt-in strict-agentic embedded Pi execution contract for GPT-5-family runs so plan-only or filler turns keep acting until they hit a real blocker. (#64241) Thanks @100yenadmin.
- Agents/OpenAI: add provider-owned OpenAI/Codex tool schema compatibility and surface embedded-run replay/liveness state for long-running runs. (#64300) Thanks @100yenadmin.
- Docs i18n: chunk raw doc translation, reject truncated tagged outputs, avoid ambiguous body-only wrapper unwrapping, and recover from terminated Pi translation sessions without changing the default `openai/gpt-5.4` path. (#62969, #63808) Thanks @hxy91819.
### Fixes
- CLI/WhatsApp media sends: route gateway-mode outbound sends with `--media` through the channel `sendMedia` path and preserve media access context, so WhatsApp document and attachment sends stop silently dropping the file while still delivering the caption. (#64478) Thanks @ShionEria.
- fix(nostr): require operator.admin scope for profile mutation routes [AI]. (#63553) Thanks @pgondhi987.
- Gateway/startup: keep WebSocket RPC available while channels and plugin sidecars start, hold `chat.history` unavailable until startup sidecars finish so synchronous history reads cannot stall startup (reported in #63450), refresh advertised gateway methods after deferred plugin reloads, and enforce the pre-auth WebSocket upgrade budget before the no-handler 503 path so upgrade floods cannot bypass connection limits during that window. (#63480) Thanks @neeravmakwana.
- Browser/security: tighten browser and sandbox navigation defenses across strict SSRF defaults, hostname allowlists, interaction-driven redirects, subframes, CDP discovery, existing sessions, tab actions, noVNC, marker-span sanitization, and Docker CDP source-range enforcement. (#61404, #63332, #63882, #63885, #63889, #64367, #64370, #64371)
- Security/tools: harden exec preflight reads, host env denylisting, node output boundaries, outbound host-media reads, profile-mutation authorization, plugin install dependency scanning, ACPX tool hooks, Gmail watcher token redaction, and oversized realtime WebSocket frame handling. (#62333, #62661, #62662, #63277, #63551, #63553, #63886, #63890, #63891, #64459)
- OpenAI/Codex: add required Codex OAuth scopes, classify provider/runtime failures more clearly, stop suggesting `/elevated full` when auto-approved host exec is unavailable, add OpenAI/Codex tool-schema compatibility, and preserve embedded-run replay/liveness truth across compaction retries and mutating side effects. (#64300, #64439) Thanks @100yenadmin.
- CLI/WhatsApp media sends: route gateway-mode outbound sends with `--media` through the channel `sendMedia` path and preserve media access context, so WhatsApp document and attachment sends stop silently dropping the file while still delivering the caption. (#64478, #64492) Thanks @ShionEria.
- Microsoft Teams: restore media downloads for personal DMs, Bot Framework `a:` conversations, OneDrive/SharePoint shared files, and Graph-backed chat IDs; accept Bot Framework audience tokens; prevent feedback-learning filename collisions; keep long tool chains alive with typing indicators; add SSO sign-in callbacks; inject parent context for thread replies; and deliver cron announcements to Teams conversation IDs. (#54932, #55383, #55386, #58001, #58249, #58774, #59731, #60956, #62219, #62674, #63063, #63942, #63945, #63949, #63951, #63953, #64087, #64088, #64089)
- Gateway/tailscale: start Tailscale exposure and the gateway update check before awaiting channel and plugin sidecar startup so remote operators are not locked out when startup sidecars stall.
- Gateway/startup: keep WebSocket RPC available while channels and plugin sidecars start, hold `chat.history` unavailable until startup sidecars finish so synchronous history reads cannot stall startup (reported in #63450), refresh advertised gateway methods after deferred plugin reloads, and enforce the pre-auth WebSocket upgrade budget before the no-handler 503 path so upgrade floods cannot bypass connection limits during that window. (#63480) Thanks @neeravmakwana.
- WhatsApp: keep inbound replies, media, composing indicators, and queued outbound deliveries attached to the current socket across reconnect gaps, including fresh retry-eligible sends after the listener comes back. (#30806, #46299, #62892, #63916) Thanks @mcaxtr.
- Microsoft Teams: restore media downloads for personal DMs, Bot Framework `a:` conversations, OneDrive/SharePoint shared files, and Graph-backed chat IDs; accept Bot Framework audience tokens; and deliver cron announcements to Teams conversation IDs. (#55383, #58001, #58249, #62219, #62674, #63063, #63942, #63951, #63953) Thanks @obviyus.
- Gateway/thread routing: preserve Slack, Telegram, Mattermost, and ACP parent-thread delivery targets so subagent, cron, and stream-relay completion messages land back in the originating thread or topic. (#54840, #57056, #63228, #63506) Thanks @yzzymt.
- Gateway/thread routing: preserve Slack, Telegram, Mattermost, Matrix, ACP, restart-sentinel, and agent announce delivery targets so subagent, cron, stream-relay, session fallback, and restart messages land back in the originating thread, topic, or room casing. (#54840, #57056, #63143, #63228, #63506, #64343, #64391)
- Models/fallback: preserve `/models` selection across transient primary-model failures and config reloads, allow timeout cooldown probes, classify OpenRouter no-endpoints responses, detect llama.cpp context overflows, and keep provider/runtime context metadata stable through reloads. (#61472, #64196, #64471)
- Agents/BTW: keep `/btw` side questions working after tool-use turns by stripping replayed tool blocks, hidden reasoning, and malformed image payloads, omitting empty tool arrays, allowing Bedrock `auth: "aws-sdk"`, and routing Feishu `/btw` plus `/stop` through bounded out-of-band lanes. (#64218, #64219, #64225, #64324) Thanks @ngutman.
- Control UI/BTW: render `/btw` side results as dismissible ephemeral cards in the browser, send `/btw` immediately during active runs, and clear stale BTW cards on reset flows so webchat matches the intended detached side-question behavior. (#64290) Thanks @ngutman.
- Commands/targeting: use the selected agent or session for command output, send policy, usage/cost, context reports, model lists, bash sandbox hints, BTW/compact working directories, plugin commands, and session exports so multi-agent commands describe and mutate the intended target instead of the requester.
- Conversation bindings: normalize focused/current conversation ids, preserve binding metadata on account and Discord rebinds, avoid stale Discord lifecycle windows, and keep generic activity touches persisted so reply routing survives rebinds and restarts.
- iMessage/self-chat: distinguish normal DM outbound rows from true self-chat using `destination_caller_id` plus chat participants, preserve multi-handle self-chat aliases, drop ambiguous reflected echoes, and strip wrapped imsg RPC text fields. (#61619, #63868, #63980, #63989, #64000) Thanks @neeravmakwana.
- Matrix: keep multi-account room scoping consistent, keep packaged crypto migrations warning-only when appropriate, preserve ordered block streaming, add explicit Matrix block-streaming opt-in, and resolve verification/bootstrap from the packaged runtime entry. (#58449, #59249, #59266, #64373) Thanks @gumadeiras.
- Telegram/security: tighten Telegram `allowFrom` sender validation and keep `/whoami` allowlist reporting in sync with command auth checks.
- Agents/timeouts: extend the default LLM idle window to 120s and keep silent no-token idle timeouts on recovery paths, so slow models can retry or fall back before users see an error.
- Gateway/agents: preserve configured model selection and richer `IDENTITY.md` content across agent create/update flows and workspace moves, and fail safely instead of silently overwriting unreadable identity files. (#61577) Thanks @samzong.
- Skills/TaskFlow: restore valid frontmatter fences for the bundled `taskflow` and `taskflow-inbox-triage` skills so they stay discoverable and loadable after updates. (#64469) Thanks @extrasmall0.
- Skills/TaskFlow: restore valid frontmatter fences for the bundled `taskflow` and `taskflow-inbox-triage` skills and copy bundled `SKILL.md` files as hard dist-runtime copies so skills stay discoverable and loadable after updates. (#64166, #64469) Thanks @extrasmall0.
- Skills: respect overridden home directories when loading personal skills so service, test, and custom launch environments read the intended user skill directory instead of the process home.
- Windows/exec: settle supervisor waits from child exit state after stdout and stderr drain even when `close` never arrives, so CLI commands stop hanging or dying with forced `SIGKILL` on Windows. (#64072) Thanks @obviyus.
- Browser/sandbox: prevent sandbox browser CDP startup hangs by recreating containers when the browser security hash changes and by waiting on the correct sandbox browser lifecycle. (#62873) Thanks @Syysean.
- iMessage/self-chat: distinguish normal DM outbound rows from true self-chat using `destination_caller_id` plus chat participants, while preserving multi-handle self-chat aliases so outbound DM replies stop looping back as inbound messages. (#61619) Thanks @neeravmakwana.
- QQBot/streaming: make block streaming configurable per QQ bot account via `streaming.mode` (`"partial"` | `"off"`, default `"partial"`) instead of hardcoding it off, so responses can be delivered incrementally. (#63746)
- QQBot/config: allow extra fields in `channels.qqbot` and `channels.qqbot.accounts.*` so extended qqbot builds can add new config options without gateway startup failing on schema validation. (#64075) Thanks @WideLee.
- Dreaming/gateway: require `operator.admin` for persistent `/dreaming on|off` changes and treat missing gateway client scopes as unprivileged instead of silently allowing config writes. (#63872) Thanks @mbelinky.
- Matrix/multi-account: keep room-level `account` scoping, inherited room overrides, and implicit account selection consistent across top-level default auth, named accounts, and cached-credential env setups. (#58449) thanks @Daanvdplas and @gumadeiras.
- Gateway/pairing: prefer explicit QR bootstrap auth over earlier Tailscale auth classification so iOS `/pair qr` silent bootstrap pairing does not fall through to `pairing required`. (#59232) Thanks @ngutman.
- Browser/control: auto-generate browser-control auth tokens for `none` and `trusted-proxy` modes, and route browser auth/profile/doctor helpers through the public browser plugin facades. (#63280, #63957) Thanks @pgondhi987.
- Browser/act: centralize `/act` request normalization and execution dispatch while adding stable machine-readable route-level error codes for invalid requests, selector misuse, evaluate-disabled gating, target mismatch, and existing-session unsupported actions. (#63977) Thanks @joshavant.
- Security/exec: replace script-preflight check-then-read logic with an atomic pinned-file-descriptor open, and expand the host environment denylist for dangerous runtime-control variables. (#62333, #63277) Thanks @pgondhi987.
- Security/nodes: keep `nodes` tool output paths inside the workspace boundary so model-driven node writes cannot escape the intended workspace. (#63551) Thanks @pgondhi987.
- Security/QQBot: enforce media storage boundaries for all outbound local file paths and route image-size probes through SSRF-guarded media fetching instead of raw `fetch()`. (#63271, #63495) Thanks @pgondhi987.
- Channel setup: ignore workspace plugin shadows when resolving trusted channel setup catalog entries so onboarding and setup flows keep using the bundled, trusted setup contract.
- Gateway/memory startup: load the explicitly selected memory-slot plugin during gateway startup, while keeping restrictive allowlists and implicit default memory slots from auto-starting unrelated memory plugins. (#64423) Thanks @EronFan.
@@ -64,91 +81,57 @@ Docs: https://docs.openclaw.ai
- Claude CLI: clear inherited Anthropic auth/header environment aliases before spawning Claude Code and add sanitized CLI backend auth-env diagnostics for debugging gateway-run provider selection.
- Agents/failover: classify AbortError and stream-abort messages as timeout so Ollama NDJSON stream aborts stop showing `reason=unknown` in model fallback logs. (#58324) Thanks @yelog.
- Fireworks/FirePass: disable Kimi K2.5 Turbo reasoning output by forcing thinking off on the FirePass path and hardening the provider wrapper so hidden reasoning no longer leaks into visible replies. (#63607) Thanks @frankekn.
- Matrix/multi-account: keep room-level `account` scoping, inherited room overrides, and implicit account selection consistent across top-level default auth, named accounts, and cached-credential env setups. (#58449) Thanks @gumadeiras.
- Matrix/runtime: resolve the verification/bootstrap runtime from a distinct packaged Matrix entry so global npm installs stop failing on crypto bootstrap with missing-module or recursive runtime alias errors. (#59249) Thanks @gumadeiras.
- Matrix/streaming: preserve ordered block flushes before tool, message, and agent boundaries, add explicit `channels.matrix.blockStreaming` opt-in so Matrix `streaming: "off"` stays final-only by default, and move MiniMax plain-text final handling into the MiniMax provider runtime instead of the shared core heuristic. (#59266) Thanks @gumadeiras.
- QQBot/streaming: make block streaming configurable per QQ bot account via `streaming.mode` (`"partial"` | `"off"`, default `"partial"`) instead of hardcoding it off, so responses can be delivered incrementally. (#63746)
- Discord: update Carbon to v0.15.0. Thanks @thewilloftheshadow.
- Config/Discord: coerce safe integer numeric Discord IDs to strings during config validation, keep unsafe or precision-losing numeric snowflakes rejected, and align `openclaw doctor` repair guidance with the same fail-closed behavior. (#45125) Thanks @moliendocode.
- BlueBubbles/config: accept `enrichGroupParticipantsFromContacts` in the core strict config schema so gateways no longer fail validation or startup when the BlueBubbles plugin writes that field. (#56889) Thanks @zqchris.
- Feishu/webhooks: read webhook bodies through the pre-auth guard so unauthenticated webhook traffic stays under the same body budget as other protected channel ingress paths.
- Tools/web_fetch: add an opt-in `tools.web.fetch.ssrfPolicy.allowRfc2544BenchmarkRange` config so fake-IP proxy environments that resolve public sites into `198.18.0.0/15` can use `web_fetch` without weakening the default SSRF block. (#61830) Thanks @xing-xing-coder.
- Dreaming/gateway: require `operator.admin` for persistent `/dreaming on|off` changes and treat missing gateway client scopes as unprivileged instead of silently allowing config writes. (#63872) Thanks @mbelinky.
- Dreaming/cron: reconcile managed dreaming cron from startup config and runtime lifecycle changes, but only recover managed dreaming cron state during heartbeat-triggered dreaming checks so ordinary chat traffic does not recreate removed jobs. (#63873, #63929, #63938) Thanks @mbelinky.
- Memory/lancedb: accept `dreaming` config when `memory-lancedb` owns the memory slot so Dreaming surfaces can read slot-owner settings without schema rejection. (#63874) Thanks @mbelinky.
- Control UI/dreaming: keep the Dreaming trace area contained and scrollable so overlays no longer cover tabs or blow out the page layout. (#63875) Thanks @mbelinky.
- Dreaming/narrative: harden request-scoped diary fallback so scheduled dreaming only falls back on the dedicated subagent-runtime error, stop trusting spoofable raw error-code objects, and avoid leaking workspace paths when local fallback writes fail. (#64156) Thanks @mbelinky.
- Dreaming/diary: add idempotent narrative subagent runs, preserve restrictive `DREAMS.md` permissions during atomic writes, and surface temp cleanup failures so repeated sweeps do not double-run the same narrative request or silently weaken diary safety. (#63876) Thanks @mbelinky.
- Heartbeats/sessions: remove stale accumulated isolated heartbeat session keys when the next tick converges them back to the canonical sibling, so repaired sessions stop showing orphaned `:heartbeat:heartbeat` variants in session listings. (#59606) Thanks @rogerdigital.
- Gateway/run cleanup: fix stale run-context TTL cleanup so the new maintenance sweep resets orphaned run sequence state and prevents unbounded run-context growth. (#52731) Thanks @artwalker.
- UI/compaction: keep the compaction indicator in a retry-pending state until the run actually finishes, so the UI does not show `Context compacted` before compaction actually finishes. (#55132) Thanks @mpz4life.
- Cron/tool schemas: keep cron tool schemas strict-model-friendly while still preserving `failureAlert=false`, nullable `agentId`/`sessionKey`, and flattened add/update recovery for the newly exposed cron job fields. (#55043) Thanks @brunolorente.
- Git metadata: read commit ids from packed refs as well as loose refs so version and status metadata stay accurate after repository maintenance. (#63943)
- Gateway: keep `commands.list` skill entries categorized under tools and include provider-aware plugin `nativeName` metadata even when `scope=text`, so remote clients can group skills correctly and map text-surface plugin commands back to native aliases.
- Gateway: keep `commands.list` skill entries categorized under tools and include provider-aware plugin `nativeName` metadata even when `scope=text`, so remote clients can group skills correctly and map text-surface plugin commands back to native aliases. (#64147)
- TUI: reset footer activity to idle when switching sessions so a stale streaming indicator cannot persist after the selection changes. (#63988) Thanks @neeravmakwana.
- iMessage: treat `sender === chat_identifier` as self-chat only when `destination_caller_id` is present and matches the sender, fixing DM outbound rows that omit destination from being run through self-chat echo handling. (#63980) Thanks @neeravmakwana.
- Cron/Telegram: collapse isolated announce delivery to the final assistant-visible text only for Telegram targets, while preserving existing multi-message direct delivery semantics for other channels. (#63228) Thanks @welfo-beo.
- Gateway/thread routing: preserve Slack, Telegram, and Mattermost thread-child delivery targets so bound subagent completion messages land in the originating thread instead of top-level channels. (#54840) Thanks @yzzymt.
- ACP/stream relay: pass parent delivery context to ACP stream relay system events so `streamTo="parent"` updates route to the correct thread or topic instead of falling back to the main DM. (#57056) Thanks @pingren.
- Agents/sessions: preserve announce `threadId` when `sessions.list` fallback rehydrates agent-to-agent announce targets so final announce messages stay in the originating thread/topic. (#63506) Thanks @SnowSky1.
- iMessage/self-chat: remember ambiguous `sender === chat_identifier` outbound rows with missing `destination_caller_id` in self-chat dedupe state so the later reflected inbound copy still drops instead of re-entering inbound handling when the echo cache misses. Thanks @neeravmakwana.
- Claude CLI: stop marking spawned Claude Code runs as host-managed so they keep using normal CLI subscription behavior. (#64023) Thanks @Alex-Alaniz.
- Agents/failover: classify OpenRouter `404 No endpoints found for <model>` responses as `model_not_found` so fallback chains continue past retired OpenRouter candidates. (#61472) Thanks @MonkeyLeeT.
- Browser/plugin SDK: route browser auth, profile, host-inspection, and doctor readiness helpers through browser plugin public facades so core compatibility helpers stop carrying duplicate runtime implementations. (#63957) Thanks @joshavant.
- Agents/failover: allow cooldown probes for `timeout` (including network outage classifications) so the primary model can recover after failover without a gateway restart. (#63996) Thanks @neeravmakwana.
- iMessage (imsg): strip an accidental protobuf length-delimited UTF-8 field wrapper from inbound `text` and `reply_to_text` when it fully consumes the field, fixing leading garbage before the real message. (#63868) Thanks @neeravmakwana.
- Codex auth: brand Codex OAuth flows as OpenClaw in user-visible auth prompts and diagnostics.
- Gateway/pairing: fail closed for paired device records that have no device tokens, and reject pairing approvals whose requested scopes do not match the requested device roles.
- ACP/gateway chat: classify lifecycle errors before forwarding them to ACP clients so refusals use ACP's refusal stop reason while transient backend errors continue to finish as normal turns.
- Agents/BTW: strip replayed tool blocks, hidden reasoning, and malformed image payloads from `/btw` side-question context so Bedrock no-tools side questions keep working after tool-use turns. (#64225) Thanks @ngutman.
- Commands/btw: keep tool-less side questions from sending injected empty `tools` arrays on strict OpenAI-compatible providers, so `/btw` continues working after prior tool-call history. (#64219) Thanks @ngutman.
- Agents/Bedrock: let `/btw` side questions use `auth: "aws-sdk"` without a static API key so Bedrock IAM and instance-role sessions stop failing before the side question runs. (#64218) Thanks @SnowSky1.
- Feishu: route `/btw` side questions and `/stop` onto bounded out-of-band lanes so BTW no longer waits behind a busy normal chat turn while ordinary same-chat traffic stays FIFO. (#64324) Thanks @ngutman.
- Agents/failover: detect llama.cpp slot context overflows as context-overflow errors so compaction can retry self-hosted OpenAI-compatible runs instead of surfacing the raw upstream 400. (#64196) Thanks @alexander-applyinnovations.
- Claude CLI/skills: pass eligible OpenClaw skills into CLI runs, including native Claude Code skill resolution via a temporary plugin plus per-run skill env/API key injection. (#62686, #62723) Thanks @zomars.
- Discord: keep generated auto-thread names working with reasoning models by giving title generation enough output budget for thinking plus visible title text. (#64172) Thanks @hanamizuki.
- Heartbeat: ignore doc-only Markdown fence markers in the default `HEARTBEAT.md` template so comment-only heartbeat scaffolds skip API calls again. (#63434) Thanks @ravyg.
- Control UI/BTW: render `/btw` side results as dismissible ephemeral cards in the browser, send `/btw` immediately during active runs, and clear stale BTW cards on reset flows so webchat matches the intended detached side-question behavior. (#64290) Thanks @ngutman.
- Heartbeat: ignore doc-only Markdown fence markers in the default `HEARTBEAT.md` template so comment-only heartbeat scaffolds skip API calls again. (#61690, #63434) Thanks @ravyg.
- Reply/skills: keep resolved skill and memory secret config stable through embedded reply runs so raw SecretRefs in secondary skill settings no longer crash replies when the gateway already has the live env. (#64249) Thanks @mbelinky.
- Dreaming/startup: keep plugin-registered startup hooks alive across workspace hook reloads and include dreaming startup owners in the gateway startup plugin scope, so managed Dreaming cron registration comes back reliably after gateway boot. (#62327) Thanks @mbelinky.
- Dreaming/startup: keep plugin-registered startup hooks alive across workspace hook reloads and include dreaming startup owners in the gateway startup plugin scope, so managed Dreaming cron registration comes back reliably after gateway boot. (#62327, #64258) Thanks @mbelinky.
- Plugins: treat duplicate `registerService` calls from the same plugin id as idempotent so snapshot and activation loads no longer emit spurious `service already registered` diagnostics. (#62033, #64128) Thanks @ly85206559.
- Discord/TTS: route auto voice replies through the native voice-note path so Discord receives Opus voice messages instead of regular audio attachments. (#64096) Thanks @LiuHuaize.
- Config/plugins: use plugin-owned command alias metadata when `plugins.allow` contains runtime command names like `dreaming`, and point users at the owning plugin instead of stale plugin-not-found guidance. (#64242) Thanks @feiskyer.
- Config/plugins: use plugin-owned command alias metadata when `plugins.allow` contains runtime command names like `dreaming`, and point users at the owning plugin instead of stale plugin-not-found guidance. (#64191, #64242) Thanks @feiskyer.
- Agents/Gemini: strip orphaned `required` entries from Gemini tool schemas so provider validation no longer rejects tools after schema cleanup or union flattening. (#64284) Thanks @xxxxxmax.
- Assistant text: strip Qwen-style XML tool call payloads from visible replies so web and channel messages no longer show raw `<tool_call><function=...>` output. (#64214) Thanks @MoerAI.
- Assistant text: strip Qwen-style XML tool call payloads from visible replies so web and channel messages no longer show raw `<tool_call><function=...>` output. (#63999, #64214) Thanks @MoerAI.
- Daemon/gateway: prevent systemd restart storms on configuration errors by exiting with `EX_CONFIG` and adding generated unit restart-prevention guards. (#63913) Thanks @neo1027144-creator.
- Agents/exec: prevent gateway crash ("Agent listener invoked outside active run") when a subagent exec tool produces stdout/stderr after the agent run has ended or been aborted. (#62821) Thanks @openperf.
- Browser/tabs: route `/tabs/action` close/select through the same browser endpoint reachability and policy checks as list/new (including Playwright-backed remote tab operations), reject CDP HTTP redirects on probe requests, and sanitize blocked-endpoint error responses so tab list/focus/close flows fail closed without echoing raw policy details back to callers. (#63332)
- Gateway/OpenAI compat: return real `usage` for non-stream `/v1/chat/completions` responses, emit the final usage chunk when `stream_options.include_usage=true`, and bound usage-gated stream finalization after lifecycle end. (#62986) Thanks @Lellansin.
- Matrix/migration: keep packaged warning-only crypto migrations from being misclassified as actionable when only helper chunks are present, so startup and doctor stay on the warning-only path instead of creating unnecessary migration snapshots. (#64373) Thanks @gumadeiras.
- Matrix/ACP thread bindings: preserve canonical room casing and parent conversation routing during ACP session spawn so mixed-case room ids bind correctly from top-level rooms and existing Matrix threads. (#64343) Thanks @gumadeiras.
- Agents/subagents: deduplicate delivered completion announces so retry or re-entry cleanup does not inject duplicate internal-context completion turns into the parent session. (#61525) Thanks @100yenadmin.
- Agents/exec: keep sandboxed `tools.exec.host=auto` sessions from honoring per-call `host=node` or `host=gateway` overrides while a sandbox runtime is active, and stop advertising node routing in that state so exec stays on the sandbox host. (#63880)
- Gateway/restart sentinel: route restart notices only from stored canonical delivery metadata and skip outbound guessing from lossy session keys, avoiding misdelivery on case-sensitive channels like Matrix. (#64391) Thanks @gumadeiras.
- Agents/subagents: preserve archived delete-mode runs until `sessions.delete` succeeds and prevent overlapping archive sweeps from duplicating in-flight cleanup attempts. (#61801) Thanks @100yenadmin.
- Cron/isolated agent: run scheduled agent turns as non-owner senders so owner-only tools stay unavailable during cron execution. (#63878)
- Voice Call/realtime: reject oversized realtime WebSocket frames before bridge setup so large pre-start payloads cannot crash the gateway. (#63890) Thanks @mmaps.
- Browser/sandbox: gate `/sandbox/novnc` behind bridge auth and stop surfacing sandbox observer URLs in model-visible prompt context. (#63882) Thanks @eleqtrizit.
- Discord/sandbox: include `image` in sandbox media param normalization so Discord event cover images cannot bypass sandbox path rewriting. (#64377) Thanks @mmaps.
- Agents/exec: extend exec completion detection to cover local background exec formats so the owner-downgrade fires correctly for all exec paths. (#64376) Thanks @mmaps.
- Security/dependencies: pin axios to 1.15.0 and add a plugin install dependency denylist that blocks known malicious packages before install. (#63891) Thanks @mmaps.
- Browser/security: apply three-phase interaction navigation guard to pressKey and type(submit) so delayed JS redirects from keypress cannot bypass SSRF policy. (#63889) Thanks @mmaps.
- Browser/security: guard existing-session Chrome MCP interaction routes with SSRF post-checks so delayed navigation from click, type, press, and evaluate cannot bypass the configured policy. (#64370) Thanks @eleqtrizit.
- Browser/security: default browser SSRF policy to strict mode so unconfigured installs block private-network navigation, and align external-content marker span mapping so ZWS-injected boundary spoofs are fully sanitized. (#63885) Thanks @eleqtrizit.
- Browser/security: apply SSRF navigation policy to subframe document navigations so iframe-targeted private-network hops are blocked without quarantining the parent page. (#64371) Thanks @eleqtrizit.
- Hooks/security: mark agent hook system events as untrusted and sanitize hook display names before cron metadata reuse. (#64372) Thanks @eleqtrizit.
- Media/security: honor sender-scoped `toolsBySender` policy for outbound host-media reads so denied senders cannot trigger host file disclosure via attachment hydration. (#64459) Thanks @eleqtrizit.
- Browser/security: reject strict-policy hostname navigation unless the hostname is an explicit allowlist exception or IP literal, and route CDP HTTP discovery through the pinned SSRF fetch path. (#64367) Thanks @eleqtrizit.
- Plugins/ACPX: wrap plugin tools on the MCP bridge with the shared `before_tool_call` handler so block and approval hooks fire consistently across all execution paths. (#63886) Thanks @eleqtrizit.
- Logging/security: redact Gmail watcher `--hook-token` values from startup logging and `logs.tail` output. (#62661) Thanks @eleqtrizit.
- Models/fallback: preserve `/models` selection across transient primary-model failures and config reloads so the fallback chain no longer permanently clobbers a user-chosen model. (#64471) Thanks @hoyyeva.
- Sandbox/security: auto-derive CDP source-range from Docker network gateway and refuse to start the socat relay without one, so peer containers cannot reach CDP unauthenticated. (#61404) Thanks @dims.
- Daemon/launchd: keep `openclaw gateway stop` persistent without uninstalling the macOS LaunchAgent, re-enable it on explicit restart or repair, and harden launchd label handling. (#64447) Thanks @ngutman.
- Agents/Slack: preserve threaded announce delivery when `sessions.list` rows lack stored thread metadata by falling back to the thread id encoded in the session key. (#63143) Thanks @mariosousa-finn.
- Plugins/context engines: preserve `plugins.slots.contextEngine` through normalization and keep explicitly selected workspace context-engine plugins enabled, so loader diagnostics and plugin activation stop dropping that slot selection. (#64192) Thanks @hclsys.
- Heartbeat: stop top-level `interval:` and `prompt:` fields outside the `tasks:` block from bleeding into the last parsed heartbeat task. (#64488) Thanks @Rahulkumar070.
- Agents/OpenAI replay: preserve malformed function-call arguments in stored assistant history, avoid double-encoding preserved raw strings on replay, and coerce replayed string args back to objects at Anthropic and Google provider boundaries. (#61956) Thanks @100yenadmin.
- Heartbeat/config: accept and honor `agents.defaults.heartbeat.timeoutSeconds` and per-agent heartbeat timeout overrides for heartbeat agent turns. (#64491) Thanks @cedillarack.
- CLI/devices: make implicit `openclaw devices approve` selection preview-only and require approving the exact request ID, preventing latest-request races during device pairing. (#64160) Thanks @coygeek.
- Media/security: honor sender-scoped `toolsBySender` policy for outbound host-media reads so denied senders cannot trigger host file disclosure via attachment hydration. (#64459) Thanks @eleqtrizit.
- Browser/security: reject strict-policy hostname navigation unless the hostname is an explicit allowlist exception or IP literal, and route CDP HTTP discovery through the pinned SSRF fetch path. (#64367) Thanks @eleqtrizit.
- Models/vLLM: ignore empty `tool_calls` arrays from reasoning-model OpenAI-compatible replies, reset false `toolUse` stop reasons when no actual tool calls were parsed, and stop sending `tool_choice` unless tools are present so vLLM reasoning responses no longer hang indefinitely. (#61197, #61534) Thanks @balajisiva.
## 2026.4.9
### Changes
@@ -196,7 +179,6 @@ Docs: https://docs.openclaw.ai
- Control UI/models: preserve provider-qualified refs for OpenRouter catalog models whose ids already contain slashes so picker selections submit allowlist-compatible model refs instead of dropping the `openrouter/` prefix. (#63416) Thanks @sallyom.
- Plugin SDK/command auth: split command status builders onto the lightweight `openclaw/plugin-sdk/command-status` subpath while preserving deprecated `command-auth` compatibility exports, so auth-only plugin imports no longer pull status/context warmup into CLI onboarding paths. (#63174) Thanks @hxy91819.
- Wizard/plugin config: coerce integer-typed plugin config fields from interactive text input so integer schema values persist as numbers instead of failing validation. (#63346) Thanks @jalehman.
- Dreaming/narrative: harden request-scoped diary fallback so scheduled dreaming only falls back on the dedicated subagent-runtime error, stop trusting spoofable raw error-code objects, and avoid leaking workspace paths when local fallback writes fail. (#64156) Thanks @mbelinky.
## 2026.4.8
@@ -539,7 +521,7 @@ Docs: https://docs.openclaw.ai
- Agents/scheduling: steer background-now work toward automatic completion wake and treat `process` polling as on-demand inspection or intervention instead of default completion handling. (#60877) Thanks @vincentkoc.
- Agents/skills: skip `.git` and `node_modules` when mirroring skills into sandbox workspaces so read-only sandboxes do not copy repo history or dependency trees. (#61090) Thanks @joelnishanth.
- ACP/agents: inherit the target agent workspace for cross-agent ACP spawns and fall back safely when the inherited workspace no longer exists. (#58438) Thanks @zssggle-rgb.
- ACPX/Windows: preserve backslashes and absolute `.exe` paths in Claude CLI parsing, and fail fast on wrapper-script targets with guidance to use `cmd.exe /c`, `powershell.exe -File`, or `node <script>`. (#60689) Thanks @steipete.
- ACPX/Windows: preserve backslashes and absolute `.exe` paths in Claude CLI parsing, and fail fast on wrapper-script targets with guidance to use `cmd.exe /c`, `powershell.exe -File`, or `node <script>`. (#60689)
- Auth/failover: persist selected fallback overrides before retrying, shorten `auth_permanent` lockouts, and refresh websocket/shared-auth sessions only when real auth changes occur so retries and secret rotations behave predictably. (#60404, #60323, #60387) Thanks @extrasmall0 and @mappel-nv.
- Gateway/channels: pin the initial startup channel registry before later plugin-registry churn so configured channels stay visible and `channels.status` stops falling back to empty `channelOrder` / `channels` payloads after runtime plugin loads.
- Prompt caching: order stable workspace project-context files before `HEARTBEAT.md` and keep `HEARTBEAT.md` below the system-prompt cache boundary so heartbeat churn does not invalidate the stable project-context prefix. (#58979) Thanks @yozu and @vincentkoc.
@@ -1510,7 +1492,7 @@ Docs: https://docs.openclaw.ai
- Gateway/status: tolerate network interface discovery failures in status, onboarding control-UI links, and self-presence display paths so those surfaces fall back cleanly instead of crashing. (#52195) Thanks @meng-clb.
- Gateway/Linux: auto-detect nvm-managed Node TLS CA bundle needs before CLI startup and refresh installed services that are missing `NODE_EXTRA_CA_CERTS`. (#51146) Thanks @GodsBoy.
- Google auth/Node 25: patch `gaxios` to use native fetch without injecting `globalThis.window`, while translating proxy and mTLS transport settings so Google Vertex and Google Chat auth keep working on Node 25. (#47914) Thanks @pdd-cli.
- Gateway/plugins: pin runtime webhook routes to the gateway startup registry so channel webhooks keep working across plugin-registry churn, and make plugin auth + dispatch resolve routes from the same live HTTP-route registry. (#47902) Fixes #46924 and #47041. Thanks @steipete.
- Gateway/plugins: pin runtime webhook routes to the gateway startup registry so channel webhooks keep working across plugin-registry churn, and make plugin auth + dispatch resolve routes from the same live HTTP-route registry. (#47902) Fixes #46924 and #47041.
- Gateway/restart: defer externally signaled unmanaged restarts through the in-process idle drain, and preserve the restored subagent run as remap fallback during orphan recovery so resumed sessions do not duplicate work. (#47719) Thanks @joeykrug.
- Telegram/setup: seed fresh setups with `channels.telegram.groups["*"].requireMention=true` so new bots stay mention-gated in groups unless you explicitly open them up. Thanks @vincentkoc.
- Inbound policy hardening: tighten callback and webhook sender checks across Mattermost and Google Chat, match Nextcloud Talk rooms by stable room token, and treat explicit empty Twitch allowlists as deny-all. (#46787) Thanks @zpbrent, @ijxpwastaken and @vincentkoc.
@@ -2923,7 +2905,7 @@ Docs: https://docs.openclaw.ai
- Gemini OAuth/Auth flow: align OAuth project discovery metadata and endpoint fallback handling for Gemini CLI auth, including fallback coverage for environment-provided project IDs. (#16684) Thanks @vincentkoc.
- Google Chat/Lifecycle: keep Google Chat `startAccount` pending until abort in webhook mode so startup is no longer interpreted as immediate exit, preventing auto-restart loops and webhook-target churn. (#27384) thanks @junsuwhy.
- Temp dirs/Linux umask: force `0700` permissions after temp-dir creation and self-heal existing writable temp dirs before trust checks so `umask 0002` installs no longer crash-loop on startup. Landed from contributor PR #27860. (#27853) Thanks @stakeswky.
- Nextcloud Talk/Lifecycle: keep `startAccount` pending until abort and stop the webhook monitor on shutdown, preventing `EADDRINUSE` restart loops when the gateway manages account lifecycle. (#27897) Thanks @steipete.
- Nextcloud Talk/Lifecycle: keep `startAccount` pending until abort and stop the webhook monitor on shutdown, preventing `EADDRINUSE` restart loops when the gateway manages account lifecycle. (#27897)
- Microsoft Teams/File uploads: acknowledge `fileConsent/invoke` immediately (`invokeResponse` before upload + file card send) so Teams no longer shows false "Something went wrong" timeout banners while upload completion continues asynchronously; includes updated async regression coverage. Landed from contributor PR #27641 by @scz2011.
- Queue/Drain/Cron reliability: harden lane draining with guaranteed `draining` flag reset on synchronous pump failures, reject new queue enqueues during gateway restart drain windows (instead of silently killing accepted tasks), add `/stop` queued-backlog cutoff metadata with stale-message skipping (while avoiding cross-session native-stop cutoff bleed), and raise isolated cron `agentTurn` outer safety timeout to avoid false 10-minute timeout races against longer agent session timeouts. (#27407, #27332, #27427)
- Typing/Main reply pipeline: always mark dispatch idle in `agent-runner` finalization so typing cleanup runs even when dispatcher `onIdle` does not fire, preventing stuck typing indicators after run completion. (#27250) Thanks @Sid-Qin.
@@ -2940,7 +2922,7 @@ Docs: https://docs.openclaw.ai
- Agents/Canvas default node resolution: when multiple connected canvas-capable nodes exist and no single `mac-*` candidate is selected, default to the first connected candidate instead of failing with `node required` for implicit-node canvas tool calls. Landed from contributor PR #27444. Thanks @carbaj03.
- TUI/stream assembly: preserve streamed text across real tool-boundary drops without keeping stale streamed text when non-text blocks appear only in the final payload. Landed from contributor PR #27711 by @scz2011. (#27674)
- Hooks/Internal `message:sent`: forward `sessionKey` on outbound sends from agent delivery, cron isolated delivery, gateway receipt acks, heartbeat sends, session-maintenance warnings, and restart-sentinel recovery so internal `message:sent` hooks consistently dispatch with session context, including `openclaw agent --deliver` runs resumed via `--session-id` (without explicit `--session-key`). Landed from contributor PR #27584. Thanks @qualiobra.
- Pi image-token usage: stop re-injecting history image blocks each turn, process image references from the current prompt only, and prune already-answered user-image blocks in stored history to prevent runaway token growth. (#27602) Thanks @steipete.
- Pi image-token usage: stop re-injecting history image blocks each turn, process image references from the current prompt only, and prune already-answered user-image blocks in stored history to prevent runaway token growth. (#27602)
- BlueBubbles/SSRF: auto-allowlist the configured `serverUrl` hostname for attachment fetches so localhost/private-IP BlueBubbles setups are no longer false-blocked by default SSRF checks. Landed from contributor PR #27648 by @lailoo. (#27599) Thanks @taylorhou for reporting.
- Agents/Compaction + onboarding safety: prevent destructive double-compaction by stripping stale assistant usage around compaction boundaries, skipping post-compaction custom metadata writes in the same attempt, and cancelling safeguard compaction when there are no real conversation messages to summarize; harden workspace/bootstrap detection for memory-backed workspaces; and change `openclaw onboard --reset` default scope to `config+creds+sessions` (workspace deletion now requires `--reset-scope full`). (#26458, #27314) Thanks @jaden-clovervnd, @Sid-Qin, and @widingmarcus-cyber for fix direction in #26502, #26529, and #27492.
- NO_REPLY suppression: suppress `NO_REPLY` before Slack API send and in sub-agent announce completion flow so sentinel text no longer leaks into user channels. Landed from contributor PRs #27529 (by @Sid-Qin) and #27535 (rewritten minimal landing by maintainers). (#27387, #27531)
@@ -2962,7 +2944,7 @@ Docs: https://docs.openclaw.ai
- LINE/Inline directives auth: gate directive parsing (`/model`, `/think`, `/verbose`, `/reasoning`, `/queue`) on resolved authorization (`command.isAuthorizedSender`) so `commands.allowFrom`-authorized LINE senders are not silently stripped when raw `CommandAuthorized` is unset. Landed from contributor PR #27248 by @kevinWangSheng. (#27240)
- Onboarding/Gateway: seed default Control UI `allowedOrigins` for non-loopback binds during onboarding (`localhost`/`127.0.0.1` plus custom bind host) so fresh non-loopback setups do not fail startup due to missing origin policy. (#26157) thanks @stakeswky.
- Docker/GCP onboarding: reduce first-build OOM risk by capping Node heap during `pnpm install`, reuse existing gateway token during `docker-setup.sh` reruns so `.env` stays aligned with config, auto-bootstrap Control UI allowed origins for non-loopback Docker binds, and add GCP docs guidance for tokenized dashboard links + pairing recovery commands. (#26253) Thanks @pandego.
- CLI/Gateway `--force` in non-root Docker: recover from `lsof` permission failures (`EACCES`/`EPERM`) by falling back to `fuser` kill + probe-based port checks, so `openclaw gateway --force` works for default container `node` user flows. (#27941) Thanks @steipete.
- CLI/Gateway `--force` in non-root Docker: recover from `lsof` permission failures (`EACCES`/`EPERM`) by falling back to `fuser` kill + probe-based port checks, so `openclaw gateway --force` works for default container `node` user flows. (#27941)
- Gateway/Bind visibility: emit a startup warning when binding to non-loopback addresses so operators get explicit exposure guidance in runtime logs. (#25397) thanks @let5sne.
- Sessions cleanup/Doctor: add `openclaw sessions cleanup --fix-missing` to prune store entries whose transcript files are missing, including doctor guidance and CLI coverage. Landed from contributor PR #27508 by @Sid-Qin. (#27422)
- Doctor/State integrity: ignore metadata-only slash routing sessions when checking recent missing transcripts so `openclaw doctor` no longer reports false-positive transcript-missing warnings for `*:slash:*` keys. (#27375) thanks @gumadeiras.
@@ -3024,24 +3006,24 @@ Docs: https://docs.openclaw.ai
- Slack/Threading: stop forcing tool-call reply mode to `all` based on `ThreadLabel` alone; now force thread reply mode only when an explicit thread target exists (`MessageThreadId`/`ReplyToId`), so DM `replyToModeByChatType.direct` overrides are honored outside real thread replies. (#26251) Thanks @dbachelder.
- Slack/Threading: when `replyToMode="all"` auto-threads top-level Slack DMs, seed the thread session key from the message `ts` so the initial message and later replies share the same isolated `:thread:` session instead of falling back to base DM context. (#26849) Thanks @calder-sandy.
- Agents/Subagents delivery: refactor subagent completion announce dispatch into an explicit queue/direct/fallback state machine, recover outbound channel-plugin resolution in cold/stale plugin-registry states across announce/message/gateway send paths, finalize cleanup bookkeeping when announce flow rejects, and treat Telegram sends without `message_id` as delivery failures (instead of false-success `"unknown"` IDs). (#26867, #25961, #26803, #25069, #26741) Thanks @SmithLabsLLC and @docaohieu2808.
- Telegram/Webhook: pre-initialize webhook bots, switch webhook processing to callback-mode JSON handling, and preserve full near-limit payload reads under delayed handlers to prevent webhook request hangs and dropped updates. (#26156) Thanks @steipete.
- Telegram/Webhook: pre-initialize webhook bots, switch webhook processing to callback-mode JSON handling, and preserve full near-limit payload reads under delayed handlers to prevent webhook request hangs and dropped updates. (#26156)
- Slack/Session threads: prevent oversized parent-session inheritance from silently bricking new thread sessions, surface embedded context-overflow empty-result failures to users, and add configurable `session.parentForkMaxTokens` (default `100000`, `0` disables). (#26912) Thanks @markshields-tl.
- Cron/Message multi-account routing: honor explicit `delivery.accountId` for isolated cron delivery resolution, and when `message.send` omits `accountId`, fall back to the sending agent's bound channel account instead of defaulting to the global account. (#27015, #26975) Thanks @lbo728 and @stakeswky.
- Gateway/Message media roots: thread `agentId` through gateway `send` RPC and prefer explicit `agentId` over session/default resolution so non-default agent workspace media sends no longer fail with `LocalMediaAccessError`; added regression coverage for agent precedence and blank-agent fallback. (#23249) Thanks @Sid-Qin.
- Followups/Routing: when explicit origin routing fails, allow same-channel fallback dispatch (while still blocking cross-channel fallback) so followup replies do not get dropped on transient origin-adapter failures. (#26109) Thanks @Sid-Qin.
- Cron/Announce duplicate guard: track attempted announce/direct delivery separately from confirmed `delivered`, and suppress fallback main-session cron summaries when delivery was already attempted to avoid duplicate end-user sends in uncertain-ack paths. (#27018) Thanks @steipete.
- Cron/Announce duplicate guard: track attempted announce/direct delivery separately from confirmed `delivered`, and suppress fallback main-session cron summaries when delivery was already attempted to avoid duplicate end-user sends in uncertain-ack paths. (#27018)
- LINE/Lifecycle: keep LINE `startAccount` pending until abort so webhook startup is no longer misread as immediate channel exit, preventing restart-loop storms on LINE provider boot. (#26528) Thanks @Sid-Qin.
- Discord/Gateway: capture and drain startup-time gateway `error` events before lifecycle listeners attach so early `Fatal Gateway error: 4014` closes surface as actionable intent guidance instead of uncaught gateway crashes. (#23832) Thanks @theotarr.
- Discord/Inbound text: preserve embed `title` + `description` fallback text in message and forwarded snapshot parsing so embed titles are not silently dropped from agent input. (#26946) Thanks @stakeswky.
- Slack/Inbound media fallback: deliver file-only messages even when Slack media downloads fail by adding a filename placeholder fallback, capping fallback names to the shared media-file limit, and normalizing empty filenames to `file` so attachment-only messages are not silently dropped. (#25181) Thanks @justinhuangcode.
- Telegram/Preview cleanup: keep finalized text previews when a later assistant message is media-only (for example mixed text plus voice turns) by skipping finalized preview archival at assistant-message boundaries, preventing cleanup from deleting already-visible final text messages. (#27042) Thanks @steipete.
- Telegram/Preview cleanup: keep finalized text previews when a later assistant message is media-only (for example mixed text plus voice turns) by skipping finalized preview archival at assistant-message boundaries, preventing cleanup from deleting already-visible final text messages. (#27042)
- Telegram/Markdown spoilers: keep valid `||spoiler||` pairs while leaving unmatched trailing `||` delimiters as literal text, avoiding false all-or-nothing spoiler suppression. (#26105) Thanks @Sid-Qin.
- Slack/Allowlist channels: match channel IDs case-insensitively during channel allowlist resolution so lowercase config keys (for example `c0abc12345`) correctly match Slack runtime IDs (`C0ABC12345`) under `groupPolicy: "allowlist"`, preventing silent channel-event drops. (#26878) Thanks @lbo728.
- Discord/Typing indicator: prevent stuck typing indicators by sealing channel typing keepalive callbacks after idle/cleanup and ensuring Discord dispatch always marks typing idle even if preview-stream cleanup fails. (#26295) Thanks @ngutman.
- Channels/Typing indicator: guard typing keepalive start callbacks after idle/cleanup close so post-close ticks cannot re-trigger stale typing indicators. (#26325) Thanks @win4r.
- Followups/Typing indicator: ensure followup turns mark dispatch idle on every exit path (including `NO_REPLY`, empty payloads, and agent errors) so typing keepalive cleanup always runs and channel typing indicators do not get stuck after queued/silent followups. (#26881) Thanks @codexGW.
- Voice-call/TTS tools: hide the `tts` tool when the message provider is `voice`, preventing voice-call runs from selecting self-playback TTS and falling into silent no-output loops. (#27025) Thanks @steipete.
- Agents/Tools: normalize non-standard plugin tool results that omit `content` so embedded runs no longer crash with `Cannot read properties of undefined (reading 'filter')` after tool completion (including `tesseramemo_query`). (#27007) Thanks @steipete.
- Voice-call/TTS tools: hide the `tts` tool when the message provider is `voice`, preventing voice-call runs from selecting self-playback TTS and falling into silent no-output loops. (#27025)
- Agents/Tools: normalize non-standard plugin tool results that omit `content` so embedded runs no longer crash with `Cannot read properties of undefined (reading 'filter')` after tool completion (including `tesseramemo_query`). (#27007)
- Agents/Tool-call dispatch: trim whitespace-padded tool names in both transcript repair and live streamed embedded-runner responses so exact-match tool lookup no longer fails with `Tool ... not found` for model outputs like `" read "`. (#27094) Thanks @openperf and @Sid-Qin.
- Cron/Model overrides: when isolated `payload.model` is no longer allowlisted, fall back to default model selection instead of failing the job, while still returning explicit errors for invalid model strings. (#26717) Thanks @Youyou972.
- Agents/Model fallback: keep explicit text + image fallback chains reachable even when `agents.defaults.models` allowlists are present, prefer explicit run `agentId` over session-key parsing for followup fallback override resolution (with session-key fallback), treat agent-level fallback overrides as configured in embedded runner preflight, and classify `model_cooldown` / `cooling down` errors as `rate_limit` so failover continues. (#11972, #24137, #17231)
@@ -3087,7 +3069,7 @@ Docs: https://docs.openclaw.ai
### Changes
- Auto-reply/Abort shortcuts: expand standalone stop phrases (`stop openclaw`, `stop action`, `stop run`, `stop agent`, `please stop`, and related variants), accept trailing punctuation (for example `STOP OPENCLAW!!!`), add multilingual stop keywords (including ES/FR/ZH/HI/AR/JP/DE/PT/RU forms), and treat exact `do not do that` as a stop trigger while preserving strict standalone matching. (#25103) Thanks @steipete and @vincentkoc.
- Auto-reply/Abort shortcuts: expand standalone stop phrases (`stop openclaw`, `stop action`, `stop run`, `stop agent`, `please stop`, and related variants), accept trailing punctuation (for example `STOP OPENCLAW!!!`), add multilingual stop keywords (including ES/FR/ZH/HI/AR/JP/DE/PT/RU forms), and treat exact `do not do that` as a stop trigger while preserving strict standalone matching. (#25103) Thanks @vincentkoc.
- Android/App UX: ship a native four-step onboarding flow, move post-onboarding into a five-tab shell (Connect, Chat, Voice, Screen, Settings), add a full Connect setup/manual mode screen, and refresh Android chat/settings surfaces for the new navigation model.
- Talk/Gateway config: add provider-agnostic Talk configuration with legacy compatibility, and expose gateway Talk ElevenLabs config metadata for setup/status surfaces.
- Security/Audit: add `security.trust_model.multi_user_heuristic` to flag likely shared-user ingress and clarify the personal-assistant trust model, with hardening guidance for intentional multi-user setups (`sandbox.mode="all"`, workspace-scoped FS, reduced tool surface, no personal/private identities on shared runtimes).
@@ -3097,7 +3079,7 @@ Docs: https://docs.openclaw.ai
- Routing/Session isolation: harden followup routing so explicit cross-channel origin replies never fall back to the active dispatcher on route failure, preserve queued overflow summary routing metadata (`channel`/`to`/`thread`) across followup drain, and prefer originating channel context over internal provider tags for embedded followup runs. This prevents webchat/control-ui context from hijacking Discord-targeted replies in shared sessions. (#25864) Thanks @Gamedesigner.
- Security/Routing: fail closed for shared-session cross-channel replies by binding outbound target resolution to the current turn's source channel metadata (instead of stale session route fallbacks), and wire those turn-source fields through gateway + command delivery planners with regression coverage. (#24571) Thanks @brandonwise.
- Heartbeat routing: prevent heartbeat leakage/spam into Discord and other direct-message destinations by blocking direct-chat heartbeat delivery targets and keeping blocked-delivery cron/exec prompts internal-only. (#25871) Thanks @steipete.
- Heartbeat routing: prevent heartbeat leakage/spam into Discord and other direct-message destinations by blocking direct-chat heartbeat delivery targets and keeping blocked-delivery cron/exec prompts internal-only. (#25871)
- Heartbeat defaults/prompts: switch the implicit heartbeat delivery target from `last` to `none` (opt-in for external delivery), and use internal-only cron/exec heartbeat prompt wording when delivery is disabled so background checks do not nudge user-facing relay behavior. (#25871, #24638, #25851)
- Auto-reply/Heartbeat queueing: drop heartbeat runs when a session already has an active run instead of enqueueing a stale followup, preventing duplicate heartbeat response branches after queue drain. (#25610, #25606) Thanks @mcaxtr.
- Cron/Heartbeat delivery: stop inheriting cached session `lastThreadId` for heartbeat-mode target resolution unless a thread/topic is explicitly requested, so announce-mode cron and heartbeat deliveries stay on top-level destinations instead of leaking into active conversation threads. (#25730) Thanks @markshields-tl.
@@ -3130,7 +3112,7 @@ Docs: https://docs.openclaw.ai
- Windows/Media safety checks: align async local-file identity validation with sync-safe-open behavior by treating win32 `dev=0` stats as unknown-device fallbacks (while keeping strict dev checks when both sides are non-zero), fixing false `Local media path is not safe to read` drops for local attachments/TTS/images. (#25708, #21989, #25699, #25878) Thanks @kevinWangSheng.
- iMessage/Reasoning safety: harden iMessage echo suppression with outbound `messageId` matching (plus scoped text fallback), and enforce reasoning-payload suppression on routed outbound delivery paths to prevent hidden thinking text from being sent as user-visible channel messages. (#25897, #1649, #25757) Thanks @rmarr and @Iranb.
- Providers/OpenRouter/Auth profiles: bypass auth-profile cooldown/disable windows for OpenRouter, so provider failures no longer put OpenRouter profiles into local cooldown and stale legacy cooldown markers are ignored in fallback and status selection paths. (#25892) Thanks @alexanderatallah for raising this and @vincentkoc for the fix.
- Providers/Google reasoning: sanitize invalid negative `thinkingBudget` payloads for Gemini 3.1 requests by dropping `-1` budgets and mapping configured reasoning effort to `thinkingLevel`, preventing malformed reasoning payloads on `google-generative-ai`. (#25900) Thanks @steipete.
- Providers/Google reasoning: sanitize invalid negative `thinkingBudget` payloads for Gemini 3.1 requests by dropping `-1` budgets and mapping configured reasoning effort to `thinkingLevel`, preventing malformed reasoning payloads on `google-generative-ai`. (#25900)
- Providers/SiliconFlow: normalize `thinking="off"` to `thinking: null` for `Pro/*` model payloads to avoid provider-side 400 loops and misleading compaction retries. (#25435) Thanks @Zjianru.
- Models/Bedrock auth: normalize additional Bedrock provider aliases (`bedrock`, `aws-bedrock`, `aws_bedrock`, `amazon bedrock`) to canonical `amazon-bedrock`, ensuring auth-mode resolution consistently selects AWS SDK fallback. (#25756) Thanks @fwhite13.
- Models/Providers: preserve explicit user `reasoning` overrides when merging provider model config with built-in catalog metadata, so `reasoning: false` is no longer overwritten by catalog defaults. (#25314) Thanks @lbo728.
@@ -3226,7 +3208,7 @@ Docs: https://docs.openclaw.ai
- Providers/Groq: avoid classifying Groq TPM limit errors as context overflow so throttling paths no longer trigger overflow recovery logic. (#16176) Thanks @dddabtc.
- Gateway/Restart: treat child listener PIDs as owned by the service runtime PID during restart health checks to avoid false stale-process kills and restart timeouts on launchd/systemd. (#24696) Thanks @gumadeiras.
- Config/Write: apply `unsetPaths` with immutable path-copy updates so config writes never mutate caller-provided objects, and harden `openclaw config get/set/unset` path traversal by rejecting prototype-key segments and inherited-property traversal. (#24134) thanks @frankekn.
- Channels/WhatsApp: accept `channels.whatsapp.enabled` in config validation to match built-in channel auto-enable behavior, preventing `Unrecognized key: "enabled"` failures during channel setup. (#24263) Thanks @steipete.
- Channels/WhatsApp: accept `channels.whatsapp.enabled` in config validation to match built-in channel auto-enable behavior, preventing `Unrecognized key: "enabled"` failures during channel setup. (#24263)
- Security/Exec: detect obfuscated commands before exec allowlist decisions and require explicit approval for obfuscation patterns. (#8592) Thanks @CornBrother0x and @vincentkoc.
- Security/ACP: harden ACP client permission auto-approval to require trusted core tool IDs, ignore untrusted `toolCall.kind` hints, and scope `read` auto-approval to the active working directory so unknown tool names and out-of-scope file reads always prompt. Thanks @nedlir for reporting.
- Security/Skills: escape user-controlled prompt, filename, and output-path values in `openai-image-gen` HTML gallery generation to prevent stored XSS in generated `index.html` output. (#12538) Thanks @CornBrother0x.
@@ -3251,7 +3233,7 @@ Docs: https://docs.openclaw.ai
- Update/Core: add an optional built-in auto-updater for package installs (`update.auto.*`), default-off, with stable rollout delay+jitter and beta hourly cadence.
- CLI/Update: add `openclaw update --dry-run` to preview channel/tag/target/restart actions without mutating config, installing, syncing plugins, or restarting.
- Config/UI: add tag-aware settings filtering and broaden config labels/help copy so fields are easier to discover and understand in the dashboard config screen.
- Channels/Synology Chat: add a native Synology Chat channel plugin with webhook ingress, direct-message routing, outbound send/media support, per-account config, and DM policy controls. (#23012) Thanks @steipete.
- Channels/Synology Chat: add a native Synology Chat channel plugin with webhook ingress, direct-message routing, outbound send/media support, per-account config, and DM policy controls. (#23012)
- iOS/Talk: prefetch TTS segments and suppress expected speech-cancellation errors for smoother talk playback. (#22833) Thanks @ngutman.
- Memory/FTS: add Spanish and Portuguese stop-word filtering for query expansion in FTS-only search mode, improving conversational recall for both languages. Thanks @vincentkoc.
- Memory/FTS: add Japanese-aware query expansion tokenization and stop-word filtering (including mixed-script terms like ASCII + katakana) for FTS-only search mode. Thanks @vincentkoc.
@@ -3273,10 +3255,10 @@ Docs: https://docs.openclaw.ai
- Agents/Moonshot: force `supportsDeveloperRole=false` for Moonshot-compatible `openai-completions` models (provider `moonshot` and Moonshot base URLs), so initial runs no longer send unsupported `developer` roles that trigger `ROLE_UNSPECIFIED` errors. (#21060, #22194) Thanks @ShengFuC.
- Agents/Kimi: classify Moonshot `Your request exceeded model token limit` failures as context overflows so auto-compaction and user-facing overflow recovery trigger correctly instead of surfacing raw invalid-request errors. (#9562) Thanks @danilofalcao.
- Providers/Moonshot: mark Kimi K2.5 as image-capable in implicit + onboarding model definitions, and refresh stale explicit provider capability fields (`input`/`reasoning`/context limits) from implicit catalogs so existing configs pick up Moonshot vision support without manual model rewrites. (#13135, #4459) Thanks @manikv12.
- Agents/Transcript: enable consecutive-user turn merging for strict non-OpenAI `openai-completions` providers (for example Moonshot/Kimi), reducing `roles must alternate` ordering failures on OpenAI-compatible endpoints while preserving current OpenRouter/Opencode behavior. (#7693) Thanks @steipete.
- Agents/Transcript: enable consecutive-user turn merging for strict non-OpenAI `openai-completions` providers (for example Moonshot/Kimi), reducing `roles must alternate` ordering failures on OpenAI-compatible endpoints while preserving current OpenRouter/Opencode behavior. (#7693)
- Install/Discord Voice: make the native Opus decoder optional so `openclaw` install/update no longer hard-fails when native builds fail, while keeping `opusscript` as the runtime fallback decoder for Discord voice flows. (#23737, #23733, #23703) Thanks @jeadland, @Sheetaa, and @Breakyman.
- Docker/Setup: precreate `$OPENCLAW_CONFIG_DIR/identity` during `docker-setup.sh` so CLI commands that need device identity (for example `devices list`) avoid `EACCES ... /home/node/.openclaw/identity` failures on restrictive bind mounts. (#23948) Thanks @ackson-beep.
- Exec/Background: stop applying the default exec timeout to background sessions (`background: true` or explicit `yieldMs`) when no explicit timeout is set, so long-running background jobs are no longer terminated at the default timeout boundary. (#23303) Thanks @steipete.
- Exec/Background: stop applying the default exec timeout to background sessions (`background: true` or explicit `yieldMs`) when no explicit timeout is set, so long-running background jobs are no longer terminated at the default timeout boundary. (#23303)
- Slack/Threading: sessions: keep parent-session forking and thread-history context active beyond first turn by removing first-turn-only gates in session init, thread-history fetch, and reply prompt context injection. (#23843, #23090) Thanks @vincentkoc and @Taskle.
- Slack/Threading: respect `replyToMode` when Slack auto-populates top-level `thread_ts`, and ignore inline `replyToId` directive tags when `replyToMode` is `off` so thread forcing stays disabled unless explicitly configured. (#23839, #23320, #23513) Thanks @vincentkoc and @dorukardahan.
- Slack/Extension: forward `message read` `threadId` to `readMessages` and use delivery-context `threadId` as outbound `thread_ts` fallback so extension replies/reads stay in the correct Slack thread. (#22216, #22485, #23836) Thanks @vincentkoc, @lan17 and @dorukardahan.
@@ -3296,7 +3278,7 @@ Docs: https://docs.openclaw.ai
- Telegram/Webhook: add `channels.telegram.webhookPort` config support and pass it through plugin startup wiring to the monitor listener.
- Browser/Extension Relay: refactor the MV3 worker to preserve debugger attachments across relay drops, auto-reconnect with bounded backoff+jitter, persist and rehydrate attached tab state via `chrome.storage.session`, recover from `target_closed` navigation detaches, guard stale socket handlers, enforce per-tab operation locks and per-request timeouts, and add lifecycle keepalive/badge refresh hooks (`alarms`, `webNavigation`). (#15099, #6175, #8468, #9807)
- Browser/Relay: treat extension websocket as connected only when `OPEN`, allow reconnect when a stale `CLOSING/CLOSED` extension socket lingers, and guard stale socket message/close handlers so late events cannot clear active relay state; includes regression coverage for live-duplicate `409` rejection and immediate reconnect-after-close races. (#15099, #18698, #20688)
- Browser/Remote CDP: extend stale-target recovery so `ensureTabAvailable()` now reuses the sole available tab for remote CDP profiles (same behavior as extension profiles) while preserving strict `tab not found` errors when multiple tabs exist; includes remote-profile regression tests. (#15989) Thanks @steipete.
- Browser/Remote CDP: extend stale-target recovery so `ensureTabAvailable()` now reuses the sole available tab for remote CDP profiles (same behavior as extension profiles) while preserving strict `tab not found` errors when multiple tabs exist; includes remote-profile regression tests. (#15989)
- Gateway/Pairing: treat `operator.admin` as satisfying other `operator.*` scope checks during device-auth verification so local CLI/TUI sessions stop entering pairing-required loops for pairing/approval-scoped commands. (#22062, #22193, #21191) Thanks @Botaccess, @jhartshorn, and @ctbritt.
- Gateway/Pairing: auto-approve loopback `scope-upgrade` pairing requests (including device-token reconnects) so local clients do not disconnect on pairing-required scope elevation. (#23708) Thanks @widingmarcus-cyber.
- Gateway/Scopes: include `operator.read` and `operator.write` in default operator connect scope bundles across CLI, Control UI, and macOS clients so write-scoped announce/sub-agent follow-up calls no longer hit `pairing required` disconnects on loopback gateways. (#22582) thanks @YuzuruS.
@@ -3334,25 +3316,25 @@ Docs: https://docs.openclaw.ai
- Security/Group policy: harden `channels.*.groups.*.toolsBySender` matching by requiring explicit sender-key types (`id:`, `e164:`, `username:`, `name:`), preventing cross-identifier collisions across mutable/display-name fields while keeping legacy untyped keys on a deprecated ID-only path. Thanks @jiseoung for reporting.
- Channels/Group policy: fail closed when `groupPolicy: "allowlist"` is set without explicit `groups`, honor account-level `groupPolicy` overrides, and enforce `groupPolicy: "disabled"` as a hard group block. (#22215) Thanks @etereo.
- Telegram/Discord extensions: propagate trusted `mediaLocalRoots` through extension outbound `sendMedia` options so extension direct-send media paths honor agent-scoped local-media allowlists. (#20029, #21903, #23227)
- Agents/Exec: honor explicit agent context when resolving `tools.exec` defaults for runs with opaque/non-agent session keys, so per-agent `host/security/ask` policies are applied consistently. (#11832) Thanks @steipete.
- Agents/Exec: honor explicit agent context when resolving `tools.exec` defaults for runs with opaque/non-agent session keys, so per-agent `host/security/ask` policies are applied consistently. (#11832)
- CLI/Sessions: resolve implicit session-store path templates with the configured default agent ID so named-agent setups do not silently read/write stale `agent:main` session/auth stores. (#22685) Thanks @sene1337.
- Doctor/Security: add an explicit warning that `approvals.exec.enabled=false` disables forwarding only, while enforcement remains driven by host-local `exec-approvals.json` policy. (#15047) Thanks @steipete.
- Sandbox/Docker: default sandbox container user to the workspace owner `uid:gid` when `agents.*.sandbox.docker.user` is unset, fixing non-root gateway file-tool permissions under capability-dropped containers. (#20979) Thanks @steipete.
- Doctor/Security: add an explicit warning that `approvals.exec.enabled=false` disables forwarding only, while enforcement remains driven by host-local `exec-approvals.json` policy. (#15047)
- Sandbox/Docker: default sandbox container user to the workspace owner `uid:gid` when `agents.*.sandbox.docker.user` is unset, fixing non-root gateway file-tool permissions under capability-dropped containers. (#20979)
- Plugins/Media sandbox: propagate trusted `mediaLocalRoots` through plugin action dispatch (including Discord/Telegram action adapters) so plugin send paths enforce the same agent-scoped local-media sandbox roots as core outbound sends. (#20258, #22718)
- Agents/Workspace guard: map sandbox container-workdir file-tool paths (for example `/workspace/...` and `file:///workspace/...`) to host workspace roots before workspace-only validation, preventing false `Path escapes sandbox root` rejections for sandbox file tools. (#9560) Thanks @steipete.
- Gateway/Exec approvals: expire approval requests immediately when no approval-capable gateway clients are connected and no forwarding targets are available, avoiding delayed approvals after restarts/offline approver windows. (#22144) Thanks @steipete.
- Agents/Workspace guard: map sandbox container-workdir file-tool paths (for example `/workspace/...` and `file:///workspace/...`) to host workspace roots before workspace-only validation, preventing false `Path escapes sandbox root` rejections for sandbox file tools. (#9560)
- Gateway/Exec approvals: expire approval requests immediately when no approval-capable gateway clients are connected and no forwarding targets are available, avoiding delayed approvals after restarts/offline approver windows. (#22144)
- Security/Exec approvals: when approving wrapper commands with allow-always in allowlist mode, persist inner executable paths for known dispatch wrappers (`env`, `nice`, `nohup`, `stdbuf`, `timeout`) and fail closed (no persisted entry) when wrapper unwrapping is not safe, preventing wrapper-path approval bypasses. Thanks @tdjackey for reporting.
- Node/macOS exec host: default headless macOS node `system.run` to local execution and only route through the companion app when `OPENCLAW_NODE_EXEC_HOST=app` is explicitly set, avoiding companion-app filesystem namespace mismatches during exec. (#23547) Thanks @steipete.
- Node/macOS exec host: default headless macOS node `system.run` to local execution and only route through the companion app when `OPENCLAW_NODE_EXEC_HOST=app` is explicitly set, avoiding companion-app filesystem namespace mismatches during exec. (#23547)
- Sandbox/Media: map container workspace paths (`/workspace/...` and `file:///workspace/...`) back to the host sandbox root for outbound media validation, preventing false deny errors for sandbox-generated local media. (#23083) Thanks @echo931.
- Sandbox/Docker: apply custom bind mounts after workspace mounts and prioritize bind-source resolution on overlapping paths, so explicit workspace binds are no longer ignored. (#22669) Thanks @tasaankaeris.
- Exec approvals/Forwarding: restore Discord text forwarding when component approvals are not configured, and carry request snapshots through resolve events so resolved notices still forward after cache misses/restarts. (#22988) Thanks @bubmiller.
- Control UI/WebSocket: stop and clear the browser gateway client on UI teardown so remounts cannot leave orphan websocket clients that create duplicate active connections. (#23422) Thanks @floatinggball-design.
- Control UI/WebSocket: send a stable per-tab `instanceId` in websocket connect frames so reconnect cycles keep a consistent client identity for diagnostics and presence tracking. (#23616) Thanks @zq58855371-ui.
- Config/Memory: allow `"mistral"` in `agents.defaults.memorySearch.provider` and `agents.defaults.memorySearch.fallback` schema validation. (#14934) Thanks @ThomsenDrake.
- Feishu/Commands: in group chats, command authorization now falls back to top-level `channels.feishu.allowFrom` when per-group `allowFrom` is not set, so `/command` no longer gets blocked by an unintended empty allowlist. (#23756) Thanks @steipete.
- Feishu/Commands: in group chats, command authorization now falls back to top-level `channels.feishu.allowFrom` when per-group `allowFrom` is not set, so `/command` no longer gets blocked by an unintended empty allowlist. (#23756)
- Dev tooling: prevent `CLAUDE.md` symlink target regressions by excluding CLAUDE symlink sentinels from `oxfmt` and marking them `-text` in `.gitattributes`, so formatter/EOL normalization cannot reintroduce trailing-newline targets. Thanks @vincentkoc.
- Agents/Compaction: restore embedded compaction safeguard/context-pruning extension loading in production by wiring bundled extension factories into the resource loader instead of runtime file-path resolution. (#22349; landed from contributor PR #5005 by @Diaspar4u) Thanks @Diaspar4u.
- Feishu/Media: for inbound video messages that include both `file_key` (video) and `image_key` (thumbnail), prefer `file_key` when downloading media so video attachments are saved instead of silently failing on thumbnail keys. (#23633) Thanks @steipete.
- Feishu/Media: for inbound video messages that include both `file_key` (video) and `image_key` (thumbnail), prefer `file_key` when downloading media so video attachments are saved instead of silently failing on thumbnail keys. (#23633)
- Hooks/Loader: avoid redundant hook-module recompilation on gateway restart by skipping cache-busting for bundled hooks and using stable file metadata keys (`mtime+size`) for mutable workspace/managed/plugin hook imports. (#16953) Thanks @mudrii.
- Hooks/Cron: suppress duplicate main-session events for delivered hook turns and mark `SILENT_REPLY_TOKEN` (`NO_REPLY`) early exits as delivered to prevent hook context pollution. (#20678) Thanks @JonathanWorks.
- Providers/OpenRouter: inject `cache_control` on system prompts for OpenRouter Anthropic models to improve prompt-cache reuse. (#17473) Thanks @rrenamed.
@@ -3831,7 +3813,7 @@ Docs: https://docs.openclaw.ai
- Ollama/Qwen: handle Qwen 3 reasoning field format in Ollama responses. (#18631) Thanks @mr-sk.
- OpenAI/Transcripts: always drop orphaned reasoning blocks from transcript repair. (#18632) Thanks @TySabs.
- Fix types in all tests. Typecheck the whole repository.
- Gateway/Channels: wire `gateway.channelHealthCheckMinutes` into strict config validation, treat implicit account status as managed for health checks, and harden channel auto-restart flow (preserve restart-attempt caps across crash loops, propagate enabled/configured runtime flags, and stop pending restart backoff after manual stop). Thanks @steipete.
- Gateway/Channels: wire `gateway.channelHealthCheckMinutes` into strict config validation, treat implicit account status as managed for health checks, and harden channel auto-restart flow (preserve restart-attempt caps across crash loops, propagate enabled/configured runtime flags, and stop pending restart backoff after manual stop).
- Gateway/WebChat: hard-cap `chat.history` oversized payloads by truncating high-cost fields and replacing over-budget entries with placeholders, so history fetches stay within configured byte limits and avoid chat UI freezes. (#18505)
- UI/Usage: replace lingering undefined `var(--text-muted)` usage with `var(--muted)` in usage date-range and chart styles to keep muted text visible across themes. (#17975) Thanks @jogelin.
- UI/Usage: preserve selected-range totals when timeline data is downsampled by bucket-aggregating timeseries points (instead of dropping intermediate points), so filtered tokens/cost stay accurate. (#17959) Thanks @jogelin.
@@ -4841,21 +4823,21 @@ Docs: https://docs.openclaw.ai
- Providers: Ollama discovery + docs; Venice guide upgrades + cross-links. (#1606) Thanks @abhaymundhara. https://docs.openclaw.ai/providers/ollama https://docs.openclaw.ai/providers/venice
- Channels: LINE plugin (Messaging API) with rich replies + quick replies. (#1630) Thanks @plum-dawg.
- TTS: Edge fallback (keyless) + `/tts` auto modes. (#1668, #1667) Thanks @steipete, @sebslight. https://docs.openclaw.ai/tts
- TTS: Edge fallback (keyless) + `/tts` auto modes. (#1668, #1667) Thanks @sebslight. https://docs.openclaw.ai/tts
- Exec approvals: approve in-chat via `/approve` across all channels (including plugins). (#1621) Thanks @czekaj. https://docs.openclaw.ai/tools/exec-approvals https://docs.openclaw.ai/tools/slash-commands
- Telegram: DM topics as separate sessions + outbound link preview toggle. (#1597, #1700) Thanks @rohannagpal, @zerone0x. https://docs.openclaw.ai/channels/telegram
### Changes
- Channels: add LINE plugin (Messaging API) with rich replies, quick replies, and plugin HTTP registry. (#1630) Thanks @plum-dawg.
- TTS: add Edge TTS provider fallback, defaulting to keyless Edge with MP3 retry on format failures. (#1668) Thanks @steipete. https://docs.openclaw.ai/tts
- TTS: add Edge TTS provider fallback, defaulting to keyless Edge with MP3 retry on format failures. (#1668) https://docs.openclaw.ai/tts
- TTS: add auto mode enum (off/always/inbound/tagged) with per-session `/tts` override. (#1667) Thanks @sebslight. https://docs.openclaw.ai/tts
- Telegram: treat DM topics as separate sessions and keep DM history limits stable with thread suffixes. (#1597) Thanks @rohannagpal.
- Telegram: add `channels.telegram.linkPreview` to toggle outbound link previews. (#1700) Thanks @zerone0x. https://docs.openclaw.ai/channels/telegram
- Web search: add Brave freshness filter parameter for time-scoped results. (#1688) Thanks @JonUleis. https://docs.openclaw.ai/tools/web
- UI: refresh Control UI dashboard design system (colors, icons, typography). (#1745, #1786) Thanks @EnzeD, @mousberg.
- Exec approvals: forward approval prompts to chat with `/approve` for all channels (including plugins). (#1621) Thanks @czekaj. https://docs.openclaw.ai/tools/exec-approvals https://docs.openclaw.ai/tools/slash-commands
- Gateway: expose config.patch in the gateway tool with safe partial updates + restart sentinel. (#1653) Thanks @steipete.
- Gateway: expose config.patch in the gateway tool with safe partial updates + restart sentinel. (#1653)
- Diagnostics: add diagnostic flags for targeted debug logs (config + env override). https://docs.openclaw.ai/diagnostics/flags
- Docs: expand FAQ (migration, scheduling, concurrency, model recommendations, OpenAI subscription auth, Pi sizing, hackable install, docs SSL workaround).
- Docs: add verbose installer troubleshooting guidance.
@@ -4868,9 +4850,9 @@ Docs: https://docs.openclaw.ai
- Web UI: fix config/debug layout overflow, scrolling, and code block sizing. (#1715) Thanks @saipreetham589.
- Web UI: show Stop button during active runs, swap back to New session when idle. (#1664) Thanks @ndbroadbent.
- Web UI: clear stale disconnect banners on reconnect; allow form saves with unsupported schema paths but block missing schema. (#1707) Thanks @steipete.
- Web UI: clear stale disconnect banners on reconnect; allow form saves with unsupported schema paths but block missing schema. (#1707)
- Web UI: hide internal `message_id` hints in chat bubbles.
- Gateway: allow Control UI token-only auth to skip device pairing even when device identity is present (`gateway.controlUi.allowInsecureAuth`). (#1679) Thanks @steipete.
- Gateway: allow Control UI token-only auth to skip device pairing even when device identity is present (`gateway.controlUi.allowInsecureAuth`). (#1679)
- Matrix: decrypt E2EE media attachments with preflight size guard. (#1744) Thanks @araa47.
- BlueBubbles: route phone-number targets to DMs, avoid leaking routing IDs, and auto-create missing DMs (Private API required). (#1751) Thanks @tyler6204. https://docs.openclaw.ai/channels/bluebubbles
- BlueBubbles: keep part-index GUIDs in reply tags when short IDs are missing.
@@ -4943,7 +4925,7 @@ Docs: https://docs.openclaw.ai
- Heartbeat: accept plugin channel ids for heartbeat target validation + UI hints.
- Messaging/Sessions: mirror outbound sends into target session keys (threads + dmScope), create session entries on send, and normalize session key casing. (#1520, commit 4b6cdd1d3)
- Sessions: reject array-backed session stores to prevent silent wipes. (#1469)
- Gateway: compare Linux process start time to avoid PID recycling lock loops; keep locks unless stale. (#1572) Thanks @steipete.
- Gateway: compare Linux process start time to avoid PID recycling lock loops; keep locks unless stale. (#1572)
- Gateway: accept null optional fields in exec approval requests. (#1511) Thanks @pvoo.
- Exec approvals: persist allowlist entry ids to keep macOS allowlist rows stable. (#1521) Thanks @ngutman.
- Exec: honor tools.exec ask/security defaults for elevated approvals (avoid unwanted prompts). (commit 5662a9cdf)
@@ -5249,7 +5231,7 @@ Docs: https://docs.openclaw.ai
- macOS: bundle Textual resources in packaged app builds to avoid code block crashes. (#1006)
- Daemon: include HOME in service environments to avoid missing HOME errors. (#1214)
Thanks @AlexMikhalev, @CoreyH, @John-Rood, @KrauseFx, @MaudeBot, @Nachx639, @NicholaiVogel, @RyanLisse, @ThePickle31, @VACInc, @Whoaa512, @YuriNachos, @aaronveklabs, @abdaraxus, @alauppe, @ameno-, @artuskg, @austinm911, @bradleypriest, @cheeeee, @dougvk, @fogboots, @gnarco, @gumadeiras, @jdrhyne, @joelklabo, @longmaba, @mukhtharcm, @odysseus0, @oscargavin, @rhjoh, @sebslight, @sibbl, @sleontenko, @steipete, @suminhthanh, @thewilloftheshadow, @tyler6204, @vignesh07, @visionik, @ysqander, @zerone0x.
Thanks @AlexMikhalev, @CoreyH, @John-Rood, @KrauseFx, @MaudeBot, @Nachx639, @NicholaiVogel, @RyanLisse, @ThePickle31, @VACInc, @Whoaa512, @YuriNachos, @aaronveklabs, @abdaraxus, @alauppe, @ameno-, @artuskg, @austinm911, @bradleypriest, @cheeeee, @dougvk, @fogboots, @gnarco, @gumadeiras, @jdrhyne, @joelklabo, @longmaba, @mukhtharcm, @odysseus0, @oscargavin, @rhjoh, @sebslight, @sibbl, @sleontenko, @suminhthanh, @thewilloftheshadow, @tyler6204, @vignesh07, @visionik, @ysqander, @zerone0x.
### Breaking
@@ -5618,7 +5600,7 @@ Thanks @AlexMikhalev, @CoreyH, @John-Rood, @KrauseFx, @MaudeBot, @Nachx639, @Nic
- Gateway/CLI: honor `CLAWDBOT_LAUNCHD_LABEL` / `CLAWDBOT_SYSTEMD_UNIT` overrides; `agents.list` respects explicit config; reduce noisy loopback WS logs during tests; run `openclaw doctor --non-interactive` during updates. (#781) - thanks @ronyrus.
- Onboarding/Control UI: refuse invalid configs (run doctor first); quote Windows browser URLs for OAuth; keep chat scroll position unless the user is near the bottom. (#764) - thanks @mukhtharcm; (#794) - thanks @roshanasingh4; (#217) - thanks @thewilloftheshadow.
- Tools/UI: harden tool input schemas for strict providers; drop null-only union variants for Gemini schema cleanup; treat `maxChars: 0` as unlimited; keep TUI last streamed response instead of "(no output)". (#782) - thanks @AbhisekBasu1; (#796) - thanks @gabriel-trigo; (#747) - thanks @thewilloftheshadow.
- Connections UI: polish multi-account account cards. (#816) - thanks @steipete.
- Connections UI: polish multi-account account cards. (#816)
### Installer
@@ -5658,7 +5640,7 @@ Thanks @AlexMikhalev, @CoreyH, @John-Rood, @KrauseFx, @MaudeBot, @Nachx639, @Nic
- Tests: add Docker plugin loader + tgz-install smoke test.
- Tests: extend Docker plugin E2E to cover installing from local folders (`plugins.load.paths`) and `file:` npm specs.
- Tests: add coverage for pre-compaction memory flush settings.
- Tests: modernize live model smoke selection for current releases and enforce tools/images/thinking-high coverage. (#769) - thanks @steipete.
- Tests: modernize live model smoke selection for current releases and enforce tools/images/thinking-high coverage. (#769)
- Agents/Tools: add `apply_patch` tool for multi-file edits (experimental; gated by tools.exec.applyPatch; OpenAI-only).
- Agents/Tools: rename the bash tool to exec (config alias maintained). (#748) - thanks @myfunc.
- Agents: add pre-compaction memory flush config (`agents.defaults.compaction.*`) with a soft threshold + system prompt.
@@ -5678,8 +5660,8 @@ Thanks @AlexMikhalev, @CoreyH, @John-Rood, @KrauseFx, @MaudeBot, @Nachx639, @Nic
### Fixes
- Models/Onboarding: configure MiniMax (minimax.io) via Anthropic-compatible `/anthropic` endpoint by default (keep `minimax-api` as a legacy alias).
- Models: normalize Gemini 3 Pro/Flash IDs to preview names for live model lookups. (#769) - thanks @steipete.
- CLI: fix guardCancel typing for configure prompts. (#769) - thanks @steipete.
- Models: normalize Gemini 3 Pro/Flash IDs to preview names for live model lookups. (#769)
- CLI: fix guardCancel typing for configure prompts. (#769)
- Gateway/WebChat: include handshake validation details in the WebSocket close reason for easier debugging; preserve close codes.
- Gateway/Auth: send invalid connect responses before closing the handshake; stabilize invalid-connect auth test.
- Gateway: tighten gateway listener detection.
@@ -5696,7 +5678,7 @@ Thanks @AlexMikhalev, @CoreyH, @John-Rood, @KrauseFx, @MaudeBot, @Nachx639, @Nic
- Auto-reply: align `/think` default display with model reasoning defaults. (#751) - thanks @gabriel-trigo.
- Auto-reply: flush block reply buffers on tool boundaries. (#750) - thanks @sebslight.
- Auto-reply: allow sender fallback for command authorization when `SenderId` is empty (WhatsApp self-chat). (#755) - thanks @juanpablodlc.
- Auto-reply: treat whitespace-only sender ids as missing for command authorization (WhatsApp self-chat). (#766) - thanks @steipete.
- Auto-reply: treat whitespace-only sender ids as missing for command authorization (WhatsApp self-chat). (#766)
- Heartbeat: refresh prompt text for updated defaults.
- Memory/QMD: prefer `qmd collection add --glob` for current QMD releases and fall back to legacy `--mask` when older builds reject it. (#55123) Thanks @ForceConstant and @vincentkoc.
- Agents/Tools: use PowerShell on Windows to capture system utility output. (#748) - thanks @myfunc.

View File

@@ -6,6 +6,7 @@ We monitor security signals from:
- GitHub Security Advisories (GHSA) and private vulnerability reports.
- Public GitHub issues/discussions when reports are not sensitive.
- Official plublic discussion groups and channels (i.e. Discord and X).
- Automated signals (for example Dependabot, CodeQL, npm advisories, and secret scanning).
Initial triage:

View File

@@ -1893,6 +1893,7 @@ public struct ConfigApplyParams: Codable, Sendable {
public let raw: String
public let basehash: String?
public let sessionkey: String?
public let deliverycontext: [String: AnyCodable]?
public let note: String?
public let restartdelayms: Int?
@@ -1900,12 +1901,14 @@ public struct ConfigApplyParams: Codable, Sendable {
raw: String,
basehash: String?,
sessionkey: String?,
deliverycontext: [String: AnyCodable]?,
note: String?,
restartdelayms: Int?)
{
self.raw = raw
self.basehash = basehash
self.sessionkey = sessionkey
self.deliverycontext = deliverycontext
self.note = note
self.restartdelayms = restartdelayms
}
@@ -1914,6 +1917,7 @@ public struct ConfigApplyParams: Codable, Sendable {
case raw
case basehash = "baseHash"
case sessionkey = "sessionKey"
case deliverycontext = "deliveryContext"
case note
case restartdelayms = "restartDelayMs"
}
@@ -1923,6 +1927,7 @@ public struct ConfigPatchParams: Codable, Sendable {
public let raw: String
public let basehash: String?
public let sessionkey: String?
public let deliverycontext: [String: AnyCodable]?
public let note: String?
public let restartdelayms: Int?
@@ -1930,12 +1935,14 @@ public struct ConfigPatchParams: Codable, Sendable {
raw: String,
basehash: String?,
sessionkey: String?,
deliverycontext: [String: AnyCodable]?,
note: String?,
restartdelayms: Int?)
{
self.raw = raw
self.basehash = basehash
self.sessionkey = sessionkey
self.deliverycontext = deliverycontext
self.note = note
self.restartdelayms = restartdelayms
}
@@ -1944,6 +1951,7 @@ public struct ConfigPatchParams: Codable, Sendable {
case raw
case basehash = "baseHash"
case sessionkey = "sessionKey"
case deliverycontext = "deliveryContext"
case note
case restartdelayms = "restartDelayMs"
}
@@ -4313,17 +4321,20 @@ public struct ChatEvent: Codable, Sendable {
public struct UpdateRunParams: Codable, Sendable {
public let sessionkey: String?
public let deliverycontext: [String: AnyCodable]?
public let note: String?
public let restartdelayms: Int?
public let timeoutms: Int?
public init(
sessionkey: String?,
deliverycontext: [String: AnyCodable]?,
note: String?,
restartdelayms: Int?,
timeoutms: Int?)
{
self.sessionkey = sessionkey
self.deliverycontext = deliverycontext
self.note = note
self.restartdelayms = restartdelayms
self.timeoutms = timeoutms
@@ -4331,6 +4342,7 @@ public struct UpdateRunParams: Codable, Sendable {
private enum CodingKeys: String, CodingKey {
case sessionkey = "sessionKey"
case deliverycontext = "deliveryContext"
case note
case restartdelayms = "restartDelayMs"
case timeoutms = "timeoutMs"

View File

@@ -1893,6 +1893,7 @@ public struct ConfigApplyParams: Codable, Sendable {
public let raw: String
public let basehash: String?
public let sessionkey: String?
public let deliverycontext: [String: AnyCodable]?
public let note: String?
public let restartdelayms: Int?
@@ -1900,12 +1901,14 @@ public struct ConfigApplyParams: Codable, Sendable {
raw: String,
basehash: String?,
sessionkey: String?,
deliverycontext: [String: AnyCodable]?,
note: String?,
restartdelayms: Int?)
{
self.raw = raw
self.basehash = basehash
self.sessionkey = sessionkey
self.deliverycontext = deliverycontext
self.note = note
self.restartdelayms = restartdelayms
}
@@ -1914,6 +1917,7 @@ public struct ConfigApplyParams: Codable, Sendable {
case raw
case basehash = "baseHash"
case sessionkey = "sessionKey"
case deliverycontext = "deliveryContext"
case note
case restartdelayms = "restartDelayMs"
}
@@ -1923,6 +1927,7 @@ public struct ConfigPatchParams: Codable, Sendable {
public let raw: String
public let basehash: String?
public let sessionkey: String?
public let deliverycontext: [String: AnyCodable]?
public let note: String?
public let restartdelayms: Int?
@@ -1930,12 +1935,14 @@ public struct ConfigPatchParams: Codable, Sendable {
raw: String,
basehash: String?,
sessionkey: String?,
deliverycontext: [String: AnyCodable]?,
note: String?,
restartdelayms: Int?)
{
self.raw = raw
self.basehash = basehash
self.sessionkey = sessionkey
self.deliverycontext = deliverycontext
self.note = note
self.restartdelayms = restartdelayms
}
@@ -1944,6 +1951,7 @@ public struct ConfigPatchParams: Codable, Sendable {
case raw
case basehash = "baseHash"
case sessionkey = "sessionKey"
case deliverycontext = "deliveryContext"
case note
case restartdelayms = "restartDelayMs"
}
@@ -4313,17 +4321,20 @@ public struct ChatEvent: Codable, Sendable {
public struct UpdateRunParams: Codable, Sendable {
public let sessionkey: String?
public let deliverycontext: [String: AnyCodable]?
public let note: String?
public let restartdelayms: Int?
public let timeoutms: Int?
public init(
sessionkey: String?,
deliverycontext: [String: AnyCodable]?,
note: String?,
restartdelayms: Int?,
timeoutms: Int?)
{
self.sessionkey = sessionkey
self.deliverycontext = deliverycontext
self.note = note
self.restartdelayms = restartdelayms
self.timeoutms = timeoutms
@@ -4331,6 +4342,7 @@ public struct UpdateRunParams: Codable, Sendable {
private enum CodingKeys: String, CodingKey {
case sessionkey = "sessionKey"
case deliverycontext = "deliveryContext"
case note
case restartdelayms = "restartDelayMs"
case timeoutms = "timeoutMs"

View File

@@ -466,8 +466,10 @@ class OpenClawA2UIHost extends LitElement {
try {
// WebKit message handlers support structured objects; Android's JS interface expects strings.
if (handler === globalThis.openclawCanvasA2UIAction) {
// oxlint-disable-next-line unicorn/require-post-message-target-origin -- Native app message handler, not Window.postMessage.
handler.postMessage(JSON.stringify({ userAction }));
} else {
// oxlint-disable-next-line unicorn/require-post-message-target-origin -- WebKit message handler, not Window.postMessage.
handler.postMessage({ userAction });
}
} catch (e) {

View File

@@ -1,4 +1,4 @@
1977d4698bb80b9aa99315f1114a61b5692bd5630f2ac4a225d81ddc5459d588 config-baseline.json
d1ee5c4d01deac5cf8ea284cafcd8b6c952b2554d40947d2463d08e314acfcda config-baseline.core.json
228031f16ad06580bfd137f092d70d03f2796515e723b8b6618ed69d285465fa config-baseline.json
bad0a5bb247a62b8fb9ed9fc2b2720eacf3e0913077ac351b5d26ae2723335ad config-baseline.core.json
e1f94346a8507ce3dec763b598e79f3bb89ff2e33189ce977cc87d3b05e71c1d config-baseline.channel.json
0fb10e5cb00e7da2cd07c959e0e3397ecb2fdcf15e13a7eae06a2c5b2346bb10 config-baseline.plugin.json
6c19997f1fb2aff4315f2cb9c7d9e299b403fbc0f9e78e3412cc7fe1c655f222 config-baseline.plugin.json

View File

@@ -1,2 +1,2 @@
2256ba1237c3608ca981bce3a7c66b6880b12d05025f260d5c086b69038f408b plugin-sdk-api-baseline.json
6360529513280140c122020466f0821a9acc83aba64612cf90656c2af0261ab3 plugin-sdk-api-baseline.jsonl
ee16273fa5ad8c5408e9dad8d96fde86dfa666ef8eb44840b78135814ff97173 plugin-sdk-api-baseline.json
2bd0d5edf23e6a889d6bedb74d0d06411dd7750dac6ebf24971c789f8a69253a plugin-sdk-api-baseline.jsonl

View File

@@ -49,8 +49,10 @@ openclaw devices clear --yes --pending --json
### `openclaw devices approve [requestId] [--latest]`
Approve a pending device pairing request. If `requestId` is omitted, OpenClaw
automatically approves the most recent pending request.
Approve a pending device pairing request by exact `requestId`. If `requestId`
is omitted or `--latest` is passed, OpenClaw only prints the selected pending
request and exits; rerun approval with the exact request ID after verifying
the details.
Note: if a device retries pairing with changed auth details (role/scopes/public
key), OpenClaw supersedes the previous pending entry and issues a new
@@ -126,7 +128,7 @@ Pass `--token` or `--password` explicitly. Missing explicit credentials is an er
`operator.admin`.
- `devices clear` is intentionally gated by `--yes`.
- If pairing scope is unavailable on local loopback (and no explicit `--url` is passed), list/approve can use a local pairing fallback.
- `devices approve` picks the newest pending request automatically when you omit `requestId` or pass `--latest`.
- `devices approve` requires an explicit request ID before minting tokens; omitting `requestId` or passing `--latest` only previews the newest pending request.
## Token drift recovery checklist

View File

@@ -852,7 +852,7 @@ Subcommands:
Notes:
- `devices list` and `devices approve` can fall back to local pairing files on local loopback when direct pairing scope is unavailable.
- `devices approve` auto-selects the newest pending request when no `requestId` is passed or `--latest` is set.
- `devices approve` requires an explicit request ID before minting tokens; omitting `requestId` or passing `--latest` only previews the newest pending request.
- Stored-token reconnects reuse the token's cached approved scopes; explicit
`devices rotate --scope ...` updates that stored scope set for future
cached-token reconnects.

View File

@@ -57,7 +57,7 @@ available.
After that, restart the gateway:
```bash
node scripts/run-node.mjs gateway --profile dev
openclaw gateway
```
To inspect it live in a conversation:
@@ -102,7 +102,7 @@ Start with this in `openclaw.json`:
Then restart the gateway:
```bash
node scripts/run-node.mjs gateway --profile dev
openclaw gateway
```
What this means:

View File

@@ -52,6 +52,47 @@ pnpm qa:lab:watch
rebuilds that bundle on change, and the browser auto-reloads when the QA Lab
asset hash changes.
For a transport-real Matrix smoke lane, run:
```bash
pnpm openclaw qa matrix
```
That lane provisions a disposable Tuwunel homeserver in Docker, registers
temporary driver, SUT, and observer users, creates one private room, then runs
the real Matrix plugin inside a QA gateway child. The live transport lane keeps
the child config scoped to the transport under test, so Matrix runs without
`qa-channel` in the child config.
For a transport-real Telegram smoke lane, run:
```bash
pnpm openclaw qa telegram
```
That lane targets one real private Telegram group instead of provisioning a
disposable server. It requires `OPENCLAW_QA_TELEGRAM_GROUP_ID`,
`OPENCLAW_QA_TELEGRAM_DRIVER_BOT_TOKEN`, and
`OPENCLAW_QA_TELEGRAM_SUT_BOT_TOKEN`, plus two distinct bots in the same
private group. The SUT bot must have a Telegram username, and bot-to-bot
observation works best when both bots have Bot-to-Bot Communication Mode
enabled in `@BotFather`.
Live transport lanes now share one smaller contract instead of each inventing
their own scenario list shape:
`qa-channel` remains the broad synthetic product-behavior suite and is not part
of the live transport coverage matrix.
| Lane | Canary | Mention gating | Allowlist block | Top-level reply | Restart resume | Thread follow-up | Thread isolation | Reaction observation | Help command |
| -------- | ------ | -------------- | --------------- | --------------- | -------------- | ---------------- | ---------------- | -------------------- | ------------ |
| Matrix | x | x | x | x | x | x | x | x | |
| Telegram | x | | | | | | | | x |
This keeps `qa-channel` as the broad product-behavior suite while Matrix,
Telegram, and future live transports share one explicit transport-contract
checklist.
For a disposable Linux VM lane without bringing Docker into the QA path, run:
```bash

View File

@@ -263,6 +263,31 @@ CLI backend defaults are now part of the plugin surface:
- Backend-specific config cleanup stays plugin-owned through the optional
`normalizeConfig` hook.
Plugins that need tiny prompt/message compatibility shims can declare
bidirectional text transforms without replacing a provider or CLI backend:
```typescript
api.registerTextTransforms({
input: [
{ from: /red basket/g, to: "blue basket" },
{ from: /paper ticket/g, to: "digital ticket" },
{ from: /left shelf/g, to: "right shelf" },
],
output: [
{ from: /blue basket/g, to: "red basket" },
{ from: /digital ticket/g, to: "paper ticket" },
{ from: /right shelf/g, to: "left shelf" },
],
});
```
`input` rewrites the system prompt and user prompt passed to the CLI. `output`
rewrites streamed assistant deltas and parsed final text before OpenClaw handles
its own control markers and channel delivery.
For CLIs that emit Claude Code stream-json compatible JSONL, set
`jsonlDialect: "claude-stream-json"` on that backend's config.
## Bundle MCP overlays
CLI backends do **not** receive OpenClaw tool calls directly, but a backend can

View File

@@ -1224,6 +1224,7 @@ Periodic heartbeat runs.
prompt: "Read HEARTBEAT.md if it exists...",
ackMaxChars: 300,
suppressToolErrorWarnings: false,
timeoutSeconds: 45,
},
},
},
@@ -1233,6 +1234,7 @@ Periodic heartbeat runs.
- `every`: duration string (ms/s/m/h). Default: `30m` (API-key auth) or `1h` (OAuth auth). Set to `0m` to disable.
- `includeSystemPromptSection`: when false, omits the Heartbeat section from the system prompt and skips `HEARTBEAT.md` injection into bootstrap context. Default: `true`.
- `suppressToolErrorWarnings`: when true, suppresses tool error warning payloads during heartbeat runs.
- `timeoutSeconds`: maximum time in seconds allowed for a heartbeat agent turn before it is aborted. Leave unset to use `agents.defaults.timeoutSeconds`.
- `directPolicy`: direct/DM delivery policy. `allow` (default) permits direct-target delivery. `block` suppresses direct-target delivery and emits `reason=dm-blocked`.
- `lightContext`: when true, heartbeat runs use lightweight bootstrap context and keep only `HEARTBEAT.md` from workspace bootstrap files.
- `isolatedSession`: when true, each heartbeat runs in a fresh session with no prior conversation history. Same isolation pattern as cron `sessionTarget: "isolated"`. Reduces per-heartbeat token cost from ~100K to ~2-5K tokens.

View File

@@ -146,6 +146,7 @@ Example: two agents, only the second agent runs heartbeats.
every: "1h",
target: "whatsapp",
to: "+15551234567",
timeoutSeconds: 45,
prompt: "Read HEARTBEAT.md if it exists (workspace context). Follow it strictly. Do not infer or repeat old tasks from prior chats. If nothing needs attention, reply HEARTBEAT_OK.",
},
},

View File

@@ -65,6 +65,27 @@ These commands sit beside the main test suites when you need QA-lab realism:
`.artifacts/qa-e2e/...`.
- `pnpm qa:lab:up`
- Starts the Docker-backed QA site for operator-style QA work.
- `pnpm openclaw qa matrix`
- Runs the Matrix live QA lane against a disposable Docker-backed Tuwunel homeserver.
- Provisions three temporary Matrix users (`driver`, `sut`, `observer`) plus one private room, then starts a QA gateway child with the real Matrix plugin as the SUT transport.
- Uses the pinned stable Tuwunel image `ghcr.io/matrix-construct/tuwunel:v1.5.1` by default. Override with `OPENCLAW_QA_MATRIX_TUWUNEL_IMAGE` when you need to test a different image.
- Writes a Matrix QA report, summary, and observed-events artifact under `.artifacts/qa-e2e/...`.
- `pnpm openclaw qa telegram`
- Runs the Telegram live QA lane against a real private group using the driver and SUT bot tokens from env.
- Requires `OPENCLAW_QA_TELEGRAM_GROUP_ID`, `OPENCLAW_QA_TELEGRAM_DRIVER_BOT_TOKEN`, and `OPENCLAW_QA_TELEGRAM_SUT_BOT_TOKEN`. The group id must be the numeric Telegram chat id.
- Requires two distinct bots in the same private group, with the SUT bot exposing a Telegram username.
- For stable bot-to-bot observation, enable Bot-to-Bot Communication Mode in `@BotFather` for both bots and ensure the driver bot can observe group bot traffic.
- Writes a Telegram QA report, summary, and observed-messages artifact under `.artifacts/qa-e2e/...`.
Live transport lanes share one standard contract so new transports do not drift:
`qa-channel` remains the broad synthetic QA suite and is not part of the live
transport coverage matrix.
| Lane | Canary | Mention gating | Allowlist block | Top-level reply | Restart resume | Thread follow-up | Thread isolation | Reaction observation | Help command |
| -------- | ------ | -------------- | --------------- | --------------- | -------------- | ---------------- | ---------------- | -------------------- | ------------ |
| Matrix | x | x | x | x | x | x | x | x | |
| Telegram | x | | | | | | | | x |
## Test suites (what runs where)
@@ -438,6 +459,9 @@ Docker notes:
- Docker enables the image and MCP/tool probes by default. Set
`OPENCLAW_LIVE_CODEX_HARNESS_IMAGE_PROBE=0` or
`OPENCLAW_LIVE_CODEX_HARNESS_MCP_PROBE=0` when you need a narrower debug run.
- Docker also exports `OPENCLAW_AGENT_HARNESS_FALLBACK=none`, matching the live
test config so `openai-codex/*` or PI fallback cannot hide a Codex harness
regression.
### Recommended live recipes

View File

@@ -452,7 +452,9 @@ continue through the normal OpenClaw delivery path.
When the selected model uses the Codex harness, native thread compaction is
delegated to Codex app-server. OpenClaw keeps a transcript mirror for channel
history, search, `/new`, `/reset`, and future model or harness switching.
history, search, `/new`, `/reset`, and future model or harness switching. The
mirror includes the user prompt, final assistant text, and lightweight Codex
reasoning or plan records when the app-server emits them.
Media generation does not require PI. Image, video, music, PDF, TTS, and media
understanding continue to use the matching provider/model settings such as

View File

@@ -99,9 +99,9 @@ OpenClaw may fall back to PI when the selected plugin harness fails before a
turn has produced side effects. Set `OPENCLAW_AGENT_HARNESS_FALLBACK=none` or
`embeddedHarness.fallback: "none"` to make that fallback a hard failure instead.
The bundled Codex plugin registers `codex` as its harness id. For compatibility,
`codex-app-server` and `app-server` also resolve to that same harness when you
set `OPENCLAW_AGENT_RUNTIME` manually.
The bundled Codex plugin registers `codex` as its harness id. Core treats that
as an ordinary plugin harness id; Codex-specific aliases belong in the plugin
or operator config, not in the shared runtime selector.
## Provider plus harness pairing

View File

@@ -175,6 +175,28 @@ API key auth, and dynamic model resolution.
`openclaw onboard --acme-ai-api-key <key>` and select
`acme-ai/acme-large` as their model.
If the upstream provider uses different control tokens than OpenClaw, add a
small bidirectional text transform instead of replacing the stream path:
```typescript
api.registerTextTransforms({
input: [
{ from: /red basket/g, to: "blue basket" },
{ from: /paper ticket/g, to: "digital ticket" },
{ from: /left shelf/g, to: "right shelf" },
],
output: [
{ from: /blue basket/g, to: "red basket" },
{ from: /digital ticket/g, to: "paper ticket" },
{ from: /right shelf/g, to: "left shelf" },
],
});
```
`input` rewrites the final system prompt and text message content before
transport. `output` rewrites assistant text deltas and final text before
OpenClaw parses its own control markers or channel delivery.
For bundled providers that only register one text provider with API-key
auth plus a single catalog-backed runtime, prefer the narrower
`defineSingleProviderPluginEntry(...)` helper:

View File

@@ -69,15 +69,36 @@ The bundled `fal` video-generation provider defaults to
- Modes: text-to-video and single-image reference flows
- Runtime: queue-backed submit/status/result flow for long-running jobs
- HeyGen video-agent model ref:
- `fal/fal-ai/heygen/v2/video-agent`
- Seedance 2.0 model refs:
- `fal/bytedance/seedance-2.0/fast/text-to-video`
- `fal/bytedance/seedance-2.0/fast/image-to-video`
- `fal/bytedance/seedance-2.0/text-to-video`
- `fal/bytedance/seedance-2.0/image-to-video`
To use fal as the default video provider:
To use Seedance 2.0 as the default video model:
```json5
{
agents: {
defaults: {
videoGenerationModel: {
primary: "fal/fal-ai/minimax/video-01-live",
primary: "fal/bytedance/seedance-2.0/fast/text-to-video",
},
},
},
}
```
To use HeyGen video-agent as the default video model:
```json5
{
agents: {
defaults: {
videoGenerationModel: {
primary: "fal/fal-ai/heygen/v2/video-agent",
},
},
},

View File

@@ -201,22 +201,50 @@ entries.
}
```
HeyGen video-agent on fal can be pinned with:
```json5
{
agents: {
defaults: {
videoGenerationModel: {
primary: "fal/fal-ai/heygen/v2/video-agent",
},
},
},
}
```
Seedance 2.0 on fal can be pinned with:
```json5
{
agents: {
defaults: {
videoGenerationModel: {
primary: "fal/bytedance/seedance-2.0/fast/text-to-video",
},
},
},
}
```
## Provider notes
| Provider | Notes |
| -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Alibaba | Uses DashScope/Model Studio async endpoint. Reference images and videos must be remote `http(s)` URLs. |
| BytePlus | Single image reference only. |
| ComfyUI | Workflow-driven local or cloud execution. Supports text-to-video and image-to-video through the configured graph. |
| fal | Uses queue-backed flow for long-running jobs. Single image reference only. |
| Google | Uses Gemini/Veo. Supports one image or one video reference. |
| MiniMax | Single image reference only. |
| OpenAI | Only `size` override is forwarded. Other style overrides (`aspectRatio`, `resolution`, `audio`, `watermark`) are ignored with a warning. |
| Qwen | Same DashScope backend as Alibaba. Reference inputs must be remote `http(s)` URLs; local files are rejected upfront. |
| Runway | Supports local files via data URIs. Video-to-video requires `runway/gen4_aleph`. Text-only runs expose `16:9` and `9:16` aspect ratios. |
| Together | Single image reference only. |
| Vydra | Uses `https://www.vydra.ai/api/v1` directly to avoid auth-dropping redirects. `veo3` is bundled as text-to-video only; `kling` requires a remote image URL. |
| xAI | Supports text-to-video, image-to-video, and remote video edit/extend flows. |
| Provider | Notes |
| -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Alibaba | Uses DashScope/Model Studio async endpoint. Reference images and videos must be remote `http(s)` URLs. |
| BytePlus | Single image reference only. |
| ComfyUI | Workflow-driven local or cloud execution. Supports text-to-video and image-to-video through the configured graph. |
| fal | Uses queue-backed flow for long-running jobs. Single image reference only. Includes HeyGen video-agent and Seedance 2.0 text-to-video and image-to-video model refs. |
| Google | Uses Gemini/Veo. Supports one image or one video reference. |
| MiniMax | Single image reference only. |
| OpenAI | Only `size` override is forwarded. Other style overrides (`aspectRatio`, `resolution`, `audio`, `watermark`) are ignored with a warning. |
| Qwen | Same DashScope backend as Alibaba. Reference inputs must be remote `http(s)` URLs; local files are rejected upfront. |
| Runway | Supports local files via data URIs. Video-to-video requires `runway/gen4_aleph`. Text-only runs expose `16:9` and `9:16` aspect ratios. |
| Together | Single image reference only. |
| Vydra | Uses `https://www.vydra.ai/api/v1` directly to avoid auth-dropping redirects. `veo3` is bundled as text-to-video only; `kling` requires a remote image URL. |
| xAI | Supports text-to-video, image-to-video, and remote video edit/extend flows. |
## Provider capability modes

View File

@@ -19,7 +19,7 @@ vi.mock("../runtime-api.js", () => ({
vi.mock("./runtime.js", () => ({
ACPX_BACKEND_ID: "acpx",
AcpxRuntime: class {},
AcpxRuntime: function AcpxRuntime() {},
createAgentRegistry: vi.fn(() => ({})),
createFileSessionStore: vi.fn(() => ({})),
}));

View File

@@ -495,7 +495,7 @@ function normalizePluginConfig(pluginConfig: unknown): ResolvedActiveRecallPlugi
return {
enabled: raw.enabled !== false,
agents: Array.isArray(raw.agents)
? raw.agents.map((agentId) => String(agentId).trim()).filter(Boolean)
? raw.agents.map((agentId) => agentId.trim()).filter(Boolean)
: [],
model: typeof raw.model === "string" && raw.model.trim() ? raw.model.trim() : undefined,
modelFallbackPolicy:

View File

@@ -4,9 +4,7 @@ import { buildArceeModelDefinition, ARCEE_BASE_URL, ARCEE_MODEL_CATALOG } from "
export const OPENROUTER_BASE_URL = "https://openrouter.ai/api/v1";
function normalizeBaseUrl(baseUrl: string | undefined): string {
return String(baseUrl ?? "")
.trim()
.replace(/\/+$/, "");
return (baseUrl ?? "").trim().replace(/\/+$/, "");
}
export function isArceeOpenRouterBaseUrl(baseUrl: string | undefined): boolean {

View File

@@ -0,0 +1,64 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
import {
__testing as sessionBindingTesting,
getSessionBindingService,
} from "openclaw/plugin-sdk/conversation-runtime";
import { beforeEach, describe, expect, it } from "vitest";
import { __testing, createBlueBubblesConversationBindingManager } from "./conversation-bindings.js";
const baseCfg = {
session: { mainKey: "main", scope: "per-sender" },
} satisfies OpenClawConfig;
describe("BlueBubbles conversation bindings", () => {
beforeEach(() => {
sessionBindingTesting.resetSessionBindingAdaptersForTests();
__testing.resetBlueBubblesConversationBindingsForTests();
});
it("preserves existing metadata when rebinding the same conversation", async () => {
const manager = createBlueBubblesConversationBindingManager({
cfg: baseCfg,
accountId: "default",
});
manager.bindConversation({
conversationId: "chat-guid-1",
targetKind: "subagent",
targetSessionKey: "agent:main:subagent:child",
metadata: {
agentId: "codex",
label: "child",
boundBy: "system",
},
});
await getSessionBindingService().bind({
targetSessionKey: "agent:main:subagent:child",
targetKind: "subagent",
conversation: {
channel: "bluebubbles",
accountId: "default",
conversationId: "chat-guid-1",
},
placement: "current",
metadata: {
label: "child",
},
});
expect(
getSessionBindingService().resolveByConversation({
channel: "bluebubbles",
accountId: "default",
conversationId: "chat-guid-1",
}),
).toMatchObject({
metadata: expect.objectContaining({
agentId: "codex",
label: "child",
boundBy: "system",
}),
});
});
});

View File

@@ -3,7 +3,7 @@ import {
__testing as sessionBindingTesting,
registerSessionBindingAdapter,
} from "openclaw/plugin-sdk/conversation-runtime";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { resolveBlueBubblesConversationRoute } from "./conversation-route.js";
const baseCfg = {
@@ -18,6 +18,10 @@ describe("resolveBlueBubblesConversationRoute", () => {
sessionBindingTesting.resetSessionBindingAdaptersForTests();
});
afterEach(() => {
sessionBindingTesting.resetSessionBindingAdaptersForTests();
});
it("lets runtime BlueBubbles conversation bindings override default routing", () => {
const touch = vi.fn();
registerSessionBindingAdapter({

View File

@@ -89,9 +89,7 @@ function combineDebounceEntries(entries: BlueBubblesDebounceEntry[]): Normalized
const latestTimestamp = timestamps.length > 0 ? Math.max(...timestamps) : first.timestamp;
// Collect all message IDs for reference
const messageIds = entries
.map((e) => e.message.messageId)
.filter((id): id is string => Boolean(id));
const messageId = entries.map((e) => e.message.messageId).find((id): id is string => Boolean(id));
// Prefer reply context from any entry that has it
const entryWithReply = entries.find((e) => e.message.replyToId);
@@ -102,7 +100,7 @@ function combineDebounceEntries(entries: BlueBubblesDebounceEntry[]): Normalized
attachments: allAttachments.length > 0 ? allAttachments : first.attachments,
timestamp: latestTimestamp,
// Use first message's ID as primary (for reply reference), but we've coalesced others
messageId: messageIds[0] ?? first.messageId,
messageId: messageId ?? first.messageId,
// Preserve reply context if present
replyToId: entryWithReply?.message.replyToId ?? first.replyToId,
replyToBody: entryWithReply?.message.replyToBody ?? first.replyToBody,

View File

@@ -1169,7 +1169,7 @@ export async function processMessage(
isDirect: !isGroup,
isGroup,
isMentionableGroup: isGroup,
requireMention: Boolean(requireMention),
requireMention,
canDetectMention,
effectiveWasMentioned,
shouldBypassMention,

View File

@@ -83,7 +83,9 @@ function validateBlueBubblesServerUrlInput(value: unknown): string | undefined {
}
try {
const normalized = normalizeBlueBubblesServerUrl(trimmed);
new URL(normalized);
if (!URL.canParse(normalized)) {
return "Invalid URL format";
}
return undefined;
} catch {
return "Invalid URL format";

View File

@@ -668,7 +668,7 @@ export async function typeViaPlaywright(opts: {
ssrfPolicy?: SsrFPolicy;
}): Promise<void> {
const resolved = requireRefOrSelector(opts.ref, opts.selector);
const text = String(opts.text ?? "");
const text = opts.text ?? "";
const page = await getRestoredPageForTarget(opts);
const label = resolved.ref ?? resolved.selector!;
const locator = resolved.ref

View File

@@ -575,7 +575,7 @@ export function installBrowserControlServerHooks() {
vi.stubGlobal(
"fetch",
vi.fn(async (url: string, init?: RequestInit) => {
const u = String(url);
const u = url;
if (u.includes("/json/list")) {
if (!state.reachable) {
return makeResponse([]);

View File

@@ -53,7 +53,7 @@ describe("profile CRUD endpoints", () => {
vi.stubGlobal(
"fetch",
vi.fn(async (url: string) => {
const u = String(url);
const u = url;
if (u.includes("/json/list")) {
return makeResponse([]);
}

View File

@@ -115,7 +115,7 @@ export function registerBrowserStateCommands(
if (!headersJsonValue) {
throw new Error("Missing headers JSON (pass --headers-json or positional JSON argument)");
}
const parsed = JSON.parse(String(headersJsonValue)) as unknown;
const parsed = JSON.parse(headersJsonValue) as unknown;
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
throw new Error("Headers JSON must be a JSON object");
}

View File

@@ -24,12 +24,12 @@ async function runChutesOAuth(ctx: ProviderAuthContext): Promise<ProviderAuthRes
const scopes = process.env.CHUTES_OAUTH_SCOPES?.trim() || "openid profile chutes:invoke";
const clientId =
process.env.CHUTES_CLIENT_ID?.trim() ||
String(
(
await ctx.prompter.text({
message: "Enter Chutes OAuth client id",
placeholder: "cid_xxx",
validate: (value: string) => (value?.trim() ? undefined : "Required"),
}),
})
).trim();
const clientSecret = normalizeOptionalString(process.env.CHUTES_CLIENT_SECRET);

View File

@@ -10,7 +10,7 @@ import { runCodexAppServerAttempt } from "./src/app-server/run-attempt.js";
import { clearCodexAppServerBinding } from "./src/app-server/session-binding.js";
import { clearSharedCodexAppServerClient } from "./src/app-server/shared-client.js";
const DEFAULT_CODEX_HARNESS_PROVIDER_IDS = new Set(["codex", "openai-codex"]);
const DEFAULT_CODEX_HARNESS_PROVIDER_IDS = new Set(["codex"]);
export type { CodexAppServerListModelsOptions, CodexAppServerModel, CodexAppServerModelListResult };
export { listCodexAppServerModels };

View File

@@ -1,6 +1,7 @@
import fs from "node:fs";
import { describe, expect, it, vi } from "vitest";
import { createTestPluginApi } from "../../test/helpers/plugins/plugin-api.js";
import { createCodexAppServerAgentHarness } from "./harness.js";
import plugin from "./index.js";
describe("codex plugin", () => {
@@ -42,4 +43,20 @@ describe("codex plugin", () => {
description: "Inspect and control the Codex app-server harness",
});
});
it("only claims the codex provider by default", () => {
const harness = createCodexAppServerAgentHarness();
expect(
harness.supports({ provider: "codex", modelId: "gpt-5.4", requestedRuntime: "auto" })
.supported,
).toBe(true);
expect(
harness.supports({
provider: "openai-codex",
modelId: "gpt-5.4",
requestedRuntime: "auto",
}),
).toMatchObject({ supported: false });
});
});

View File

@@ -4,7 +4,7 @@
"description": "OpenClaw Codex harness and model provider plugin",
"type": "module",
"dependencies": {
"@mariozechner/pi-coding-agent": "0.65.2",
"@mariozechner/pi-coding-agent": "0.66.1",
"ws": "^8.20.0",
"zod": "^4.3.6"
},

View File

@@ -47,6 +47,7 @@ describe("CodexAppServerClient", () => {
afterEach(() => {
resetSharedCodexAppServerClientForTests();
vi.useRealTimers();
vi.restoreAllMocks();
vi.useRealTimers();
for (const client of clients) {
@@ -82,6 +83,37 @@ describe("CodexAppServerClient", () => {
} satisfies Partial<CodexAppServerRpcError>);
});
it("rejects timed-out requests and ignores late responses", async () => {
vi.useFakeTimers();
const harness = createClientHarness();
clients.push(harness.client);
const request = harness.client.request("model/list", {}, { timeoutMs: 1 });
const outbound = JSON.parse(harness.writes[0] ?? "{}") as { id?: number };
const assertion = expect(request).rejects.toThrow("model/list timed out");
await vi.advanceTimersByTimeAsync(100);
await assertion;
harness.send({ id: outbound.id, result: { data: [] } });
expect(harness.writes).toHaveLength(1);
});
it("rejects aborted requests and ignores late responses", async () => {
const harness = createClientHarness();
clients.push(harness.client);
const controller = new AbortController();
const request = harness.client.request("model/list", {}, { signal: controller.signal });
const outbound = JSON.parse(harness.writes[0] ?? "{}") as { id?: number };
const assertion = expect(request).rejects.toThrow("model/list aborted");
controller.abort();
await assertion;
harness.send({ id: outbound.id, result: { data: [] } });
expect(harness.writes).toHaveLength(1);
});
it("initializes with the required client version", async () => {
const harness = createClientHarness();
clients.push(harness.client);

View File

@@ -20,6 +20,7 @@ type PendingRequest = {
method: string;
resolve: (value: unknown) => void;
reject: (error: Error) => void;
cleanup: () => void;
};
export class CodexAppServerRpcError extends Error {
@@ -113,19 +114,71 @@ export class CodexAppServerClient {
this.initialized = true;
}
request<T = JsonValue | undefined>(method: string, params?: JsonValue): Promise<T> {
request<T = JsonValue | undefined>(
method: string,
params?: JsonValue,
options: { timeoutMs?: number; signal?: AbortSignal } = {},
): Promise<T> {
if (this.closed) {
return Promise.reject(new Error("codex app-server client is closed"));
}
if (options.signal?.aborted) {
return Promise.reject(new Error(`${method} aborted`));
}
const id = this.nextId++;
const message: RpcRequest = { id, method, params };
return new Promise<T>((resolve, reject) => {
let timeout: ReturnType<typeof setTimeout> | undefined;
let cleanupAbort: (() => void) | undefined;
const cleanup = () => {
if (timeout) {
clearTimeout(timeout);
timeout = undefined;
}
cleanupAbort?.();
cleanupAbort = undefined;
};
const rejectPending = (error: Error) => {
if (!this.pending.has(id)) {
return;
}
this.pending.delete(id);
cleanup();
reject(error);
};
if (options.timeoutMs && Number.isFinite(options.timeoutMs) && options.timeoutMs > 0) {
timeout = setTimeout(
() => rejectPending(new Error(`${method} timed out`)),
Math.max(100, options.timeoutMs),
);
timeout.unref?.();
}
if (options.signal) {
const abortListener = () => rejectPending(new Error(`${method} aborted`));
options.signal.addEventListener("abort", abortListener, { once: true });
cleanupAbort = () => options.signal?.removeEventListener("abort", abortListener);
}
this.pending.set(id, {
method,
resolve: (value) => resolve(value as T),
reject,
resolve: (value) => {
cleanup();
resolve(value as T);
},
reject: (error) => {
cleanup();
reject(error);
},
cleanup,
});
this.writeMessage(message);
if (options.signal?.aborted) {
rejectPending(new Error(`${method} aborted`));
return;
}
try {
this.writeMessage(message);
} catch (error) {
rejectPending(error instanceof Error ? error : new Error(String(error)));
}
});
}
@@ -252,6 +305,7 @@ export class CodexAppServerClient {
private rejectPendingRequests(error: Error): void {
for (const pending of this.pending.values()) {
pending.cleanup();
pending.reject(error);
}
this.pending.clear();

View File

@@ -7,23 +7,15 @@ import { maybeCompactCodexAppServerSession, __testing } from "./compact.js";
import type { CodexServerNotification } from "./protocol.js";
import { writeCodexAppServerBinding } from "./session-binding.js";
const OLD_RUNTIME = process.env.OPENCLAW_AGENT_RUNTIME;
let tempDir: string;
describe("maybeCompactCodexAppServerSession", () => {
beforeEach(async () => {
tempDir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-codex-compact-"));
process.env.OPENCLAW_AGENT_RUNTIME = "codex-app-server";
});
afterEach(async () => {
__testing.resetCodexAppServerClientFactoryForTests();
if (OLD_RUNTIME === undefined) {
delete process.env.OPENCLAW_AGENT_RUNTIME;
} else {
process.env.OPENCLAW_AGENT_RUNTIME = OLD_RUNTIME;
}
await fs.rm(tempDir, { recursive: true, force: true });
});

View File

@@ -1,6 +1,5 @@
import {
embeddedAgentLog,
resolveEmbeddedAgentRuntime,
type CompactEmbeddedPiSessionParams,
type EmbeddedPiCompactResult,
} from "openclaw/plugin-sdk/agent-harness";
@@ -34,21 +33,9 @@ export async function maybeCompactCodexAppServerSession(
options: { pluginConfig?: unknown } = {},
): Promise<EmbeddedPiCompactResult | undefined> {
const appServer = resolveCodexAppServerRuntimeOptions({ pluginConfig: options.pluginConfig });
const runtime = resolveEmbeddedAgentRuntime();
const provider = params.provider?.trim().toLowerCase();
const shouldUseCodex =
runtime === "codex" ||
(runtime === "auto" && (provider === "codex" || provider === "openai-codex"));
if (!shouldUseCodex) {
return undefined;
}
const binding = await readCodexAppServerBinding(params.sessionFile);
if (!binding?.threadId) {
if (runtime === "codex") {
return { ok: false, compacted: false, reason: "no codex app-server thread binding" };
}
return undefined;
return { ok: false, compacted: false, reason: "no codex app-server thread binding" };
}
const client = await clientFactory(appServer.start);

View File

@@ -81,6 +81,7 @@ describe("CodexAppServerEventProjector", () => {
expect(onAssistantMessageStart).toHaveBeenCalledTimes(1);
expect(onPartialReply).toHaveBeenLastCalledWith({ text: "hello" });
expect(result.assistantTexts).toEqual(["hello"]);
expect(result.messagesSnapshot.map((message) => message.role)).toEqual(["user", "assistant"]);
expect(result.lastAssistant?.content).toEqual([{ type: "text", text: "hello" }]);
expect(result.attemptUsage).toMatchObject({ input: 5, output: 7, cacheRead: 2, total: 12 });
expect(result.replayMetadata.replaySafe).toBe(true);
@@ -212,6 +213,13 @@ describe("CodexAppServerEventProjector", () => {
}),
);
expect(result.toolMetas).toEqual([{ toolName: "sessions_send", meta: "completed" }]);
expect(result.messagesSnapshot.map((message) => message.role)).toEqual([
"user",
"assistant",
"assistant",
]);
expect(JSON.stringify(result.messagesSnapshot[1])).toContain("Codex reasoning");
expect(JSON.stringify(result.messagesSnapshot[2])).toContain("Codex plan");
expect(result.itemLifecycle).toMatchObject({ compactionCount: 1 });
});
});

View File

@@ -121,6 +121,8 @@ export class CodexAppServerEventProjector {
options?: { yieldDetected?: boolean },
): EmbeddedRunAttemptResult {
const assistantTexts = this.collectAssistantTexts();
const reasoningText = collectTextValues(this.reasoningTextByItem).join("\n\n");
const planText = collectTextValues(this.planTextByItem).join("\n\n");
const lastAssistant =
assistantTexts.length > 0
? this.createAssistantMessage(assistantTexts.join("\n\n"))
@@ -132,6 +134,14 @@ export class CodexAppServerEventProjector {
timestamp: Date.now(),
},
];
// Codex owns the canonical thread. These mirror records keep enough local
// context for OpenClaw history, search, and future harness switching.
if (reasoningText) {
messagesSnapshot.push(this.createAssistantMirrorMessage("Codex reasoning", reasoningText));
}
if (planText) {
messagesSnapshot.push(this.createAssistantMirrorMessage("Codex plan", planText));
}
if (lastAssistant) {
messagesSnapshot.push(lastAssistant);
}
@@ -447,6 +457,19 @@ export class CodexAppServerEventProjector {
};
}
private createAssistantMirrorMessage(title: string, text: string): AssistantMessage {
return {
role: "assistant",
content: [{ type: "text", text: `${title}:\n${text}` }],
api: this.params.model.api ?? "openai-codex-responses",
provider: this.params.provider,
model: this.params.modelId,
usage: ZERO_USAGE,
stopReason: "stop",
timestamp: Date.now(),
};
}
private isNotificationForTurn(params: JsonObject): boolean {
const threadId = readString(params, "threadId");
const turnId = readString(params, "turnId");
@@ -479,6 +502,10 @@ function splitPlanText(text: string): string[] {
.filter((line) => line.length > 0);
}
function collectTextValues(map: Map<string, string>): string[] {
return [...map.values()].filter((text) => text.trim().length > 0);
}
function itemKind(
item: CodexThreadItem,
): "tool" | "command" | "patch" | "search" | "analysis" | undefined {

View File

@@ -34,12 +34,19 @@ export async function listCodexAppServerModels(
const timeoutMs = options.timeoutMs ?? 2500;
return await withTimeout(
(async () => {
const client = await getSharedCodexAppServerClient({ startOptions: options.startOptions });
const response = await client.request<JsonObject>("model/list", {
limit: options.limit ?? null,
cursor: options.cursor ?? null,
includeHidden: options.includeHidden ?? null,
const client = await getSharedCodexAppServerClient({
startOptions: options.startOptions,
timeoutMs,
});
const response = await client.request<JsonObject>(
"model/list",
{
limit: options.limit ?? null,
cursor: options.cursor ?? null,
includeHidden: options.includeHidden ?? null,
},
{ timeoutMs },
);
return readModelListResult(response);
})(),
timeoutMs,

View File

@@ -12,8 +12,11 @@ export async function requestCodexAppServerJson<T = JsonValue | undefined>(param
const timeoutMs = params.timeoutMs ?? 60_000;
return await withTimeout(
(async () => {
const client = await getSharedCodexAppServerClient({ startOptions: params.startOptions });
return await client.request<T>(params.method, params.requestParams);
const client = await getSharedCodexAppServerClient({
startOptions: params.startOptions,
timeoutMs,
});
return await client.request<T>(params.method, params.requestParams, { timeoutMs });
})(),
timeoutMs,
`codex app-server ${params.method} timed out`,

View File

@@ -243,6 +243,41 @@ describe("runCodexAppServerAttempt", () => {
expect(queueAgentHarnessMessage("session-1", "after timeout")).toBe(false);
});
it("times out turn start before the active run handle is installed", async () => {
const request = vi.fn(
async (method: string, _params?: unknown, options?: { timeoutMs?: number }) => {
if (method === "thread/start") {
return { thread: { id: "thread-1" }, model: "gpt-5.4-codex", modelProvider: "openai" };
}
if (method === "turn/start") {
return await new Promise<never>((_, reject) => {
setTimeout(
() => reject(new Error("turn/start timed out")),
Math.max(100, options?.timeoutMs ?? 0),
);
});
}
return {};
},
);
__testing.setCodexAppServerClientFactoryForTests(
async () =>
({
request,
addNotificationHandler: () => () => undefined,
addRequestHandler: () => () => undefined,
}) as never,
);
const params = createParams(
path.join(tempDir, "session.jsonl"),
path.join(tempDir, "workspace"),
);
params.timeoutMs = 1;
await expect(runCodexAppServerAttempt(params)).rejects.toThrow("turn/start timed out");
expect(queueAgentHarnessMessage("session-1", "after timeout")).toBe(false);
});
it("keeps extended history enabled when resuming a bound Codex thread", async () => {
const sessionFile = path.join(tempDir, "session.jsonl");
const workspaceDir = path.join(tempDir, "workspace");

View File

@@ -127,6 +127,7 @@ export async function runCodexAppServerAttempt(
const completion = new Promise<void>((resolve) => {
resolveCompletion = resolve;
});
let notificationQueue: Promise<void> = Promise.resolve();
const handleNotification = async (notification: CodexServerNotification) => {
if (!projector || !turnId) {
@@ -142,8 +143,15 @@ export async function runCodexAppServerAttempt(
resolveCompletion?.();
}
};
const enqueueNotification = (notification: CodexServerNotification): Promise<void> => {
notificationQueue = notificationQueue.then(
() => handleNotification(notification),
() => handleNotification(notification),
);
return notificationQueue;
};
const notificationCleanup = client.addNotificationHandler(handleNotification);
const notificationCleanup = client.addNotificationHandler(enqueueNotification);
const requestCleanup = client.addRequestHandler(async (request) => {
if (!turnId) {
return undefined;
@@ -177,6 +185,7 @@ export async function runCodexAppServerAttempt(
cwd: effectiveWorkspace,
appServer,
}),
{ timeoutMs: params.timeoutMs, signal: runAbortController.signal },
);
} catch (error) {
notificationCleanup();
@@ -187,7 +196,7 @@ export async function runCodexAppServerAttempt(
turnId = turn.turn.id;
projector = new CodexAppServerEventProjector(params, thread.threadId, turnId);
for (const notification of pendingNotifications.splice(0)) {
await handleNotification(notification);
await enqueueNotification(notification);
}
const activeTurnId = turnId;
const activeProjector = projector;

View File

@@ -37,6 +37,7 @@ function createClientHarness() {
describe("shared Codex app-server client", () => {
afterEach(() => {
resetSharedCodexAppServerClientForTests();
vi.useRealTimers();
vi.restoreAllMocks();
});
@@ -59,4 +60,31 @@ describe("shared Codex app-server client", () => {
expect(harness.process.kill).toHaveBeenCalledTimes(1);
startSpy.mockRestore();
});
it("closes and clears a shared app-server when initialize times out", async () => {
const first = createClientHarness();
const second = createClientHarness();
const startSpy = vi
.spyOn(CodexAppServerClient, "start")
.mockReturnValueOnce(first.client)
.mockReturnValueOnce(second.client);
await expect(listCodexAppServerModels({ timeoutMs: 5 })).rejects.toThrow(
"codex app-server initialize timed out",
);
expect(first.process.kill).toHaveBeenCalledTimes(1);
const secondList = listCodexAppServerModels({ timeoutMs: 1000 });
const initialize = JSON.parse(second.writes[0] ?? "{}") as { id?: number };
second.send({
id: initialize.id,
result: { userAgent: "openclaw/0.118.0 (macOS; test)" },
});
await vi.waitFor(() => expect(second.writes.length).toBeGreaterThanOrEqual(3));
const modelList = JSON.parse(second.writes[2] ?? "{}") as { id?: number };
second.send({ id: modelList.id, result: { data: [] } });
await expect(secondList).resolves.toEqual({ models: [] });
expect(startSpy).toHaveBeenCalledTimes(2);
});
});

View File

@@ -4,6 +4,7 @@ import {
resolveCodexAppServerRuntimeOptions,
type CodexAppServerStartOptions,
} from "./config.js";
import { withTimeout } from "./timeout.js";
type SharedCodexAppServerClientState = {
client?: CodexAppServerClient;
@@ -23,6 +24,7 @@ function getSharedCodexAppServerClientState(): SharedCodexAppServerClientState {
export async function getSharedCodexAppServerClient(options?: {
startOptions?: CodexAppServerStartOptions;
timeoutMs?: number;
}): Promise<CodexAppServerClient> {
const state = getSharedCodexAppServerClientState();
const startOptions = options?.startOptions ?? resolveCodexAppServerRuntimeOptions().start;
@@ -46,11 +48,13 @@ export async function getSharedCodexAppServerClient(options?: {
}
})();
try {
return await state.promise;
return await withTimeout(
state.promise,
options?.timeoutMs ?? 0,
"codex app-server initialize timed out",
);
} catch (error) {
state.client = undefined;
state.promise = undefined;
state.key = undefined;
clearSharedCodexAppServerClient();
throw error;
}
}

View File

@@ -25,7 +25,7 @@ describe("mirrorCodexAppServerTranscript", () => {
{ role: "user", content: "hello", timestamp: 1 },
{
role: "assistant",
content: [{ type: "text", text: "hi" }],
content: [{ type: "text", text: "Codex plan:\ninspect" }],
api: "openai-codex-responses",
provider: "openai-codex",
model: "gpt-5.4-codex",
@@ -40,6 +40,23 @@ describe("mirrorCodexAppServerTranscript", () => {
stopReason: "stop",
timestamp: 2,
},
{
role: "assistant",
content: [{ type: "text", text: "hi" }],
api: "openai-codex-responses",
provider: "openai-codex",
model: "gpt-5.4-codex",
usage: {
input: 0,
output: 0,
cacheRead: 0,
cacheWrite: 0,
totalTokens: 0,
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },
},
stopReason: "stop",
timestamp: 3,
},
],
});
@@ -48,7 +65,11 @@ describe("mirrorCodexAppServerTranscript", () => {
.split("\n")
.map((line) => JSON.parse(line) as { type?: string; message?: { role?: string } });
expect(records[0]?.type).toBe("session");
expect(records.slice(1).map((record) => record.message?.role)).toEqual(["user", "assistant"]);
expect(records.slice(1).map((record) => record.message?.role)).toEqual([
"user",
"assistant",
"assistant",
]);
});
it("deduplicates app-server turn mirrors by idempotency scope", async () => {

View File

@@ -61,7 +61,7 @@ describe("codex command", () => {
const deps = createDeps({
codexControlRequest: vi.fn(
async (_pluginConfig: unknown, method: string, requestParams: unknown) => {
requests.push({ method: String(method), params: requestParams });
requests.push({ method, params: requestParams });
return {
thread: { id: "thread-123", cwd: "/repo" },
model: "gpt-5.4",

View File

@@ -41,12 +41,7 @@ function normalizeBaseUrl(value: string): string {
function validateBaseUrl(value: string): string | undefined {
const normalized = normalizeBaseUrl(value);
try {
new URL(normalized);
} catch {
return "Enter a valid URL";
}
return undefined;
return URL.canParse(normalized) ? undefined : "Enter a valid URL";
}
function parseModelIds(input: string): string[] {

View File

@@ -0,0 +1,154 @@
import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { createTestPluginApi } from "../../test/helpers/plugins/plugin-api.js";
const listDevicePairingMock = vi.hoisted(() => vi.fn(async () => ({ pending: [] })));
vi.mock("./api.js", () => ({
listDevicePairing: listDevicePairingMock,
}));
import { handleNotifyCommand } from "./notify.js";
describe("device-pair notify persistence", () => {
let stateDir: string;
beforeEach(async () => {
vi.clearAllMocks();
listDevicePairingMock.mockResolvedValue({ pending: [] });
stateDir = await fs.mkdtemp(path.join(os.tmpdir(), "device-pair-notify-"));
});
afterEach(async () => {
await fs.rm(stateDir, { recursive: true, force: true });
});
it("matches persisted telegram thread ids across number and string roundtrips", async () => {
await fs.writeFile(
path.join(stateDir, "device-pair-notify.json"),
JSON.stringify(
{
subscribers: [
{
to: "chat-123",
accountId: "telegram-default",
messageThreadId: 271,
mode: "persistent",
addedAtMs: 1,
},
],
notifiedRequestIds: {},
},
null,
2,
),
"utf8",
);
const api = createTestPluginApi({
runtime: {
state: {
resolveStateDir: () => stateDir,
},
} as never,
});
const status = await handleNotifyCommand({
api,
ctx: {
channel: "telegram",
senderId: "chat-123",
accountId: "telegram-default",
messageThreadId: "271",
},
action: "status",
});
expect(status.text).toContain("Pair request notifications: enabled for this chat.");
expect(status.text).toContain("Mode: persistent");
await handleNotifyCommand({
api,
ctx: {
channel: "telegram",
senderId: "chat-123",
accountId: "telegram-default",
messageThreadId: "271",
},
action: "off",
});
const persisted = JSON.parse(
await fs.readFile(path.join(stateDir, "device-pair-notify.json"), "utf8"),
) as { subscribers: unknown[] };
expect(persisted.subscribers).toEqual([]);
});
it("does not remove a different persisted subscriber when notify fields contain pipes", async () => {
await fs.writeFile(
path.join(stateDir, "device-pair-notify.json"),
JSON.stringify(
{
subscribers: [
{
to: "chat|123",
accountId: "acct",
mode: "persistent",
addedAtMs: 1,
},
{
to: "chat",
accountId: "123|acct",
mode: "persistent",
addedAtMs: 2,
},
],
notifiedRequestIds: {},
},
null,
2,
),
"utf8",
);
const api = createTestPluginApi({
runtime: {
state: {
resolveStateDir: () => stateDir,
},
} as never,
});
await handleNotifyCommand({
api,
ctx: {
channel: "telegram",
senderId: "chat",
accountId: "123|acct",
},
action: "off",
});
const status = await handleNotifyCommand({
api,
ctx: {
channel: "telegram",
senderId: "chat",
accountId: "123|acct",
},
action: "status",
});
expect(status.text).toContain("Pair request notifications: disabled for this chat.");
const persisted = JSON.parse(
await fs.readFile(path.join(stateDir, "device-pair-notify.json"), "utf8"),
) as { subscribers: Array<{ to: string; accountId?: string }> };
expect(persisted.subscribers).toHaveLength(1);
expect(persisted.subscribers[0]).toMatchObject({
to: "chat|123",
accountId: "acct",
});
});
});

View File

@@ -154,7 +154,32 @@ function notifySubscriberKey(subscriber: {
accountId?: string;
messageThreadId?: string | number;
}): string {
return [subscriber.to, subscriber.accountId ?? "", subscriber.messageThreadId ?? ""].join("|");
return JSON.stringify([
subscriber.to,
subscriber.accountId ?? "",
normalizeNotifyThreadKey(subscriber.messageThreadId),
]);
}
function normalizeNotifyThreadKey(messageThreadId?: string | number): string {
if (typeof messageThreadId === "number" && Number.isFinite(messageThreadId)) {
return String(Math.trunc(messageThreadId));
}
if (typeof messageThreadId !== "string") {
return "";
}
const normalized = normalizeOptionalString(messageThreadId);
if (!normalized) {
return "";
}
if (!/^-?\d+$/u.test(normalized)) {
return normalized;
}
try {
return BigInt(normalized).toString();
} catch {
return normalized;
}
}
type NotifyTarget = {

View File

@@ -52,23 +52,21 @@ vi.mock("@opentelemetry/sdk-node", () => ({
}));
vi.mock("@opentelemetry/exporter-metrics-otlp-proto", () => ({
OTLPMetricExporter: class {},
OTLPMetricExporter: function OTLPMetricExporter() {},
}));
vi.mock("@opentelemetry/exporter-trace-otlp-proto", () => ({
OTLPTraceExporter: class {
constructor(options?: unknown) {
traceExporterCtor(options);
}
OTLPTraceExporter: function OTLPTraceExporter(options?: unknown) {
traceExporterCtor(options);
},
}));
vi.mock("@opentelemetry/exporter-logs-otlp-proto", () => ({
OTLPLogExporter: class {},
OTLPLogExporter: function OTLPLogExporter() {},
}));
vi.mock("@opentelemetry/sdk-logs", () => ({
BatchLogRecordProcessor: class {},
BatchLogRecordProcessor: function BatchLogRecordProcessor() {},
LoggerProvider: class {
getLogger = vi.fn(() => ({
emit: logEmit,
@@ -78,19 +76,18 @@ vi.mock("@opentelemetry/sdk-logs", () => ({
}));
vi.mock("@opentelemetry/sdk-metrics", () => ({
PeriodicExportingMetricReader: class {},
PeriodicExportingMetricReader: function PeriodicExportingMetricReader() {},
}));
vi.mock("@opentelemetry/sdk-trace-base", () => ({
ParentBasedSampler: class {},
TraceIdRatioBasedSampler: class {},
ParentBasedSampler: function ParentBasedSampler() {},
TraceIdRatioBasedSampler: function TraceIdRatioBasedSampler() {},
}));
vi.mock("@opentelemetry/resources", () => ({
resourceFromAttributes: vi.fn((attrs: Record<string, unknown>) => attrs),
Resource: class {
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
constructor(_value?: unknown) {}
Resource: function Resource(_value?: unknown) {
// Constructor shape required by the mocked OpenTelemetry API.
},
}));

View File

@@ -300,5 +300,5 @@ export async function handleDiscordMessageAction(
return adminResult;
}
throw new Error(`Action ${String(action)} is not supported for provider ${providerId}.`);
throw new Error(`Action ${action} is not supported for provider ${providerId}.`);
}

View File

@@ -2,7 +2,7 @@ import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import { describe, expect, it } from "vitest";
import { clearSessionStoreCacheForTest } from "../../../src/config/sessions.js";
import { clearSessionStoreCacheForTest } from "../../../src/config/sessions/store.js";
import {
createDiscordNativeApprovalAdapter,
getDiscordApprovalCapability,

View File

@@ -90,6 +90,7 @@ function createDiscordOriginTargetResolver(configOverride?: DiscordExecApprovalC
const sessionConversation = resolveApprovalRequestSessionConversation({
request,
channel: "discord",
bundledFallback: false,
});
const sessionKind = extractDiscordSessionKind(
normalizeOptionalString(request.request.sessionKey) ?? null,
@@ -113,6 +114,7 @@ function createDiscordOriginTargetResolver(configOverride?: DiscordExecApprovalC
const sessionConversation = resolveApprovalRequestSessionConversation({
request,
channel: "discord",
bundledFallback: false,
});
const sessionKind = extractDiscordSessionKind(request.request.sessionKey?.trim() || null);
if (sessionKind === "dm") {
@@ -134,6 +136,7 @@ function createDiscordOriginTargetResolver(configOverride?: DiscordExecApprovalC
const sessionConversation = resolveApprovalRequestSessionConversation({
request,
channel: "discord",
bundledFallback: false,
});
const sessionKind = extractDiscordSessionKind(request.request.sessionKey?.trim() || null);
if (sessionKind === "dm") {
@@ -161,7 +164,7 @@ function createDiscordApproverDmTargetResolver(configOverride?: DiscordExecAppro
}),
resolveApprovers: ({ cfg, accountId }) =>
getDiscordExecApprovalApprovers({ cfg, accountId, configOverride }),
mapApprover: (approver) => ({ to: String(approver) }),
mapApprover: (approver) => ({ to: approver }),
});
}

View File

@@ -50,7 +50,7 @@ export function listConfiguredGuildChannelKeys(
continue;
}
for (const [key, value] of Object.entries(channelsRaw)) {
const channelId = normalizeOptionalString(String(key)) ?? "";
const channelId = normalizeOptionalString(key) ?? "";
if (!channelId) {
continue;
}

View File

@@ -65,7 +65,7 @@ export type {
} from "./components.types.js";
// Some test-only module graphs partially mock `@buape/carbon` and can drop `Modal`.
// Keep dynamic form definitions loadable instead of crashing unrelated suites.
const ModalBase: typeof Modal = Modal ?? class {};
const ModalBase: typeof Modal = Modal ?? (function ModalFallback() {} as unknown as typeof Modal);
export const DISCORD_COMPONENT_ATTACHMENT_PREFIX = "attachment://";

View File

@@ -72,7 +72,9 @@ beforeEach(() => {
});
describe("registerDiscordListener", () => {
class FakeListener {}
class FakeListener {
readonly testListener = true;
}
it("dedupes listeners by constructor", () => {
const listeners: object[] = [];

View File

@@ -242,7 +242,7 @@ export async function resolveComponentInteractionContext(params: {
const isDirectMessage =
channelType === ChannelType.DM || (!rawGuildId && !isGroupDm && channelType == null);
const memberRoleIds = Array.isArray(interaction.rawData.member?.roles)
? interaction.rawData.member.roles.map((roleId: string) => String(roleId))
? interaction.rawData.member.roles.map((roleId: string) => roleId)
: [];
return {

View File

@@ -79,7 +79,7 @@ export class ExecApprovalButton extends Button {
const approvers = this.ctx.getApprovers();
const userId = interaction.userId;
if (!approvers.some((id) => String(id) === userId)) {
if (!approvers.some((id) => id === userId)) {
try {
await interaction.reply({
content: "⛔ You are not authorized to approve exec requests.",

View File

@@ -455,7 +455,7 @@ async function handleDiscordReactionEvent(
channelType === ChannelType.PrivateThread ||
channelType === ChannelType.AnnouncementThread;
const memberRoleIds = Array.isArray(data.rawMember?.roles)
? data.rawMember.roles.map((roleId: string) => String(roleId))
? data.rawMember.roles.map((roleId: string) => roleId)
: [];
const reactionIngressBase: Omit<DiscordReactionIngressAuthorizationParams, "channelConfig"> = {
accountId: params.accountId,

View File

@@ -202,7 +202,7 @@ export async function processDiscordMessage(
isDirect: isDirectMessage,
isGroup: isGuildMessage || isGroupDm,
isMentionableGroup: isGuildMessage,
requireMention: Boolean(shouldRequireMention),
requireMention: shouldRequireMention,
canDetectMention,
effectiveWasMentioned,
shouldBypassMention,

View File

@@ -245,7 +245,7 @@ async function resolveDiscordModelPickerRouteState(params: {
channelType === ChannelType.AnnouncementThread;
const rawChannelId = channel?.id ?? "unknown";
const memberRoleIds = Array.isArray(interaction.rawData.member?.roles)
? interaction.rawData.member.roles.map((roleId: string) => String(roleId))
? interaction.rawData.member.roles.map((roleId: string) => roleId)
: [];
let threadParentId: string | undefined;
if (interaction.guild && channel && isThreadChannel && rawChannelId) {

View File

@@ -3,32 +3,21 @@ import * as commandRegistryModule from "openclaw/plugin-sdk/command-auth";
import type { ChatCommandDefinition, CommandArgsParsing } from "openclaw/plugin-sdk/command-auth";
import type { ModelsProviderData } from "openclaw/plugin-sdk/command-auth";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
import * as pluginRuntimeModule from "openclaw/plugin-sdk/plugin-runtime";
import * as dispatcherModule from "openclaw/plugin-sdk/reply-dispatch-runtime";
import * as globalsModule from "openclaw/plugin-sdk/runtime-env";
import * as commandTextModule from "openclaw/plugin-sdk/text-runtime";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import * as modelPickerPreferencesModule from "./model-picker-preferences.js";
import * as modelPickerModule from "./model-picker.js";
import { createModelsProviderData as createBaseModelsProviderData } from "./model-picker.test-utils.js";
import * as nativeCommandRouteModule from "./native-command-route.js";
import { replyWithDiscordModelPickerProviders } from "./native-command-ui.js";
import {
__testing as nativeCommandTesting,
createDiscordModelPickerFallbackButton,
createDiscordModelPickerFallbackSelect,
} from "./native-command.js";
replyWithDiscordModelPickerProviders,
type DispatchDiscordCommandInteraction,
} from "./native-command-ui.js";
import { createNoopThreadBindingManager, type ThreadBindingManager } from "./thread-bindings.js";
vi.mock("openclaw/plugin-sdk/agent-runtime", () => ({
resolveDefaultModelForAgent: () => ({
provider: "anthropic",
model: "claude-sonnet-4.5",
}),
resolveHumanDelayConfig: () => undefined,
}));
type ModelPickerContext = Parameters<typeof createDiscordModelPickerFallbackButton>[0];
type ModelPickerContext = Parameters<typeof createDiscordModelPickerFallbackButton>[0]["ctx"];
type PickerButton = ReturnType<typeof createDiscordModelPickerFallbackButton>;
type PickerSelect = ReturnType<typeof createDiscordModelPickerFallbackSelect>;
type PickerButtonInteraction = Parameters<PickerButton["run"]>[0];
@@ -165,12 +154,43 @@ function createModelsViewSubmitData(): PickerButtonData {
};
}
async function safeInteractionCall<T>(_label: string, fn: () => Promise<T>): Promise<T | null> {
return await fn();
}
function createDispatchSpy() {
return vi.fn<DispatchDiscordCommandInteraction>().mockResolvedValue();
}
function createModelPickerFallbackButton(
context: ModelPickerContext,
dispatchCommandInteraction: DispatchDiscordCommandInteraction = createDispatchSpy(),
) {
return createDiscordModelPickerFallbackButton({
ctx: context,
safeInteractionCall,
dispatchCommandInteraction,
});
}
function createModelPickerFallbackSelect(
context: ModelPickerContext,
dispatchCommandInteraction: DispatchDiscordCommandInteraction = createDispatchSpy(),
) {
return createDiscordModelPickerFallbackSelect({
ctx: context,
safeInteractionCall,
dispatchCommandInteraction,
});
}
async function runSubmitButton(params: {
context: ModelPickerContext;
data: PickerButtonData;
dispatchCommandInteraction?: DispatchDiscordCommandInteraction;
userId?: string;
}) {
const button = createDiscordModelPickerFallbackButton(params.context);
const button = createModelPickerFallbackButton(params.context, params.dispatchCommandInteraction);
const submitInteraction = createInteraction({ userId: params.userId ?? "owner" });
await button.run(submitInteraction as unknown as PickerButtonInteraction, params.data);
return submitInteraction;
@@ -179,10 +199,11 @@ async function runSubmitButton(params: {
async function runModelSelect(params: {
context: ModelPickerContext;
data?: PickerSelectData;
dispatchCommandInteraction?: DispatchDiscordCommandInteraction;
userId?: string;
values?: string[];
}) {
const select = createDiscordModelPickerFallbackSelect(params.context);
const select = createModelPickerFallbackSelect(params.context, params.dispatchCommandInteraction);
const selectInteraction = createInteraction({
userId: params.userId ?? "owner",
values: params.values ?? ["gpt-4o"],
@@ -195,24 +216,12 @@ async function runModelSelect(params: {
}
function expectDispatchedModelSelection(params: {
dispatchSpy: { mock: { calls: Array<[unknown]> } };
dispatchSpy: ReturnType<typeof createDispatchSpy>;
model: string;
requireTargetSessionKey?: boolean;
}) {
const dispatchCall = params.dispatchSpy.mock.calls[0]?.[0] as {
ctx?: {
CommandBody?: string;
CommandArgs?: { values?: { model?: string } };
CommandTargetSessionKey?: string;
};
};
expect(dispatchCall.ctx?.CommandBody).toBe(`/model ${params.model}`);
expect(dispatchCall.ctx?.CommandArgs?.values?.model).toBe(params.model);
if (params.requireTargetSessionKey) {
if (!dispatchCall.ctx?.CommandTargetSessionKey) {
throw new Error("model selection dispatch did not include a target session key");
}
}
const dispatchCall = params.dispatchSpy.mock.calls[0]?.[0];
expect(dispatchCall?.prompt).toBe(`/model ${params.model}`);
expect(dispatchCall?.commandArgs?.values?.model).toBe(params.model);
}
function createBoundThreadBindingManager(params: {
@@ -246,26 +255,10 @@ function createBoundThreadBindingManager(params: {
};
}
function createDispatchSpy() {
const dispatchSpy = vi
.fn<typeof dispatcherModule.dispatchReplyWithDispatcher>()
.mockResolvedValue({} as never);
nativeCommandTesting.setDispatchReplyWithDispatcher(dispatchSpy);
return dispatchSpy;
}
describe("Discord model picker interactions", () => {
beforeEach(() => {
vi.useRealTimers();
vi.restoreAllMocks();
nativeCommandTesting.setMatchPluginCommand(pluginRuntimeModule.matchPluginCommand);
nativeCommandTesting.setExecutePluginCommand(pluginRuntimeModule.executePluginCommand);
nativeCommandTesting.setDispatchReplyWithDispatcher(
dispatcherModule.dispatchReplyWithDispatcher,
);
nativeCommandTesting.setResolveDiscordNativeInteractionRouteState(
nativeCommandRouteModule.resolveDiscordNativeInteractionRouteState,
);
});
afterEach(() => {
@@ -274,8 +267,8 @@ describe("Discord model picker interactions", () => {
it("registers distinct fallback ids for button and select handlers", () => {
const context = createModelPickerContext();
const button = createDiscordModelPickerFallbackButton(context);
const select = createDiscordModelPickerFallbackSelect(context);
const button = createModelPickerFallbackButton(context);
const select = createModelPickerFallbackSelect(context);
expect(button.customId).not.toBe(select.customId);
expect(button.customId.split(":")[0]).toBe(
@@ -289,7 +282,7 @@ describe("Discord model picker interactions", () => {
it("ignores interactions from users other than the picker owner", async () => {
const context = createModelPickerContext();
const loadSpy = vi.spyOn(modelPickerModule, "loadDiscordModelPickerData");
const button = createDiscordModelPickerFallbackButton(context);
const button = createModelPickerFallbackButton(context);
const interaction = createInteraction({ userId: "intruder" });
const data: PickerButtonData = {
@@ -317,7 +310,10 @@ describe("Discord model picker interactions", () => {
const dispatchSpy = createDispatchSpy();
const selectInteraction = await runModelSelect({ context });
const selectInteraction = await runModelSelect({
context,
dispatchCommandInteraction: dispatchSpy,
});
expect(selectInteraction.update).toHaveBeenCalledTimes(1);
expect(dispatchSpy).not.toHaveBeenCalled();
@@ -325,6 +321,7 @@ describe("Discord model picker interactions", () => {
const submitInteraction = await runSubmitButton({
context,
data: createModelsViewSubmitData(),
dispatchCommandInteraction: dispatchSpy,
});
expect(submitInteraction.update).toHaveBeenCalledTimes(1);
@@ -332,7 +329,6 @@ describe("Discord model picker interactions", () => {
expectDispatchedModelSelection({
dispatchSpy,
model: "openai/gpt-4o",
requireTargetSessionKey: true,
});
});
@@ -352,9 +348,9 @@ describe("Discord model picker interactions", () => {
.spyOn(commandTextModule, "withTimeout")
.mockRejectedValue(new Error("timeout"));
await runModelSelect({ context });
await runModelSelect({ context, dispatchCommandInteraction: dispatchSpy });
const button = createDiscordModelPickerFallbackButton(context);
const button = createModelPickerFallbackButton(context, dispatchSpy);
const submitInteraction = createInteraction({ userId: "owner" });
const submitData = createModelsViewSubmitData();
@@ -384,7 +380,7 @@ describe("Discord model picker interactions", () => {
"anthropic/claude-sonnet-4-5",
]);
const button = createDiscordModelPickerFallbackButton(context);
const button = createModelPickerFallbackButton(context);
const interaction = createInteraction({ userId: "owner" });
const data: PickerButtonData = {
@@ -433,6 +429,7 @@ describe("Discord model picker interactions", () => {
pg: "1",
rs: "2",
},
dispatchCommandInteraction: dispatchSpy,
});
expect(submitInteraction.update).toHaveBeenCalledTimes(1);
@@ -453,10 +450,10 @@ describe("Discord model picker interactions", () => {
vi.spyOn(modelPickerModule, "loadDiscordModelPickerData").mockResolvedValue(pickerData);
mockModelCommandPipeline(modelCommand);
createDispatchSpy();
const dispatchSpy = createDispatchSpy();
const verboseSpy = vi.spyOn(globalsModule, "logVerbose").mockImplementation(() => {});
const select = createDiscordModelPickerFallbackSelect(context);
const select = createModelPickerFallbackSelect(context, dispatchSpy);
const selectInteraction = createInteraction({
userId: "owner",
values: ["gpt-4o"],
@@ -468,7 +465,7 @@ describe("Discord model picker interactions", () => {
const selectData = createModelsViewSelectData();
await select.run(selectInteraction as unknown as PickerSelectInteraction, selectData);
const button = createDiscordModelPickerFallbackButton(context);
const button = createModelPickerFallbackButton(context, dispatchSpy);
const submitInteraction = createInteraction({ userId: "owner" });
submitInteraction.channel = {
type: ChannelType.PublicThread,

View File

@@ -407,7 +407,7 @@ async function resolveDiscordNativeAutocompleteAuthorized(params: {
const channelSlug = channelName ? normalizeDiscordSlug(channelName) : "";
const rawChannelId = channel?.id ?? "";
const memberRoleIds = Array.isArray(interaction.rawData.member?.roles)
? interaction.rawData.member.roles.map((roleId: string) => String(roleId))
? interaction.rawData.member.roles.map((roleId: string) => roleId)
: [];
const allowNameMatching = isDangerousNameMatchingEnabled(discordConfig);
const useAccessGroups = cfg.commands?.useAccessGroups !== false;
@@ -787,7 +787,7 @@ async function dispatchDiscordCommandInteraction(params: {
const channelSlug = channelName ? normalizeDiscordSlug(channelName) : "";
const rawChannelId = channel?.id ?? "";
const memberRoleIds = Array.isArray(interaction.rawData.member?.roles)
? interaction.rawData.member.roles.map((roleId: string) => String(roleId))
? interaction.rawData.member.roles.map((roleId: string) => roleId)
: [];
const allowNameMatching = isDangerousNameMatchingEnabled(discordConfig);
const { ownerAllowList, ownerAllowed: ownerOk } = resolveDiscordOwnerAccess({

View File

@@ -92,22 +92,17 @@ vi.mock("https-proxy-agent", () => ({
}));
vi.mock("undici", () => ({
ProxyAgent: class {
proxyUrl: string;
constructor(proxyUrl: string) {
this.proxyUrl = proxyUrl;
undiciProxyAgentSpy(proxyUrl);
restProxyAgentSpy(proxyUrl);
}
ProxyAgent: function ProxyAgent(this: { proxyUrl: string }, proxyUrl: string) {
this.proxyUrl = proxyUrl;
undiciProxyAgentSpy(proxyUrl);
restProxyAgentSpy(proxyUrl);
},
fetch: undiciFetchMock,
}));
vi.mock("ws", () => ({
default: class MockWebSocket {
constructor(url: string, options?: { agent?: unknown }) {
webSocketSpy(url, options);
}
default: function MockWebSocket(url: string, options?: { agent?: unknown }) {
webSocketSpy(url, options);
},
}));
@@ -132,19 +127,14 @@ describe("createDiscordGatewayPlugin", () => {
return {
HttpsProxyAgentCtor:
HttpsProxyAgent as unknown as typeof import("https-proxy-agent").HttpsProxyAgent,
ProxyAgentCtor: class {
proxyUrl: string;
constructor(proxyUrl: string) {
this.proxyUrl = proxyUrl;
undiciProxyAgentSpy(proxyUrl);
restProxyAgentSpy(proxyUrl);
}
ProxyAgentCtor: function ProxyAgentCtor(this: { proxyUrl: string }, proxyUrl: string) {
this.proxyUrl = proxyUrl;
undiciProxyAgentSpy(proxyUrl);
restProxyAgentSpy(proxyUrl);
} as unknown as typeof import("undici").ProxyAgent,
undiciFetch: undiciFetchMock,
webSocketCtor: class {
constructor(url: string, options?: { agent?: unknown }) {
webSocketSpy(url, options);
}
webSocketCtor: function WebSocketCtor(url: string, options?: { agent?: unknown }) {
webSocketSpy(url, options);
} as unknown as new (url: string, options?: { agent?: unknown }) => import("ws").WebSocket,
registerClient: async (_plugin: unknown, client: unknown) => {
baseRegisterClientSpy(client);

View File

@@ -58,11 +58,11 @@ vi.mock("./gateway-supervisor.js", () => ({
}));
vi.mock("./listeners.js", () => ({
DiscordMessageListener: class DiscordMessageListener {},
DiscordPresenceListener: class DiscordPresenceListener {},
DiscordReactionListener: class DiscordReactionListener {},
DiscordReactionRemoveListener: class DiscordReactionRemoveListener {},
DiscordThreadUpdateListener: class DiscordThreadUpdateListener {},
DiscordMessageListener: function DiscordMessageListener() {},
DiscordPresenceListener: function DiscordPresenceListener() {},
DiscordReactionListener: function DiscordReactionListener() {},
DiscordReactionRemoveListener: function DiscordReactionRemoveListener() {},
DiscordThreadUpdateListener: function DiscordThreadUpdateListener() {},
registerDiscordListener: vi.fn(),
}));

View File

@@ -77,8 +77,8 @@ function createConfigWithDiscordAccount(overrides: Record<string, unknown> = {})
vi.mock("../voice/manager.runtime.js", () => {
voiceRuntimeModuleLoadedMock();
return {
DiscordVoiceManager: class DiscordVoiceManager {},
DiscordVoiceReadyListener: class DiscordVoiceReadyListener {},
DiscordVoiceManager: function DiscordVoiceManager() {},
DiscordVoiceReadyListener: function DiscordVoiceReadyListener() {},
};
});
describe("monitorDiscordProvider", () => {
@@ -173,8 +173,8 @@ describe("monitorDiscordProvider", () => {
providerTesting.setLoadDiscordVoiceRuntime(async () => {
voiceRuntimeModuleLoadedMock();
return {
DiscordVoiceManager: class DiscordVoiceManager {},
DiscordVoiceReadyListener: class DiscordVoiceReadyListener {},
DiscordVoiceManager: function DiscordVoiceManager() {},
DiscordVoiceReadyListener: function DiscordVoiceReadyListener() {},
} as never;
});
providerTesting.setLoadDiscordProviderSessionRuntime(

View File

@@ -41,7 +41,7 @@ export function resolveReplyContext(
senderTag: sender.tag ?? undefined,
memberRoleIds: (() => {
const roles = (referenced as { member?: { roles?: string[] } }).member?.roles;
return Array.isArray(roles) ? roles.map((roleId) => String(roleId)) : undefined;
return Array.isArray(roles) ? roles.map((roleId) => roleId) : undefined;
})(),
body: referencedText,
timestamp: resolveTimestampMs(referenced.timestamp),

View File

@@ -458,6 +458,62 @@ describe("thread binding lifecycle", () => {
}
});
it("preserves explicit lifecycle windows when rebinding the same thread", async () => {
vi.useFakeTimers();
try {
vi.setSystemTime(new Date("2026-02-20T10:00:00.000Z"));
const manager = createThreadBindingManager({
accountId: "default",
persist: false,
enableSweeper: false,
idleTimeoutMs: 24 * 60 * 60 * 1000,
maxAgeMs: 0,
});
await manager.bindTarget({
threadId: "thread-1",
channelId: "parent-1",
targetKind: "subagent",
targetSessionKey: "agent:main:subagent:child",
agentId: "main",
webhookId: "wh-1",
webhookToken: "tok-1",
});
setThreadBindingIdleTimeoutBySessionKey({
accountId: "default",
targetSessionKey: "agent:main:subagent:child",
idleTimeoutMs: 2 * 60 * 60 * 1000,
});
setThreadBindingMaxAgeBySessionKey({
accountId: "default",
targetSessionKey: "agent:main:subagent:child",
maxAgeMs: 3 * 60 * 60 * 1000,
});
vi.setSystemTime(new Date("2026-02-20T10:30:00.000Z"));
const rebound = await manager.bindTarget({
threadId: "thread-1",
channelId: "parent-1",
targetKind: "subagent",
targetSessionKey: "agent:main:subagent:child",
webhookId: "wh-1",
webhookToken: "tok-1",
});
expect(rebound).toMatchObject({
idleTimeoutMs: 2 * 60 * 60 * 1000,
maxAgeMs: 3 * 60 * 60 * 1000,
});
expect(requireBinding(manager, "thread-1")).toMatchObject({
idleTimeoutMs: 2 * 60 * 60 * 1000,
maxAgeMs: 3 * 60 * 60 * 1000,
});
} finally {
vi.useRealTimers();
}
});
it("keeps binding when idle timeout is disabled per session key", async () => {
vi.useFakeTimers();
try {
@@ -977,6 +1033,67 @@ describe("thread binding lifecycle", () => {
expect(hoisted.restPost).not.toHaveBeenCalled();
});
it("preserves direct-binding metadata when rebinding the same conversation", async () => {
createThreadBindingManager({
accountId: "default",
persist: false,
enableSweeper: false,
idleTimeoutMs: 24 * 60 * 60 * 1000,
maxAgeMs: 0,
});
await getSessionBindingService().bind({
targetSessionKey: "plugin-binding:openclaw-codex-app-server:dm",
targetKind: "session",
conversation: {
channel: "discord",
accountId: "default",
conversationId: "user:1177378744822943744",
},
placement: "current",
metadata: {
pluginBindingOwner: "plugin",
pluginId: "openclaw-codex-app-server",
pluginRoot: "/Users/huntharo/github/openclaw-app-server",
agentId: "codex",
boundBy: "system",
},
});
await getSessionBindingService().bind({
targetSessionKey: "plugin-binding:openclaw-codex-app-server:dm",
targetKind: "session",
conversation: {
channel: "discord",
accountId: "default",
conversationId: "user:1177378744822943744",
},
placement: "current",
metadata: {
label: "codex-dm",
},
});
expect(
getSessionBindingService().resolveByConversation({
channel: "discord",
accountId: "default",
conversationId: "user:1177378744822943744",
}),
).toMatchObject({
metadata: expect.objectContaining({
pluginBindingOwner: "plugin",
pluginId: "openclaw-codex-app-server",
pluginRoot: "/Users/huntharo/github/openclaw-app-server",
agentId: "codex",
boundBy: "system",
label: "codex-dm",
}),
});
expect(hoisted.restGet).not.toHaveBeenCalled();
expect(hoisted.restPost).not.toHaveBeenCalled();
});
it("keeps overlapping thread ids isolated per account", async () => {
const a = createThreadBindingManager({
accountId: "a",

View File

@@ -422,14 +422,21 @@ export function createThreadBindingManager(
return null;
}
const existing = manager.getByThreadId(threadId);
const targetSessionKey = normalizeOptionalString(bindParams.targetSessionKey) ?? "";
if (!targetSessionKey) {
return null;
}
const targetKind = normalizeTargetKind(bindParams.targetKind, targetSessionKey);
let webhookId = normalizeOptionalString(bindParams.webhookId) ?? "";
let webhookToken = normalizeOptionalString(bindParams.webhookToken) ?? "";
let webhookId =
normalizeOptionalString(bindParams.webhookId) ??
normalizeOptionalString(existing?.webhookId) ??
"";
let webhookToken =
normalizeOptionalString(bindParams.webhookToken) ??
normalizeOptionalString(existing?.webhookToken) ??
"";
if (!directConversationBinding && (!webhookId || !webhookToken)) {
const cachedWebhook = findReusableWebhook({ accountId, channelId });
webhookId = cachedWebhook.webhookId ?? "";
@@ -455,19 +462,27 @@ export function createThreadBindingManager(
targetSessionKey,
agentId:
normalizeOptionalString(bindParams.agentId) ??
normalizeOptionalString(existing?.agentId) ??
resolveAgentIdFromSessionKey(targetSessionKey),
label: normalizeOptionalString(bindParams.label),
label:
normalizeOptionalString(bindParams.label) ?? normalizeOptionalString(existing?.label),
webhookId: webhookId || undefined,
webhookToken: webhookToken || undefined,
boundBy: normalizeOptionalString(bindParams.boundBy) || "system",
boundBy:
normalizeOptionalString(bindParams.boundBy) ??
normalizeOptionalString(existing?.boundBy) ??
"system",
boundAt: now,
lastActivityAt: now,
idleTimeoutMs,
maxAgeMs,
idleTimeoutMs:
typeof existing?.idleTimeoutMs === "number" ? existing.idleTimeoutMs : idleTimeoutMs,
maxAgeMs: typeof existing?.maxAgeMs === "number" ? existing.maxAgeMs : maxAgeMs,
metadata:
bindParams.metadata && typeof bindParams.metadata === "object"
? { ...bindParams.metadata }
: undefined,
? { ...existing?.metadata, ...bindParams.metadata }
: existing?.metadata
? { ...existing.metadata }
: undefined,
};
setBindingRecord(record);

View File

@@ -1,7 +1,7 @@
import { RateLimitError } from "@buape/carbon";
import { ChannelType, Routes } from "discord-api-types/v10";
import { loadWebMediaRaw } from "openclaw/plugin-sdk/web-media";
import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import { makeDiscordRest } from "./send.test-harness.js";
vi.mock("openclaw/plugin-sdk/web-media", async () => {
@@ -63,6 +63,14 @@ beforeEach(() => {
vi.clearAllMocks();
});
afterEach(() => {
vi.useRealTimers();
});
afterAll(() => {
vi.doUnmock("openclaw/plugin-sdk/web-media");
});
describe("sendMessageDiscord", () => {
it("creates a thread", async () => {
const { rest, getMock, postMock } = makeDiscordRest();
@@ -475,29 +483,29 @@ describe("retry rate limits", () => {
});
it("uses retry_after delays when rate limited", async () => {
vi.useFakeTimers();
const setTimeoutSpy = vi.spyOn(global, "setTimeout");
const { rest, postMock } = makeDiscordRest();
const rateLimitError = createMockRateLimitError(0.5);
try {
const { rest, postMock } = makeDiscordRest();
const rateLimitError = createMockRateLimitError(0.001);
postMock
.mockRejectedValueOnce(rateLimitError)
.mockResolvedValueOnce({ id: "msg1", channel_id: "789" });
postMock
.mockRejectedValueOnce(rateLimitError)
.mockResolvedValueOnce({ id: "msg1", channel_id: "789" });
const promise = sendMessageDiscord("channel:789", "hello", {
rest,
token: "t",
retry: { attempts: 2, minDelayMs: 0, maxDelayMs: 1000, jitter: 0 },
});
const promise = sendMessageDiscord("channel:789", "hello", {
rest,
token: "t",
retry: { attempts: 2, minDelayMs: 0, maxDelayMs: 1000, jitter: 0 },
});
await vi.runAllTimersAsync();
await expect(promise).resolves.toEqual({
messageId: "msg1",
channelId: "789",
});
expect(setTimeoutSpy.mock.calls[0]?.[1]).toBe(500);
setTimeoutSpy.mockRestore();
vi.useRealTimers();
await expect(promise).resolves.toEqual({
messageId: "msg1",
channelId: "789",
});
expect(setTimeoutSpy.mock.calls[0]?.[1]).toBe(1);
} finally {
setTimeoutSpy.mockRestore();
}
});
it("stops after max retry attempts", async () => {

View File

@@ -341,7 +341,7 @@ vi.mock("@buape/carbon/gateway", () => ({
}));
vi.mock("@buape/carbon/voice", () => ({
VoicePlugin: class VoicePlugin {},
VoicePlugin: function VoicePlugin() {},
}));
vi.mock("openclaw/plugin-sdk/acp-runtime", async () => {
@@ -472,11 +472,11 @@ vi.mock(buildDiscordSourceModuleId("monitor/gateway-plugin.js"), () => ({
}));
vi.mock(buildDiscordSourceModuleId("monitor/listeners.js"), () => ({
DiscordMessageListener: class DiscordMessageListener {},
DiscordPresenceListener: class DiscordPresenceListener {},
DiscordReactionListener: class DiscordReactionListener {},
DiscordReactionRemoveListener: class DiscordReactionRemoveListener {},
DiscordThreadUpdateListener: class DiscordThreadUpdateListener {},
DiscordMessageListener: function DiscordMessageListener() {},
DiscordPresenceListener: function DiscordPresenceListener() {},
DiscordReactionListener: function DiscordReactionListener() {},
DiscordReactionRemoveListener: function DiscordReactionRemoveListener() {},
DiscordThreadUpdateListener: function DiscordThreadUpdateListener() {},
registerDiscordListener: vi.fn(),
}));

View File

@@ -98,7 +98,7 @@ async function authorizeVoiceCommand(
}
const memberRoleIds = Array.isArray(interaction.rawData.member?.roles)
? interaction.rawData.member.roles.map((roleId: string) => String(roleId))
? interaction.rawData.member.roles.map((roleId: string) => roleId)
: [];
const sender = resolveDiscordSenderIdentity({ author: user, member: interaction.rawData.member });
const access = await authorizeDiscordVoiceIngress({

View File

@@ -407,7 +407,9 @@ describe("DiscordVoiceManager", () => {
await manager.join({ guildId: "g1", channelId: "1001" });
const entry = (manager as unknown as { sessions: Map<string, unknown> }).sessions.get("g1") as
const entry = (manager as unknown as { sessions: Map<string, unknown> }).sessions.get(
"g1",
) as
| {
guildId: string;
channelId: string;

View File

@@ -9,7 +9,7 @@ const PROVIDER_ID = "fal";
export default definePluginEntry({
id: PROVIDER_ID,
name: "fal Provider",
description: "Bundled fal image generation provider",
description: "Bundled fal image and video generation provider",
register(api) {
api.registerProvider({
id: PROVIDER_ID,
@@ -21,7 +21,7 @@ export default definePluginEntry({
providerId: PROVIDER_ID,
methodId: "api-key",
label: "fal API key",
hint: "Image generation API key",
hint: "Image and video generation API key",
optionKey: "falApiKey",
flagName: "--fal-api-key",
envVar: "FAL_KEY",
@@ -32,10 +32,10 @@ export default definePluginEntry({
wizard: {
choiceId: "fal-api-key",
choiceLabel: "fal API key",
choiceHint: "Image generation API key",
choiceHint: "Image and video generation API key",
groupId: "fal",
groupLabel: "fal",
groupHint: "Image generation",
groupHint: "Image and video generation",
onboardingScopes: ["image-generation"],
},
}),

View File

@@ -13,7 +13,7 @@
"choiceLabel": "fal API key",
"groupId": "fal",
"groupLabel": "fal",
"groupHint": "Image generation",
"groupHint": "Image and video generation",
"onboardingScopes": ["image-generation"],
"optionKey": "falApiKey",
"cliFlag": "--fal-api-key",

View File

@@ -115,4 +115,198 @@ describe("fal video generation provider", () => {
requestId: "req-123",
});
});
it("exposes Seedance 2 models", () => {
const provider = buildFalVideoGenerationProvider();
expect(provider.models).toEqual(
expect.arrayContaining([
"fal-ai/heygen/v2/video-agent",
"bytedance/seedance-2.0/fast/text-to-video",
"bytedance/seedance-2.0/fast/image-to-video",
"bytedance/seedance-2.0/text-to-video",
"bytedance/seedance-2.0/image-to-video",
]),
);
});
it("submits HeyGen video-agent requests without unsupported fal controls", async () => {
vi.spyOn(providerAuth, "resolveApiKeyForProvider").mockResolvedValue({
apiKey: "fal-key",
source: "env",
mode: "api-key",
});
vi.spyOn(providerHttp, "resolveProviderHttpRequestConfig").mockReturnValue({
baseUrl: "https://fal.run",
allowPrivateNetwork: false,
headers: new Headers({
Authorization: "Key fal-key",
"Content-Type": "application/json",
}),
dispatcherPolicy: undefined,
requestConfig: createMockRequestConfig(),
});
vi.spyOn(providerHttp, "assertOkOrThrowHttpError").mockResolvedValue(undefined);
_setFalVideoFetchGuardForTesting(fetchGuardMock as never);
fetchGuardMock
.mockResolvedValueOnce({
response: {
json: async () => ({
request_id: "heygen-req-123",
status_url:
"https://queue.fal.run/fal-ai/heygen/v2/video-agent/requests/heygen-req-123/status",
response_url:
"https://queue.fal.run/fal-ai/heygen/v2/video-agent/requests/heygen-req-123",
}),
},
release: vi.fn(async () => {}),
})
.mockResolvedValueOnce({
response: {
json: async () => ({
status: "COMPLETED",
}),
},
release: vi.fn(async () => {}),
})
.mockResolvedValueOnce({
response: {
json: async () => ({
status: "COMPLETED",
response: {
video: { url: "https://fal.run/files/heygen.mp4" },
},
}),
},
release: vi.fn(async () => {}),
})
.mockResolvedValueOnce({
response: {
headers: new Headers({ "content-type": "video/mp4" }),
arrayBuffer: async () => Buffer.from("heygen-mp4-bytes"),
},
release: vi.fn(async () => {}),
});
const provider = buildFalVideoGenerationProvider();
const result = await provider.generateVideo({
provider: "fal",
model: "fal-ai/heygen/v2/video-agent",
prompt: "A founder explains OpenClaw in a concise studio video",
durationSeconds: 8,
aspectRatio: "16:9",
resolution: "720P",
audio: true,
cfg: {},
});
expect(fetchGuardMock).toHaveBeenNthCalledWith(
1,
expect.objectContaining({
url: "https://queue.fal.run/fal-ai/heygen/v2/video-agent",
}),
);
const submitBody = JSON.parse(
String(fetchGuardMock.mock.calls[0]?.[0]?.init?.body ?? "{}"),
) as Record<string, unknown>;
expect(submitBody).toEqual({
prompt: "A founder explains OpenClaw in a concise studio video",
});
expect(result.metadata).toEqual({
requestId: "heygen-req-123",
});
});
it("submits Seedance 2 requests with fal schema fields", async () => {
vi.spyOn(providerAuth, "resolveApiKeyForProvider").mockResolvedValue({
apiKey: "fal-key",
source: "env",
mode: "api-key",
});
vi.spyOn(providerHttp, "resolveProviderHttpRequestConfig").mockReturnValue({
baseUrl: "https://fal.run",
allowPrivateNetwork: false,
headers: new Headers({
Authorization: "Key fal-key",
"Content-Type": "application/json",
}),
dispatcherPolicy: undefined,
requestConfig: createMockRequestConfig(),
});
vi.spyOn(providerHttp, "assertOkOrThrowHttpError").mockResolvedValue(undefined);
_setFalVideoFetchGuardForTesting(fetchGuardMock as never);
fetchGuardMock
.mockResolvedValueOnce({
response: {
json: async () => ({
request_id: "seedance-req-123",
status_url:
"https://queue.fal.run/bytedance/seedance-2.0/fast/text-to-video/requests/seedance-req-123/status",
response_url:
"https://queue.fal.run/bytedance/seedance-2.0/fast/text-to-video/requests/seedance-req-123",
}),
},
release: vi.fn(async () => {}),
})
.mockResolvedValueOnce({
response: {
json: async () => ({
status: "COMPLETED",
}),
},
release: vi.fn(async () => {}),
})
.mockResolvedValueOnce({
response: {
json: async () => ({
status: "COMPLETED",
response: {
video: { url: "https://fal.run/files/seedance.mp4" },
seed: 42,
},
}),
},
release: vi.fn(async () => {}),
})
.mockResolvedValueOnce({
response: {
headers: new Headers({ "content-type": "video/mp4" }),
arrayBuffer: async () => Buffer.from("seedance-mp4-bytes"),
},
release: vi.fn(async () => {}),
});
const provider = buildFalVideoGenerationProvider();
const result = await provider.generateVideo({
provider: "fal",
model: "bytedance/seedance-2.0/fast/text-to-video",
prompt: "A chrome lobster drives a tiny kart across a neon pier",
durationSeconds: 7,
aspectRatio: "16:9",
resolution: "720P",
audio: false,
cfg: {},
});
expect(fetchGuardMock).toHaveBeenNthCalledWith(
1,
expect.objectContaining({
url: "https://queue.fal.run/bytedance/seedance-2.0/fast/text-to-video",
}),
);
const submitBody = JSON.parse(
String(fetchGuardMock.mock.calls[0]?.[0]?.init?.body ?? "{}"),
) as Record<string, unknown>;
expect(submitBody).toEqual({
prompt: "A chrome lobster drives a tiny kart across a neon pier",
aspect_ratio: "16:9",
resolution: "720p",
duration: "7",
generate_audio: false,
});
expect(result.metadata).toEqual({
requestId: "seedance-req-123",
seed: 42,
});
});
});

View File

@@ -22,6 +22,14 @@ import type {
const DEFAULT_FAL_BASE_URL = "https://fal.run";
const DEFAULT_FAL_QUEUE_BASE_URL = "https://queue.fal.run";
const DEFAULT_FAL_VIDEO_MODEL = "fal-ai/minimax/video-01-live";
const HEYGEN_VIDEO_AGENT_MODEL = "fal-ai/heygen/v2/video-agent";
const SEEDANCE_2_VIDEO_MODELS = [
"bytedance/seedance-2.0/fast/text-to-video",
"bytedance/seedance-2.0/fast/image-to-video",
"bytedance/seedance-2.0/text-to-video",
"bytedance/seedance-2.0/image-to-video",
] as const;
const SEEDANCE_2_DURATION_SECONDS = [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] as const;
const DEFAULT_HTTP_TIMEOUT_MS = 30_000;
const DEFAULT_OPERATION_TIMEOUT_MS = 600_000;
const POLL_INTERVAL_MS = 5_000;
@@ -36,6 +44,7 @@ type FalVideoResponse = {
content_type?: string;
}>;
prompt?: string;
seed?: number;
};
type FalQueueResponse = {
@@ -114,6 +123,38 @@ function isFalMiniMaxLiveModel(model: string): boolean {
return normalizeLowercaseStringOrEmpty(model) === DEFAULT_FAL_VIDEO_MODEL;
}
function isFalSeedance2Model(model: string): boolean {
return SEEDANCE_2_VIDEO_MODELS.includes(model as (typeof SEEDANCE_2_VIDEO_MODELS)[number]);
}
function isFalHeyGenVideoAgentModel(model: string): boolean {
return normalizeLowercaseStringOrEmpty(model) === HEYGEN_VIDEO_AGENT_MODEL;
}
function resolveFalResolution(resolution: VideoGenerationRequest["resolution"], model: string) {
if (!resolution) {
return undefined;
}
if (isFalSeedance2Model(model)) {
return resolution.toLowerCase();
}
return resolution;
}
function resolveFalDuration(
durationSeconds: number | undefined,
model: string,
): number | string | undefined {
if (typeof durationSeconds !== "number" || !Number.isFinite(durationSeconds)) {
return undefined;
}
const duration = Math.max(1, Math.round(durationSeconds));
if (isFalSeedance2Model(model)) {
return String(duration);
}
return duration;
}
function buildFalVideoRequestBody(params: {
req: VideoGenerationRequest;
model: string;
@@ -132,7 +173,7 @@ function buildFalVideoRequestBody(params: {
// MiniMax Live on fal currently documents prompt + optional image_url only.
// Keep the default model conservative so queue requests do not hang behind
// unsupported knobs such as duration/resolution/aspect-ratio overrides.
if (isFalMiniMaxLiveModel(params.model)) {
if (isFalMiniMaxLiveModel(params.model) || isFalHeyGenVideoAgentModel(params.model)) {
return requestBody;
}
const aspectRatio = normalizeOptionalString(params.req.aspectRatio);
@@ -143,14 +184,16 @@ function buildFalVideoRequestBody(params: {
if (size) {
requestBody.size = size;
}
if (params.req.resolution) {
requestBody.resolution = params.req.resolution;
const resolution = resolveFalResolution(params.req.resolution, params.model);
if (resolution) {
requestBody.resolution = resolution;
}
if (
typeof params.req.durationSeconds === "number" &&
Number.isFinite(params.req.durationSeconds)
) {
requestBody.duration = Math.max(1, Math.round(params.req.durationSeconds));
const duration = resolveFalDuration(params.req.durationSeconds, params.model);
if (duration) {
requestBody.duration = duration;
}
if (isFalSeedance2Model(params.model) && typeof params.req.audio === "boolean") {
requestBody.generate_audio = params.req.audio;
}
return requestBody;
}
@@ -247,6 +290,8 @@ export function buildFalVideoGenerationProvider(): VideoGenerationProvider {
defaultModel: DEFAULT_FAL_VIDEO_MODEL,
models: [
DEFAULT_FAL_VIDEO_MODEL,
HEYGEN_VIDEO_AGENT_MODEL,
...SEEDANCE_2_VIDEO_MODELS,
"fal-ai/kling-video/v2.1/master/text-to-video",
"fal-ai/wan/v2.2-a14b/text-to-video",
"fal-ai/wan/v2.2-a14b/image-to-video",
@@ -259,17 +304,25 @@ export function buildFalVideoGenerationProvider(): VideoGenerationProvider {
capabilities: {
generate: {
maxVideos: 1,
supportedDurationSecondsByModel: Object.fromEntries(
SEEDANCE_2_VIDEO_MODELS.map((model) => [model, SEEDANCE_2_DURATION_SECONDS]),
),
supportsAspectRatio: true,
supportsResolution: true,
supportsSize: true,
supportsAudio: true,
},
imageToVideo: {
enabled: true,
maxVideos: 1,
maxInputImages: 1,
supportedDurationSecondsByModel: Object.fromEntries(
SEEDANCE_2_VIDEO_MODELS.map((model) => [model, SEEDANCE_2_DURATION_SECONDS]),
),
supportsAspectRatio: true,
supportsResolution: true,
supportsSize: true,
supportsAudio: true,
},
videoToVideo: {
enabled: false,
@@ -349,6 +402,7 @@ export function buildFalVideoGenerationProvider(): VideoGenerationProvider {
? { requestId: normalizeOptionalString(submitted.request_id) }
: {}),
...(videoPayload.prompt ? { prompt: videoPayload.prompt } : {}),
...(typeof videoPayload.seed === "number" ? { seed: videoPayload.seed } : {}),
},
};
},

View File

@@ -1058,7 +1058,7 @@ export const feishuPlugin: ChannelPlugin<ResolvedFeishuAccount, FeishuProbeResul
return jsonActionResult({ ok: true, reactions });
}
throw new Error(`Unsupported Feishu action: "${String(ctx.action)}"`);
throw new Error(`Unsupported Feishu action: "${ctx.action}"`);
},
},
bindings: {

View File

@@ -42,7 +42,7 @@ export function resolveFeishuAllowlistMatch(params: {
// Feishu allowlists are ID-based; mutable display names must never grant access.
const senderCandidates = [params.senderId, ...(params.senderIds ?? [])]
.map((entry) => normalizeFeishuAllowEntry(String(entry ?? "")))
.map((entry) => normalizeFeishuAllowEntry(entry ?? ""))
.filter(Boolean);
for (const senderId of senderCandidates) {

View File

@@ -276,7 +276,7 @@ function parseFeishuMessageItem(
senderType: item.sender?.sender_type,
content: parseFeishuMessageContent(rawContent, msgType),
contentType: msgType,
createTime: item.create_time ? parseInt(String(item.create_time), 10) : undefined,
createTime: item.create_time ? parseInt(item.create_time, 10) : undefined,
threadId: item.thread_id || undefined,
};
}

View File

@@ -91,4 +91,53 @@ describe("Feishu thread bindings", () => {
}),
).toBeNull();
});
it("preserves delivery routing metadata when rebinding the same conversation", async () => {
const manager = createFeishuThreadBindingManager({ cfg: baseCfg, accountId: "default" });
manager.bindConversation({
conversationId: "oc_group_chat:topic:om_topic_root:sender:ou_sender_1",
parentConversationId: "oc_group_chat",
targetKind: "subagent",
targetSessionKey: "agent:main:subagent:child",
metadata: {
agentId: "codex",
label: "child",
boundBy: "system",
deliveryTo: "user:ou_sender_1",
deliveryThreadId: "om_topic_root",
},
});
await getSessionBindingService().bind({
targetSessionKey: "agent:main:subagent:child",
targetKind: "subagent",
conversation: {
channel: "feishu",
accountId: "default",
conversationId: "oc_group_chat:topic:om_topic_root:sender:ou_sender_1",
parentConversationId: "oc_group_chat",
},
placement: "current",
metadata: {
label: "child",
},
});
expect(
getSessionBindingService().resolveByConversation({
channel: "feishu",
accountId: "default",
conversationId: "oc_group_chat:topic:om_topic_root:sender:ou_sender_1",
}),
).toMatchObject({
metadata: expect.objectContaining({
agentId: "codex",
label: "child",
boundBy: "system",
deliveryTo: "user:ou_sender_1",
deliveryThreadId: "om_topic_root",
}),
});
});
});

View File

@@ -159,36 +159,41 @@ export function createFeishuThreadBindingManager(params: {
metadata,
}) => {
const normalizedConversationId = conversationId.trim();
if (!normalizedConversationId || !targetSessionKey.trim()) {
const normalizedTargetSessionKey = targetSessionKey.trim();
if (!normalizedConversationId || !normalizedTargetSessionKey) {
return null;
}
const existing = getState().bindingsByAccountConversation.get(
resolveBindingKey({ accountId, conversationId: normalizedConversationId }),
);
const now = Date.now();
const record: FeishuThreadBindingRecord = {
accountId,
conversationId: normalizedConversationId,
parentConversationId: normalizeOptionalString(parentConversationId),
parentConversationId:
normalizeOptionalString(parentConversationId) ?? existing?.parentConversationId,
deliveryTo:
typeof metadata?.deliveryTo === "string" && metadata.deliveryTo.trim()
? metadata.deliveryTo.trim()
: undefined,
: existing?.deliveryTo,
deliveryThreadId:
typeof metadata?.deliveryThreadId === "string" && metadata.deliveryThreadId.trim()
? metadata.deliveryThreadId.trim()
: undefined,
: existing?.deliveryThreadId,
targetKind: toFeishuTargetKind(targetKind),
targetSessionKey: targetSessionKey.trim(),
targetSessionKey: normalizedTargetSessionKey,
agentId:
typeof metadata?.agentId === "string" && metadata.agentId.trim()
? metadata.agentId.trim()
: resolveAgentIdFromSessionKey(targetSessionKey),
: (existing?.agentId ?? resolveAgentIdFromSessionKey(normalizedTargetSessionKey)),
label:
typeof metadata?.label === "string" && metadata.label.trim()
? metadata.label.trim()
: undefined,
: existing?.label,
boundBy:
typeof metadata?.boundBy === "string" && metadata.boundBy.trim()
? metadata.boundBy.trim()
: undefined,
: existing?.boundBy,
boundAt: now,
lastActivityAt: now,
};

View File

@@ -141,7 +141,7 @@ async function postFirecrawlJson<T>(
detail = errorBody.text;
}
}
const safeDetail = wrapWebContent(String(detail).slice(0, 1_000), "web_fetch");
const safeDetail = wrapWebContent(detail.slice(0, 1_000), "web_fetch");
throw new Error(`${params.errorLabel} API error (${response.status}): ${safeDetail}`);
}
return await parse(response);

View File

@@ -1,5 +1,6 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import { mockPinnedHostnameResolution } from "../../../src/test-helpers/ssrf.js";
import {
DEFAULT_FIRECRAWL_BASE_URL,
DEFAULT_FIRECRAWL_MAX_AGE_MS,
@@ -35,6 +36,7 @@ describe("firecrawl tools", () => {
let createFirecrawlSearchTool: typeof import("./firecrawl-search-tool.js").createFirecrawlSearchTool;
let createFirecrawlScrapeTool: typeof import("./firecrawl-scrape-tool.js").createFirecrawlScrapeTool;
let firecrawlClientTesting: typeof import("./firecrawl-client.js").__testing;
let ssrfMock: { mockRestore: () => void } | undefined;
beforeAll(async () => {
({ fetchFirecrawlContent } = await import("../api.js"));
@@ -47,6 +49,7 @@ describe("firecrawl tools", () => {
});
beforeEach(() => {
ssrfMock = mockPinnedHostnameResolution();
runFirecrawlSearch.mockReset();
runFirecrawlSearch.mockImplementation(async (params: Record<string, unknown>) => params);
runFirecrawlScrape.mockReset();
@@ -58,6 +61,8 @@ describe("firecrawl tools", () => {
});
afterEach(() => {
ssrfMock?.mockRestore();
ssrfMock = undefined;
global.fetch = priorFetch;
});

View File

@@ -71,7 +71,7 @@ export function registerGoogleGeminiCliProvider(api: OpenClawPluginApi) {
openUrl: ctx.openUrl,
log: (msg) => ctx.runtime.log(msg),
note: ctx.prompter.note,
prompt: async (message) => String(await ctx.prompter.text({ message })),
prompt: async (message) => ctx.prompter.text({ message }),
progress: spin,
});

View File

@@ -1,5 +1,5 @@
import { GoogleGenAI } from "@google/genai";
import { extensionForMime } from "openclaw/plugin-sdk/msteams";
import { extensionForMime } from "openclaw/plugin-sdk/media-mime";
import type {
GeneratedMusicAsset,
MusicGenerationProvider,

View File

@@ -262,13 +262,13 @@ describe("extractGeminiCliCredentials", () => {
});
mockRealpathSync.mockReturnValue(resolvedPath);
mockReaddirSync.mockImplementation((p: string) => {
if (normalizePath(String(p)) === normalizePath(bundleDir)) {
if (normalizePath(p) === normalizePath(bundleDir)) {
return [dirent("chunk-ABC123.js", false)];
}
return [];
});
mockReadFileSync.mockImplementation((p: string) => {
if (normalizePath(String(p)) === normalizePath(chunkPath)) {
if (normalizePath(p) === normalizePath(chunkPath)) {
return params.bundleContent;
}
throw new Error(`Unexpected read for ${p}`);

View File

@@ -114,7 +114,7 @@ export async function verifyGoogleChatRequest(params: {
audience,
});
const payload = ticket.getPayload();
const email = normalizeLowercaseStringOrEmpty(String(payload?.email ?? ""));
const email = normalizeLowercaseStringOrEmpty(payload?.email ?? "");
if (!payload?.email_verified) {
return { ok: false, reason: "email not verified" };
}
@@ -130,7 +130,7 @@ export async function verifyGoogleChatRequest(params: {
if (!expectedAddOnPrincipal) {
return { ok: false, reason: "missing add-on principal binding" };
}
const tokenPrincipal = normalizeLowercaseStringOrEmpty(String(payload?.sub ?? ""));
const tokenPrincipal = normalizeLowercaseStringOrEmpty(payload?.sub ?? "");
if (!tokenPrincipal || tokenPrincipal !== expectedAddOnPrincipal) {
return {
ok: false,

View File

@@ -178,7 +178,7 @@ export const googlechatPlugin = createChatChannelPlugin({
defaultRuntime: createDefaultChannelRuntimeState(DEFAULT_ACCOUNT_ID),
collectStatusIssues: (accounts): ChannelStatusIssue[] =>
accounts.flatMap((entry) => {
const accountId = String(entry.accountId ?? DEFAULT_ACCOUNT_ID);
const accountId = entry.accountId ?? DEFAULT_ACCOUNT_ID;
const enabled = entry.enabled !== false;
const configured = entry.configured === true;
if (!enabled || !configured) {

View File

@@ -45,7 +45,7 @@ export function isSenderAllowed(
const normalizedSenderId = normalizeUserId(senderId);
const normalizedEmail = normalizeLowercaseStringOrEmpty(senderEmail ?? "");
return allowFrom.some((entry) => {
const normalized = normalizeLowercaseStringOrEmpty(String(entry));
const normalized = normalizeLowercaseStringOrEmpty(entry);
if (!normalized) {
return false;
}

View File

@@ -149,7 +149,7 @@ export const googlechatSetupWizard: ChannelSetupWizard = {
credentialValues: {
...credentialValues,
[USE_ENV_FLAG]: "0",
[AUTH_METHOD_FLAG]: String(method),
[AUTH_METHOD_FLAG]: method,
},
};
},

View File

@@ -27,7 +27,7 @@ vi.mock("../runtime-api.js", async () => {
});
vi.mock("google-auth-library", () => ({
GoogleAuth: class {},
GoogleAuth: function GoogleAuth() {},
OAuth2Client: class {
verifyIdToken = mocks.verifyIdToken;
},

View File

@@ -73,7 +73,7 @@ export const HUGGINGFACE_MODEL_CATALOG: ModelDefinitionConfig[] = [
];
export function isHuggingfacePolicyLocked(modelRef: string): boolean {
const ref = String(modelRef).trim();
const ref = modelRef.trim();
return HUGGINGFACE_POLICY_SUFFIXES.some((suffix) => ref.endsWith(`:${suffix}`) || ref === suffix);
}

View File

@@ -16,6 +16,6 @@ export function resolveIMessageConfigDefaultTo(params: {
if (defaultTo == null) {
return undefined;
}
const normalized = String(defaultTo).trim();
const normalized = defaultTo.trim();
return normalized || undefined;
}

View File

@@ -385,10 +385,10 @@ export async function monitorIMessageProvider(opts: MonitorIMessageOpts = {}): P
});
if (shouldLogVerbose()) {
const preview = truncateUtf16Safe(String(ctxPayload.Body ?? ""), 200).replace(/\n/g, "\\n");
const preview = truncateUtf16Safe(ctxPayload.Body ?? "", 200).replace(/\n/g, "\\n");
logVerbose(
`imessage inbound: chatId=${chatId ?? "unknown"} from=${ctxPayload.From} len=${
String(ctxPayload.Body ?? "").length
(ctxPayload.Body ?? "").length
} preview="${preview}"`,
);
}

Some files were not shown because too many files have changed in this diff Show More