mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-07 14:31:35 +08:00
Compare commits
225 Commits
ci-core-te
...
codex/fix-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ace3068fe3 | ||
|
|
1fb8a8cdff | ||
|
|
3b6fac85ea | ||
|
|
8f94032dc1 | ||
|
|
f1b6934700 | ||
|
|
efab9763dc | ||
|
|
4360a59c6d | ||
|
|
db546f8d33 | ||
|
|
f6f81960f3 | ||
|
|
1c7444dab6 | ||
|
|
84fb20aa52 | ||
|
|
da1e60a6aa | ||
|
|
ef5b257c30 | ||
|
|
2fe860b803 | ||
|
|
e5e95f30ea | ||
|
|
fb5611b0c4 | ||
|
|
78a4b0e8d3 | ||
|
|
07edaffb04 | ||
|
|
8a5b4b07f9 | ||
|
|
c3aeb71f74 | ||
|
|
c40d2a424d | ||
|
|
c88a3d5152 | ||
|
|
94a90fcb85 | ||
|
|
ecb10c1de9 | ||
|
|
192ee081e7 | ||
|
|
f2065a7651 | ||
|
|
daccfa2152 | ||
|
|
9d63e54e33 | ||
|
|
9403008c6c | ||
|
|
f5d0b54563 | ||
|
|
8ae6d42faa | ||
|
|
1e4036a2f1 | ||
|
|
7198a9f0ee | ||
|
|
350299401f | ||
|
|
81235fd923 | ||
|
|
95bc417944 | ||
|
|
707cc315cc | ||
|
|
58020ab759 | ||
|
|
efbab8ff8c | ||
|
|
c2f6ad9b38 | ||
|
|
42a4dee8b6 | ||
|
|
569751898f | ||
|
|
69244f837f | ||
|
|
25f56eb317 | ||
|
|
32a25b865f | ||
|
|
0e56140dba | ||
|
|
bb70a59b36 | ||
|
|
54cb10e79a | ||
|
|
48a66a647d | ||
|
|
541f768249 | ||
|
|
0f19271092 | ||
|
|
6c574d726b | ||
|
|
7e7a269ad1 | ||
|
|
831386bd60 | ||
|
|
07232b90c9 | ||
|
|
b56cd114e7 | ||
|
|
21dfea837c | ||
|
|
dc008f956c | ||
|
|
202f80792e | ||
|
|
a2dbc1b63c | ||
|
|
343541217a | ||
|
|
7e28bd23ae | ||
|
|
39d1a817fa | ||
|
|
ce87edbad4 | ||
|
|
3182dac7b1 | ||
|
|
60b61288c4 | ||
|
|
70cfdc890b | ||
|
|
dcf49fa5d8 | ||
|
|
29018b4af5 | ||
|
|
aaec5c3283 | ||
|
|
dbe4cf24a5 | ||
|
|
4c74c0db18 | ||
|
|
bef2fde77f | ||
|
|
a775051ac6 | ||
|
|
187449d149 | ||
|
|
0bd008ca83 | ||
|
|
0c0cb1a3c0 | ||
|
|
de74d843f5 | ||
|
|
edb8f52c07 | ||
|
|
bbdcf2963b | ||
|
|
4ba3ea30b0 | ||
|
|
9b95d65ea2 | ||
|
|
a46606924f | ||
|
|
562025f8dc | ||
|
|
85c7748520 | ||
|
|
c254ebfbef | ||
|
|
d014567246 | ||
|
|
133b90d5c5 | ||
|
|
761b71e268 | ||
|
|
9ec0dc7ac5 | ||
|
|
24ac5ddf7f | ||
|
|
957171b2e0 | ||
|
|
754aaa2670 | ||
|
|
7d3062270c | ||
|
|
3e80bd33e4 | ||
|
|
780e0898b0 | ||
|
|
d41f3d6eb6 | ||
|
|
d46d0d070a | ||
|
|
a77f76b4d0 | ||
|
|
d369dbe65c | ||
|
|
a3b047b5fc | ||
|
|
32ad88da98 | ||
|
|
1fb2e18f47 | ||
|
|
5c0d1c6a40 | ||
|
|
ab687f4637 | ||
|
|
f9a5e0a64f | ||
|
|
7f54cf73e2 | ||
|
|
eb185f4a03 | ||
|
|
b9a9472cfd | ||
|
|
6b100ca559 | ||
|
|
fc132acfc4 | ||
|
|
f65ffdff96 | ||
|
|
aa5bec4bdf | ||
|
|
1038c1b8f3 | ||
|
|
4a20e9f257 | ||
|
|
626eaf8496 | ||
|
|
6aa63b4fdd | ||
|
|
13337d7048 | ||
|
|
9e0d358695 | ||
|
|
37b91be894 | ||
|
|
950ecd30ec | ||
|
|
99fc830b73 | ||
|
|
2a57127e52 | ||
|
|
b2475884fd | ||
|
|
fe6341f702 | ||
|
|
55578a5c40 | ||
|
|
d744073d67 | ||
|
|
b4fdd9c495 | ||
|
|
756d715ce0 | ||
|
|
4c0eb14985 | ||
|
|
0ff47c8720 | ||
|
|
9f476107ea | ||
|
|
dba2e189e7 | ||
|
|
ef8281b018 | ||
|
|
6757f78662 | ||
|
|
b78d9df90e | ||
|
|
aed57c95ec | ||
|
|
551b6a61e6 | ||
|
|
9ec96f476d | ||
|
|
0b02b5abd2 | ||
|
|
8166d592d9 | ||
|
|
776c8e037e | ||
|
|
b146c0c26b | ||
|
|
7392060c3f | ||
|
|
d44cd0d452 | ||
|
|
d85b2a0e81 | ||
|
|
00837f05bf | ||
|
|
b9862a36b2 | ||
|
|
aaac83f392 | ||
|
|
6d344d28a1 | ||
|
|
1bb2807aca | ||
|
|
6afff0642e | ||
|
|
270630ba35 | ||
|
|
55f35708e1 | ||
|
|
6504087b97 | ||
|
|
5ed410b79e | ||
|
|
11b0016e9e | ||
|
|
b9ddfa6d90 | ||
|
|
2c9c6207fa | ||
|
|
f43140a50f | ||
|
|
a94b926944 | ||
|
|
0f39df348d | ||
|
|
ebfd468ee0 | ||
|
|
7c02b6df84 | ||
|
|
fa040b41de | ||
|
|
58531530d9 | ||
|
|
85ee6f2967 | ||
|
|
a9100a33c2 | ||
|
|
f2d9b9c69c | ||
|
|
22e7b462c5 | ||
|
|
fdb08dd35b | ||
|
|
2202392849 | ||
|
|
0f9de014e9 | ||
|
|
725fa51ac0 | ||
|
|
d2e2798f39 | ||
|
|
1edd47ac08 | ||
|
|
c53a1b167f | ||
|
|
fe3d143854 | ||
|
|
9469ffc095 | ||
|
|
2b45a90f71 | ||
|
|
39553b1b4b | ||
|
|
369d8a6c53 | ||
|
|
cfc1ce7547 | ||
|
|
9cbfbd18e3 | ||
|
|
c94888dbee | ||
|
|
2e8b6eac8d | ||
|
|
5c126dc6ac | ||
|
|
fa44a31920 | ||
|
|
985ae5edca | ||
|
|
fe395cf045 | ||
|
|
c05107adcb | ||
|
|
84d4e5deac | ||
|
|
9e2e4cde19 | ||
|
|
f4c9248a31 | ||
|
|
fa0b086a99 | ||
|
|
25445a9f2e | ||
|
|
cca7755c63 | ||
|
|
3b289c7942 | ||
|
|
a403e611c7 | ||
|
|
ead1ee42cb | ||
|
|
926c70f35f | ||
|
|
a23108c795 | ||
|
|
242a91bd0d | ||
|
|
4ad2006811 | ||
|
|
25d1f65296 | ||
|
|
bdf3b4a317 | ||
|
|
a0158a9dad | ||
|
|
e3af3dd28a | ||
|
|
119a546f6d | ||
|
|
47ef79051e | ||
|
|
fe4a74a716 | ||
|
|
df95949fe4 | ||
|
|
68a39c2f82 | ||
|
|
71bd9e0df0 | ||
|
|
6710358eda | ||
|
|
61718d2da5 | ||
|
|
4c0f6f8ce1 | ||
|
|
3de092b001 | ||
|
|
456a263080 | ||
|
|
ded9052689 | ||
|
|
46a6746bca | ||
|
|
9ac7a03982 | ||
|
|
47c0ce5f85 | ||
|
|
cfae8fd1e9 | ||
|
|
66ac60acbd |
@@ -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/",
|
||||
|
||||
192
CHANGELOG.md
192
CHANGELOG.md
@@ -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.
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.",
|
||||
},
|
||||
},
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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(() => ({})),
|
||||
}));
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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 {
|
||||
|
||||
64
extensions/bluebubbles/src/conversation-bindings.test.ts
Normal file
64
extensions/bluebubbles/src/conversation-bindings.test.ts
Normal 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",
|
||||
}),
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -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({
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -1169,7 +1169,7 @@ export async function processMessage(
|
||||
isDirect: !isGroup,
|
||||
isGroup,
|
||||
isMentionableGroup: isGroup,
|
||||
requireMention: Boolean(requireMention),
|
||||
requireMention,
|
||||
canDetectMention,
|
||||
effectiveWasMentioned,
|
||||
shouldBypassMention,
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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([]);
|
||||
|
||||
@@ -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([]);
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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 };
|
||||
|
||||
@@ -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 });
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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"
|
||||
},
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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 });
|
||||
});
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 });
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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`,
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 () => {
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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[] {
|
||||
|
||||
154
extensions/device-pair/notify.test.ts
Normal file
154
extensions/device-pair/notify.test.ts
Normal 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",
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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.
|
||||
},
|
||||
}));
|
||||
|
||||
|
||||
@@ -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}.`);
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 }),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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://";
|
||||
|
||||
|
||||
@@ -72,7 +72,9 @@ beforeEach(() => {
|
||||
});
|
||||
|
||||
describe("registerDiscordListener", () => {
|
||||
class FakeListener {}
|
||||
class FakeListener {
|
||||
readonly testListener = true;
|
||||
}
|
||||
|
||||
it("dedupes listeners by constructor", () => {
|
||||
const listeners: object[] = [];
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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.",
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -202,7 +202,7 @@ export async function processDiscordMessage(
|
||||
isDirect: isDirectMessage,
|
||||
isGroup: isGuildMessage || isGroupDm,
|
||||
isMentionableGroup: isGuildMessage,
|
||||
requireMention: Boolean(shouldRequireMention),
|
||||
requireMention: shouldRequireMention,
|
||||
canDetectMention,
|
||||
effectiveWasMentioned,
|
||||
shouldBypassMention,
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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(),
|
||||
}));
|
||||
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 () => {
|
||||
|
||||
@@ -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(),
|
||||
}));
|
||||
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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"],
|
||||
},
|
||||
}),
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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 } : {}),
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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",
|
||||
}),
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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}`);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ export const googlechatSetupWizard: ChannelSetupWizard = {
|
||||
credentialValues: {
|
||||
...credentialValues,
|
||||
[USE_ENV_FLAG]: "0",
|
||||
[AUTH_METHOD_FLAG]: String(method),
|
||||
[AUTH_METHOD_FLAG]: method,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
@@ -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;
|
||||
},
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
Reference in New Issue
Block a user