Compare commits

..

352 Commits

Author SHA1 Message Date
Peter Steinberger 0512059dd4 chore: prepare 2026.4.9 stable release
Docker Release / validate_manual_backfill (push) Has been cancelled
Docker Release / approve_manual_backfill (push) Has been cancelled
Docker Release / build-amd64 (push) Has been cancelled
Docker Release / build-arm64 (push) Has been cancelled
Docker Release / create-manifest (push) Has been cancelled
2026-04-09 03:24:45 +01:00
Peter Steinberger b5c3c15dcf test: keep local full suite serial by default 2026-04-09 03:23:00 +01:00
sudie-codes 1fed7bc379 fix(msteams): pin reply target at inbound time to prevent DM/channel leak (#54520) (#62716) 2026-04-08 21:22:12 -05:00
sudie-codes 9edfefedf7 fix(msteams): route thread replies to correct thread via replyToId (#58030) (#62715) 2026-04-08 21:22:09 -05:00
sudie-codes 38aa1edf76 fix(msteams): isolate channel thread sessions by replyToId (#58615) (#62713)
* fix(msteams): isolate thread sessions by replyToId (#58615)

* fix(msteams): align thread ID extraction + fix test types
2026-04-08 21:22:05 -05:00
Peter Steinberger 62bde7ede3 test: isolate slack thread-ts recovery 2026-04-09 02:43:29 +01:00
Peter Steinberger b27918007a ci: tolerate noisy npm pack json output 2026-04-09 02:42:03 +01:00
Mason 74b5b97f62 tests: reset discord native-command seams in model picker (#63267) 2026-04-09 09:38:31 +08:00
pashpashpash 0faae33b0c wizard: add explicit skip option to plugin setup (#63436)
* Wizard: allow skipping plugin setup

* Agents: reset nodes tool test modules
2026-04-09 10:35:39 +09:00
Peter Steinberger 5b28ab83ef test: run local full suite project shards in parallel 2026-04-09 02:26:22 +01:00
Peter Steinberger e6797bcd08 chore: refresh plugin SDK API baseline
Docker Release / validate_manual_backfill (push) Has been skipped
Docker Release / approve_manual_backfill (push) Has been skipped
Docker Release / build-amd64 (push) Failing after 35s
Docker Release / create-manifest (push) Has been cancelled
Docker Release / build-arm64 (push) Has been cancelled
2026-04-09 02:21:03 +01:00
Peter Steinberger 1961102a59 chore: refresh config schema version for 2026.4.9-beta.1 2026-04-09 02:13:31 +01:00
Peter Steinberger 7810ddc220 chore: prepare 2026.4.9-beta.1 release 2026-04-09 02:13:31 +01:00
Vincent Koc b73a18dd27 fix(commands): split doctor prompt option types 2026-04-09 02:08:02 +01:00
Vincent Koc d9a3ecd109 fix(infra): extract exec approvals allowlist types 2026-04-09 02:08:02 +01:00
Vincent Koc b13025f378 fix(commands): split auth choice apply types 2026-04-09 02:08:02 +01:00
Vincent Koc 20f2f39d30 fix(config): stop owner-display barrel cycles 2026-04-09 02:08:02 +01:00
Vincent Koc 91ad1e5fc5 fix(logging): break console/logger type cycle 2026-04-09 02:08:02 +01:00
Peter Steinberger e890db76bc auth: avoid plugin setup scans during common auth resolution 2026-04-09 01:57:40 +01:00
Peter Steinberger 5f710bac35 test: mock auth profile external overlay in oauth tests 2026-04-09 01:56:13 +01:00
Peter Steinberger 0c5e524224 test: keep ollama unreachable discovery on localhost 2026-04-09 01:51:28 +01:00
Peter Steinberger dcfb3ed4e3 plugins: keep google provider policy lightweight 2026-04-09 01:48:48 +01:00
Peter Steinberger 1cd7ba88df test: isolate subagent registry resume imports 2026-04-09 01:46:54 +01:00
Peter Steinberger d0c21cf541 test: isolate model auth module state 2026-04-09 01:44:31 +01:00
Peter Steinberger f0ea5bf393 plugins: add lightweight anthropic vertex discovery 2026-04-09 01:43:40 +01:00
Peter Steinberger 67a030dfe8 test: isolate onboard skills status mock 2026-04-09 01:40:11 +01:00
Peter Steinberger f0644d7613 test: replace models-config matrix with narrow coverage 2026-04-09 01:39:43 +01:00
Peter Steinberger 3ae10b02f2 test: isolate agentic suite smoke tests 2026-04-09 01:38:24 +01:00
Peter Steinberger a9f831e065 test: make shared-token reload deterministic 2026-04-09 01:38:16 +01:00
Peter Steinberger 6688779d36 fix: drop raw gateway chat control replies 2026-04-09 01:38:08 +01:00
Peter Steinberger cca9e5b914 test: cap broad live model sweeps 2026-04-09 01:37:55 +01:00
Peter Steinberger 6e200f4077 fix: update command-status SDK baseline (#63174) (thanks @hxy91819) 2026-04-09 01:35:15 +01:00
Mason Huang e892518b63 tests: document config mock choice for eager warmup 2026-04-09 01:35:15 +01:00
Mason Huang edc6c13f1f plugin-sdk: drop investigative weixin repro harness 2026-04-09 01:35:15 +01:00
Mason Huang ba636d1206 plugin-sdk: keep command status compatibility path light 2026-04-09 01:35:15 +01:00
Mason Huang aa15de8fdc plugin-sdk: split command status surface 2026-04-09 01:35:15 +01:00
Peter Steinberger 691e2aa856 test: move copilot models-json injection coverage to plan tests 2026-04-09 01:29:52 +01:00
Peter Steinberger a8c47db668 fix: repair Windows dev-channel updater 2026-04-09 01:26:28 +01:00
Peter Steinberger be46d0ddc6 test: update character eval public panel 2026-04-09 01:25:59 +01:00
Peter Steinberger 0766f0b422 test: update modelstudio catalog contract sentinel 2026-04-09 01:20:34 +01:00
Vignesh Natarajan 2484064c48 chore(lint): clear extension lint regressions and add #63416 changelog 2026-04-08 17:17:29 -07:00
Peter Steinberger 1f3171ac91 test: keep cli-provider agent command tests off external auth overlays 2026-04-09 01:11:40 +01:00
Peter Steinberger acdee39fa4 ci: stabilize macOS and transcript policy tests 2026-04-09 01:10:40 +01:00
Sally O'Malley 5f8de8c3f4 fix openrouter model picker refs (#63416)
* fix openrouter model picker refs

Signed-off-by: sallyom <somalley@redhat.com>

* test(ui): cover openrouter slash-id /model resolution

---------

Signed-off-by: sallyom <somalley@redhat.com>
Co-authored-by: Vignesh Natarajan <vignesh.natarajan92@gmail.com>
2026-04-08 20:10:20 -04:00
Peter Steinberger b706301b44 test: keep agent command tests off external auth overlays 2026-04-09 01:08:22 +01:00
Peter Steinberger 39cc6b7dc7 fix: stabilize character eval and Qwen model routing 2026-04-09 01:04:09 +01:00
Peter Steinberger dc2a0f5b8a test: keep undefined-token auth-choice coverage generic 2026-04-09 00:59:57 +01:00
Peter Steinberger dda1d98645 test: keep auth-choice default-model coverage on lightweight provider 2026-04-09 00:57:37 +01:00
Peter Steinberger 1abd444a9e test: avoid remote ollama timeout in api-key preservation coverage 2026-04-09 00:48:24 +01:00
Radek Sienkiewicz 78b6bedd10 Delete docs/plans directory
Unused artifact
2026-04-09 01:48:02 +02:00
Peter Steinberger ac12b0701b style: format memory and gateway touchups 2026-04-09 00:44:09 +01:00
Peter Steinberger f2c0482d3c fix: surface delayed browser navigation blocks 2026-04-09 00:42:52 +01:00
Peter Steinberger 7fd6e2ec4c fix: filter provider auth aliases by plugin trust 2026-04-09 00:42:52 +01:00
Peter Steinberger 3d9a151fd1 ci: narrow Windows node test lane 2026-04-09 00:40:23 +01:00
Peter Steinberger fbbd644d7a plugins: load lightweight provider discovery entries 2026-04-09 00:33:33 +01:00
Peter Steinberger 0fce013ebf build: mirror bundled plugin runtime deps 2026-04-09 00:31:08 +01:00
Peter Steinberger 5e83e81af8 style: sort session import 2026-04-09 00:31:08 +01:00
Peter Steinberger aa79b9fb7d test(docker): quiet success-path e2e logs 2026-04-09 00:29:24 +01:00
Peter Steinberger ac57c7c309 docs: reorder unreleased changelog 2026-04-09 00:00:49 +01:00
Peter Steinberger 0560f3c9c0 fix(ci): drop silent history before truncation 2026-04-08 23:47:34 +01:00
Peter Steinberger c62a39c7a1 fix: restore main ci 2026-04-08 23:30:18 +01:00
github-actions[bot] e93ff84118 chore(ui): refresh tr control ui locale 2026-04-08 22:29:17 +00:00
github-actions[bot] 5d85d232c9 chore(ui): refresh pl control ui locale 2026-04-08 22:29:13 +00:00
github-actions[bot] 955ef1ee2a chore(ui): refresh id control ui locale 2026-04-08 22:29:12 +00:00
github-actions[bot] 1b596e650b chore(ui): refresh uk control ui locale 2026-04-08 22:29:09 +00:00
github-actions[bot] f562a31b96 chore(ui): refresh ko control ui locale 2026-04-08 22:27:54 +00:00
github-actions[bot] 8750701a93 chore(ui): refresh ja-JP control ui locale 2026-04-08 22:27:52 +00:00
github-actions[bot] e5dab8e600 chore(ui): refresh fr control ui locale 2026-04-08 22:27:51 +00:00
github-actions[bot] 1e31dd020b chore(ui): refresh es control ui locale 2026-04-08 22:27:47 +00:00
Peter Steinberger b76681f28d test(docker): reduce e2e log noise 2026-04-08 23:27:43 +01:00
github-actions[bot] ceb64dc07e chore(ui): refresh de control ui locale 2026-04-08 22:26:42 +00:00
github-actions[bot] a68e22ebf1 chore(ui): refresh zh-TW control ui locale 2026-04-08 22:26:40 +00:00
github-actions[bot] 3d318dd1ec chore(ui): refresh pt-BR control ui locale 2026-04-08 22:26:38 +00:00
github-actions[bot] be38cea78c chore(ui): refresh zh-CN control ui locale 2026-04-08 22:26:33 +00:00
Peter Steinberger 95a4dd5abb fix(ci): align ollama thinking expectations 2026-04-08 23:25:50 +01:00
Peter Steinberger 3c7beb4e42 test: avoid runtime auth overlays in failure-state coverage 2026-04-08 23:25:02 +01:00
Mariano d514f4de83 Dreaming: surface grounded scene lane (#63395)
Merged via squash.

Prepared head SHA: 0c7f586f32459dca89894202559377ee946a55ff
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Reviewed-by: @mbelinky
2026-04-09 00:24:47 +02:00
Gustavo Madeira Santana bd7801eefa Slack: key turn-local dedupe by dispatch kind
Scope Slack turn-local delivery dedupe by reply dispatch kind so identical tool and final payloads on the same thread do not collapse into one send.

Expose the existing dispatcher kind on the public reply-runtime seam and cover the Slack tracker and preview-fallback paths with regression tests.
2026-04-08 18:19:34 -04:00
Pinghuachiu 68630a9e6d fix(gateway): suppress announce/reply skip chat leakage (#51739)
Merged via squash.

Prepared head SHA: 2f53f3b0b798d0ce2661654fe16fdfd07b1bd2e5
Co-authored-by: Pinghuachiu <9033138+Pinghuachiu@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
2026-04-08 15:18:57 -07:00
Accunza 8190cc4d21 fix: inter-session messages must not overwrite established external lastRoute (#58013)
Merged via squash.

Prepared head SHA: 820ea20cb82a4e835c5cac7cae7123a2bc5d713f
Co-authored-by: duqaXxX <12242811+duqaXxX@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
2026-04-08 15:12:27 -07:00
Peter Steinberger 2787b5bcae test: move cron heartbeat delivery coverage below full turns 2026-04-08 23:02:03 +01:00
Altay 554bc0a9fd fix(plugins): keep test helpers out of contract barrels (#63311)
Merged via squash.

Prepared head SHA: 769e90c6af377e13a3dcc56f70131e4caa48e0ca
Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com>
Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com>
Reviewed-by: @altaywtf
2026-04-08 22:59:05 +01:00
Peter Steinberger 9ffe216a52 test: replace exec directive e2e with pure coverage 2026-04-08 22:55:40 +01:00
Gustavo Madeira Santana 10c87527d5 Slack: dedupe partial streaming replies (#62859)
Merged via squash.

Prepared head SHA: cbecb50c06f7657dc259cf9fdc71419b9b390559
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
2026-04-08 17:55:30 -04:00
Peter Steinberger f8a57fe47b test: move inline directive collisions to pure tests 2026-04-08 22:53:12 +01:00
Peter Steinberger 9286de5d95 fix(deps): patch basic-ftp advisory 2026-04-08 22:49:45 +01:00
Mariano Belinky 85427441a2 Docs/memory: explain grounded backfill flows 2026-04-08 23:48:09 +02:00
Peter Steinberger 51bf97a9db test: reuse inline directive reply imports 2026-04-08 22:45:50 +01:00
Mariano Belinky a71ad12044 Memory/dreaming: harden grounded backfill follow-ups 2026-04-08 23:43:39 +02:00
Peter Steinberger 868d03d6d0 fix(memory): align dreaming status payloads 2026-04-08 22:38:29 +01:00
Peter Steinberger 85e222717f fix(gateway): classify dream diary actions 2026-04-08 22:38:29 +01:00
Peter Steinberger 6b73a74d53 docs: update unreleased changelog 2026-04-08 22:37:47 +01:00
Mariano e8209e4cf9 Memory/dreaming: feed grounded backfill into short-term promotion (#63370)
Merged via squash.

Prepared head SHA: 5dfe246ef94a756dc776dbb34d4ccafa960dbfb7
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Reviewed-by: @mbelinky
2026-04-08 23:31:37 +02:00
lukeboyett f6e1da3ab3 fix(matrix/doctor): migrate legacy channels.matrix.dm.policy 'trusted' (fixes #62931) (#62942)
Merged via squash.

Prepared head SHA: d9f553bccf65eb6f27d465a64fc95eb741d589cc
Co-authored-by: lukeboyett <46942646+lukeboyett@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
2026-04-08 17:00:19 -04:00
Shakker 540fcd48f7 docs(changelog): add qa auth fail-fast entry (#63333) (thanks @shakkernerd) 2026-04-08 21:55:39 +01:00
Shakker 48c4003f22 test: cover unsafe qa missing-key providers 2026-04-08 21:55:39 +01:00
Shakker 705d2dd03e fix: harden qa missing-key provider messages 2026-04-08 21:55:39 +01:00
Shakker d66e2d5b33 test: cover curated qa missing-key reply classification 2026-04-08 21:55:39 +01:00
Shakker c63d25bd9b fix: classify curated qa missing-key replies 2026-04-08 21:55:39 +01:00
Shakker 9cfa152962 test: cover mixed-traffic qa wait cursors 2026-04-08 21:55:39 +01:00
Shakker 204d766b27 fix: align qa wait cursor semantics 2026-04-08 21:55:39 +01:00
Shakker 7d818c32ba test: cover sanitized qa missing-key replies 2026-04-08 21:55:39 +01:00
Shakker 4ad9f166e2 fix: sanitize qa missing-key replies 2026-04-08 21:55:39 +01:00
Shakker a6d76df4f0 test: cover qa scenario wait failure replies 2026-04-08 21:55:39 +01:00
Shakker b3f3cfd598 fix: fail fast across qa scenario wait paths 2026-04-08 21:55:39 +01:00
Shakker 491e216c45 fix: fail fast on qa live auth errors 2026-04-08 21:55:39 +01:00
Gustavo Madeira Santana 30211be1cb Slack: treat ACP block text as visible output (#62858)
Merged via squash.

Prepared head SHA: 14f202e1cce5fdd3cec9733efbbe270843716512
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
2026-04-08 16:33:43 -04:00
Eva H d7bf97adb3 fix: enable thinking support for the ollama api (#62712)
Merged via squash.

Prepared head SHA: c0b995035ef734ea4af335c3d2a7611965123122
Co-authored-by: hoyyeva <63033505+hoyyeva@users.noreply.github.com>
Co-authored-by: BruceMacD <5853428+BruceMacD@users.noreply.github.com>
Reviewed-by: @BruceMacD
2026-04-08 13:26:18 -07:00
Peter Steinberger 37fb1eb9ad test: move directive state coverage to pure tests 2026-04-08 20:50:56 +01:00
Agustin Rivera 5f5b3d733b fix(browser): re-check interaction-driven navigations (#63226)
* fix(browser): guard interaction-driven navigations

* fix(browser): avoid rechecking unchanged interaction urls

* fix(browser): guard delayed interaction navigations

* fix(browser): guard interaction-driven navigations for full action duration

* fix(browser): avoid waiting on interaction grace timer

* fix(browser): ignore same-document hash-only URL changes in navigation guard

* fix(browser): dedupe interaction nav guards

* fix(browser): guard same-URL reloads in interaction navigation listeners

* docs(changelog): add interaction navigation guard entry

* fix(browser): drop duplicate ssrfPolicy props

* fix(browser): tighten interaction navigation guards

---------

Co-authored-by: Devin Robison <drobison@nvidia.com>
2026-04-08 13:39:07 -06:00
Peter Steinberger ab46010caa test: reuse verbose directive reply imports 2026-04-08 20:30:59 +01:00
Peter Steinberger 1d1763caa4 test: reuse exec directive reply imports 2026-04-08 20:25:11 +01:00
Agustin Rivera dafcaf9d69 fix(browser): harden browser control override loading (#62663)
* fix(browser): harden browser control overrides

* fix(lint): prepare boundary artifacts for extension oxlint

* docs(changelog): add browser override hardening entry

* fix(lint): avoid duplicate boundary prep

---------

Co-authored-by: Devin Robison <drobison@nvidia.com>
Co-authored-by: Devin Robison <drobison00@users.noreply.github.com>
2026-04-08 13:24:47 -06:00
Gustavo Madeira Santana 9b19c0b87f Matrix: report startup failures as errors 2026-04-08 15:19:43 -04:00
Peter Steinberger 8a5ae730d4 auth: persist explicit profile upserts directly 2026-04-08 20:15:57 +01:00
Peter Steinberger 5df4351c4d test(doctor): mock memory-core runtime seam 2026-04-08 20:13:44 +01:00
Peter Steinberger 5b4eb267b0 auth: avoid external cli sync on profile upsert 2026-04-08 20:10:47 +01:00
Peter Steinberger 21ef1bf8de feat: parallelize character eval runs 2026-04-08 20:05:55 +01:00
Peter Steinberger f1e75d3259 fix: load QA live provider overrides 2026-04-08 20:05:55 +01:00
Peter Steinberger b3e7858051 build: stage nostr runtime dependencies 2026-04-08 20:05:55 +01:00
Agustin Rivera dbfcef3196 fix(dotenv): block workspace runtime env vars (#62660)
* fix(dotenv): block workspace runtime env vars

Co-authored-by: zsx <git@zsxsoft.com>

* docs(changelog): add workspace dotenv runtime-control entry

* fix(dotenv): block workspace gateway port override

---------

Co-authored-by: zsx <git@zsxsoft.com>
Co-authored-by: Devin Robison <drobison@nvidia.com>
2026-04-08 13:04:00 -06:00
Peter Steinberger f4704184f6 build: narrow plugin SDK declaration build 2026-04-08 20:00:51 +01:00
Peter Steinberger 757fc49506 test: harden Parallels macOS smoke fallback 2026-04-08 20:00:51 +01:00
Peter Steinberger 79f440c903 fix(memory): accept embedded dreaming heartbeat tokens 2026-04-08 19:59:36 +01:00
Peter Steinberger 5478462cbf test: harden provider mock isolation 2026-04-08 19:59:36 +01:00
Gustavo Madeira Santana c341161a77 docs(config): tighten wording in reference 2026-04-08 14:56:13 -04:00
Peter Steinberger 112e725237 test: reuse followup runner imports 2026-04-08 19:54:37 +01:00
Peter Steinberger 218078ffd4 test: reuse image generate tool imports 2026-04-08 19:49:01 +01:00
Agustin Rivera 4a60087cd0 Align remote node exec event system messages with untrusted handling (#62659)
* fix(nodes): downgrade remote exec system events

* docs(changelog): add remote node exec event entry

---------

Co-authored-by: Devin Robison <drobison@nvidia.com>
2026-04-08 12:47:24 -06:00
Gustavo Madeira Santana 0c00c3c230 fix(matrix): contain sync outage failures (#62779)
Merged via squash.

Prepared head SHA: 901bb767b56250915de2b866db91e4e2d8b098b0
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
2026-04-08 14:41:28 -04:00
Peter Steinberger a3d21539ef test: stabilize full-suite execution 2026-04-08 19:40:57 +01:00
github-actions[bot] 365524fc2b chore(ui): refresh id control ui locale 2026-04-08 18:39:12 +00:00
github-actions[bot] 6c8ee340b6 chore(ui): refresh pl control ui locale 2026-04-08 18:39:08 +00:00
github-actions[bot] 935cdcdadc chore(ui): refresh uk control ui locale 2026-04-08 18:39:04 +00:00
github-actions[bot] cbac55f0da chore(ui): refresh tr control ui locale 2026-04-08 18:39:01 +00:00
Gustavo Madeira Santana 106a40426f docs(matrix): tighten setup and config guidance 2026-04-08 14:38:10 -04:00
github-actions[bot] 4cc539ec4d chore(ui): refresh fr control ui locale 2026-04-08 18:37:56 +00:00
github-actions[bot] 43d3f33b25 chore(ui): refresh ja-JP control ui locale 2026-04-08 18:37:51 +00:00
github-actions[bot] b8164f7968 chore(ui): refresh ko control ui locale 2026-04-08 18:37:47 +00:00
github-actions[bot] 965d4fe50f chore(ui): refresh es control ui locale 2026-04-08 18:37:45 +00:00
github-actions[bot] ce941d1c4e chore(ui): refresh de control ui locale 2026-04-08 18:36:37 +00:00
github-actions[bot] cb7fed6781 chore(ui): refresh pt-BR control ui locale 2026-04-08 18:36:31 +00:00
github-actions[bot] b40148fe8b chore(ui): refresh zh-CN control ui locale 2026-04-08 18:36:25 +00:00
github-actions[bot] e343d0e183 chore(ui): refresh zh-TW control ui locale 2026-04-08 18:36:22 +00:00
Mariano 66b824870d feat(ui): add dreaming diary controls and navigation (#63298)
Merged via squash.

Prepared head SHA: 0a2ae66913af5735fba4891c3b4ebf29ba71b44f
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Reviewed-by: @mbelinky
2026-04-08 20:34:24 +02:00
Mariano 078e7a6586 feat(memory): harden grounded REM extraction (#63297)
Merged via squash.

Prepared head SHA: e188b7e26dc5c4d1f449d6889605824fce0a8a81
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Reviewed-by: @mbelinky
2026-04-08 20:28:03 +02:00
Mariano dbf5960bd9 feat(memory): add grounded REM backfill lane (#63273)
Merged via squash.

Prepared head SHA: 4450f25485b5738233098d5dd7450ccd853097a2
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Reviewed-by: @mbelinky
2026-04-08 20:23:28 +02:00
Peter Steinberger 9e4f478f86 feat(plugins): support provider auth aliases 2026-04-08 19:03:04 +01:00
Peter Steinberger fd9f9b8586 test: isolate provider runtime test mocks 2026-04-08 19:00:24 +01:00
Pavan Kumar Gondhi 2d97eae53e fix(plugins): prevent untrusted workspace plugins from hijacking bundled provider auth choices [AI] (#62368)
* fix: address issue

* fix: address review feedback

* docs(changelog): add onboarding auth-choice guard entry

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address PR review feedback

* fix: address PR review feedback

---------

Co-authored-by: Devin Robison <drobison@nvidia.com>
2026-04-08 23:08:14 +05:30
Peter Steinberger 2d0e25c23a fix: pass system prompt to codex cli 2026-04-08 18:15:10 +01:00
Peter Steinberger 1979a28803 fix: patch hono security advisories 2026-04-08 18:02:54 +01:00
Peter Steinberger bae64bb188 test: isolate volcengine byteplus auth resolver imports 2026-04-08 17:44:57 +01:00
Peter Steinberger c945ae7be5 test: stabilize ci test isolation 2026-04-08 17:35:54 +01:00
Frank Yang 5d46e4dc4f fix(gateway): clear auto-fallback model override on session reset (#63155)
* fix(gateway): clear auto-fallback model override on session reset

When `persistFallbackCandidateSelection()` writes a fallback provider
override with `authProfileOverrideSource: "auto"`, the override was
incorrectly preserved across `/reset` and `/new` commands. This caused
sessions to keep using the fallback provider even after the user changed
the agent config primary provider, because the session store override
takes precedence over the config default.

Now the override fields (`providerOverride`, `modelOverride`,
`authProfileOverride`, `authProfileOverrideSource`,
`authProfileOverrideCompactionCount`) are only carried forward when
`authProfileOverrideSource === "user"` (i.e. explicit `/model` command).
System-driven overrides are dropped on reset so the session picks up the
current config default.

Introduced in cb0a752156 ("fix: preserve reset session behavior config")

* fix(gateway): preserve explicit reset model selection

* fix(gateway): track reset model override source

* fix(gateway): preserve legacy reset model overrides

* docs(changelog): add session reset merge note

---------

Co-authored-by: termtek <termtek@ubuntu.tail2b72cd.ts.net>
2026-04-09 00:31:05 +08:00
Frank Yang 153e3add68 fix(auto-reply): strip leading NO_REPLY tokens to prevent silent-reply leak (#63068)
* fix(auto-reply): strip leading NO_REPLY tokens to prevent silent-reply leak

* fix(auto-reply): preserve substantive NO_REPLY leading text

* fix(agents): preserve ACP silent-prefix cumulative deltas

* fix(auto-reply): harden silent-token streaming paths

* fix(auto-reply): normalize glued silent tokens consistently

---------

Co-authored-by: termtek <termtek@ubuntu.tail2b72cd.ts.net>
2026-04-09 00:30:13 +08:00
Ayaan Zaidi 21d0f7c5f1 fix: restore android qr pairing flow (#63199) 2026-04-08 21:58:56 +05:30
Ayaan Zaidi dcf821cfb6 fix(android): prefer stored device auth after pairing 2026-04-08 21:58:56 +05:30
Ayaan Zaidi 1f899f8442 fix(android): tighten pairing retry behavior 2026-04-08 21:58:56 +05:30
Ayaan Zaidi 6090afa0e5 fix(android): reset auth on new setup codes 2026-04-08 21:58:56 +05:30
Ayaan Zaidi 11bd40fe8a fix(android): prefer bootstrap auth on qr pairing 2026-04-08 21:58:56 +05:30
Ayaan Zaidi 911f9a104c fix(android): auto-resume pairing approval 2026-04-08 21:58:56 +05:30
Peter Steinberger 253ecd2a5d test: keep media runtime tests on same-directory provider mocks 2026-04-08 17:15:56 +01:00
Peter Steinberger 8f67f156ee test: keep pi fs workspace tests on fs tool factories 2026-04-08 17:06:23 +01:00
Peter Steinberger 4a51a1031d feat: add character eval model options 2026-04-08 17:05:30 +01:00
Peter Steinberger 4bbf78e566 test: make character eval scenario natural 2026-04-08 17:05:30 +01:00
Mariano b77db8c0b6 Reply: surface OAuth reauth failures (#63217)
Merged via squash.

Prepared head SHA: 68b7ffd59e5ae03421ee69c835fb9f8448b82692
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Reviewed-by: @mbelinky
2026-04-08 18:03:03 +02:00
Peter Steinberger 45195e3645 test: explain gateway exec fixture trust 2026-04-08 16:54:31 +01:00
Peter Steinberger 7f5d129a37 fix: keep runtime task test harness behind task seams 2026-04-08 16:53:46 +01:00
Peter Steinberger b5c597cc66 test: trust gateway exec fixture node path 2026-04-08 16:48:39 +01:00
Ayaan Zaidi 17e6ef4076 fix(build): keep tsdown prune best-effort 2026-04-08 21:16:49 +05:30
Peter Steinberger 654ad0a1fb test: keep bundled web-search owner checks on public artifacts 2026-04-08 16:46:29 +01:00
Peter Steinberger ca09c954da docs: reorder changelog entries 2026-04-08 16:41:03 +01:00
Peter Steinberger 035bd94a76 fix(plugin-sdk): export channel plugin base 2026-04-08 16:39:18 +01:00
Peter Steinberger 1e274f8695 test: keep chutes implicit provider tests on provider catalog 2026-04-08 16:33:39 +01:00
Ayaan Zaidi f4ec59c431 fix(build): honor postinstall disable flag 2026-04-08 21:01:53 +05:30
Ayaan Zaidi 66ec8909bd fix(build): address bundled plugin prune review 2026-04-08 21:01:53 +05:30
Ayaan Zaidi b28fe1b92f fix(build): prune stale bundled plugin node_modules 2026-04-08 21:01:53 +05:30
Peter Steinberger e4c7ee5856 test: keep kimi implicit provider tests on provider catalog 2026-04-08 16:30:56 +01:00
Peter Steinberger f27d382873 fix: default OpenAI reasoning effort to high 2026-04-08 16:29:46 +01:00
Peter Steinberger dfa22f5826 test: keep model reasoning override coverage on merge helpers 2026-04-08 16:23:58 +01:00
Peter Steinberger 41770be999 test: keep pdf and update-plan registration tests pure 2026-04-08 16:15:28 +01:00
Peter Steinberger e8d5837eea fix: keep minimax provider mocks package-local 2026-04-08 16:13:37 +01:00
Peter Steinberger 17bd5f1dd2 refactor: share html entity tool call decoding 2026-04-08 15:58:47 +01:00
Peter Steinberger b358db1775 refactor: dedupe embedding provider test fixtures 2026-04-08 15:58:47 +01:00
Peter Steinberger 27560b7b68 refactor: dedupe agent command test fixtures 2026-04-08 15:58:47 +01:00
Peter Steinberger 1bd3e9296c refactor: dedupe doctor codex oauth tests 2026-04-08 15:58:47 +01:00
Peter Steinberger 54e5741357 refactor: dedupe telegram exec approval tests 2026-04-08 15:58:47 +01:00
Peter Steinberger 4da74a4d9a refactor: dedupe matrix exec approval tests 2026-04-08 15:58:47 +01:00
Peter Steinberger b0c0df3484 refactor: dedupe approval runtime tests 2026-04-08 15:58:46 +01:00
Peter Steinberger b61f00169a refactor: dedupe exec defaults tests 2026-04-08 15:58:46 +01:00
Peter Steinberger 82a958dc79 refactor: dedupe firecrawl and directive helpers 2026-04-08 15:58:46 +01:00
Peter Steinberger 34f73abfd3 refactor: dedupe plugin metadata test helpers 2026-04-08 15:58:46 +01:00
Peter Steinberger 76ccbbf12f refactor: dedupe media runtime test mocks 2026-04-08 15:58:45 +01:00
Peter Steinberger e98dc17866 refactor: dedupe plugin test harnesses 2026-04-08 15:58:45 +01:00
Peter Steinberger 3dd19a1705 refactor: dedupe test helpers and script warning filter 2026-04-08 15:58:45 +01:00
Peter Steinberger 6276530dc2 refactor: dedupe config and subagent tests 2026-04-08 15:58:45 +01:00
Peter Steinberger a5737f83af refactor: dedupe browser navigation guard tests 2026-04-08 15:58:45 +01:00
Peter Steinberger 49f3ede504 refactor: dedupe shared helper branches 2026-04-08 15:58:45 +01:00
Peter Steinberger 6e0957ca47 refactor: dedupe internal helper glue 2026-04-08 15:58:45 +01:00
Peter Steinberger 5f370149f3 refactor: dedupe media generation tool helpers 2026-04-08 15:58:45 +01:00
Peter Steinberger 7f19676439 docs: document QA character eval workflow 2026-04-08 15:53:30 +01:00
Peter Steinberger 3101d81053 feat: add QA character eval reports 2026-04-08 15:52:49 +01:00
Peter Steinberger aa3b1357cb fix: support Codex CLI QA auth 2026-04-08 15:52:01 +01:00
Peter Steinberger 47db29076e test: keep openclaw tools registration policy pure 2026-04-08 15:31:21 +01:00
Peter Steinberger 1b9a6959b8 ci: isolate full suite leaf shards 2026-04-08 15:22:04 +01:00
Peter Steinberger edf6b490a6 fix: harden bundled plugin dependency release checks 2026-04-08 15:15:44 +01:00
Eric Curtin 0de5db8772 docs(inferrs): fix Gemma model id from gg-hf-gg to google (#62586) 2026-04-08 10:15:07 -04:00
Peter Steinberger 557559cd42 test: keep bundled metadata sidecar scan inventory-only 2026-04-08 15:12:33 +01:00
Peter Steinberger 68802084e6 test: keep openclaw tools registration tests on a fast shell 2026-04-08 15:09:36 +01:00
Peter Steinberger e915ef7a25 test: keep public artifact coverage on cheap boundaries 2026-04-08 15:05:37 +01:00
Peter Steinberger 816cd07b19 ci: restore sequential full suite tests 2026-04-08 14:56:21 +01:00
Peter Steinberger 98c7743006 test: keep kilocode provider tests on plugin-owned helpers 2026-04-08 14:56:03 +01:00
Peter Steinberger 841a1566ef test: keep web provider artifact test in boundary 2026-04-08 14:37:19 +01:00
Peter Steinberger 3e2bfcd84d test: keep shared dm policy contract off channel facades 2026-04-08 14:35:53 +01:00
Peter Steinberger 651a1d7ed2 test: exercise models json file mode without provider discovery 2026-04-08 14:32:07 +01:00
Peter Steinberger d9dc75774b fix: align LLM idle timeout policy 2026-04-08 14:31:41 +01:00
Peter Steinberger e65d6ebb63 test: fix full suite CI test isolation 2026-04-08 14:29:19 +01:00
Tyler Warburton a48c1e8cca fix: allow blank TLS manual port default (#63134) (thanks @Tyler-RNG)
* make port optional for TLS manual connections

* fix: restrict manual blank-port fallback to tls

* fix: allow blank TLS manual port default (#63134) (thanks @Tyler-RNG)

---------

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-04-08 18:54:03 +05:30
Peter Steinberger 307979a4c7 test: restore manifest-only web provider coverage 2026-04-08 14:22:02 +01:00
Peter Steinberger 9b25f616d5 channels: fast-path direct model override matches 2026-04-08 14:19:54 +01:00
Peter Steinberger abe460177d status: avoid plugin lookup for direct channel model overrides 2026-04-08 14:16:45 +01:00
Peter Steinberger 96417308cc test: keep status message tests off auth auto-detection 2026-04-08 14:13:58 +01:00
Peter Steinberger 37473142d8 test: keep web provider artifact test in boundary 2026-04-08 14:11:35 +01:00
Peter Steinberger 5aa8579dd7 test: keep provider policy artifact coverage narrow 2026-04-08 14:00:47 +01:00
Peter Steinberger a5515db1e8 test: keep web provider artifact coverage manifest-only 2026-04-08 13:58:27 +01:00
Peter Steinberger 88282f7b23 test: keep discord and irc entry smokes descriptor-only 2026-04-08 13:55:47 +01:00
Peter Steinberger 675f36d93b test: avoid bundled test api smokes in matrix and telegram 2026-04-08 13:52:45 +01:00
Peter Steinberger 2f3402c660 ci: reduce full suite test parallelism 2026-04-08 13:51:02 +01:00
Peter Steinberger e1562fcdfa test: keep bundled channel entry smokes descriptor-only 2026-04-08 13:47:49 +01:00
Peter Steinberger 5dbf607f73 test: guard loader fixtures against broad sdk imports 2026-04-08 13:28:32 +01:00
Peter Steinberger e673efe537 ci: split parallel full suite into leaf shards 2026-04-08 13:20:05 +01:00
Peter Steinberger d7a5784141 test: keep followup runner memory mock complete 2026-04-08 13:18:57 +01:00
Peter Steinberger 5802aa383e test: isolate discord directory live token env 2026-04-08 13:13:55 +01:00
Peter Steinberger 4d2ea434d2 ci: skip duplicate full extension shard 2026-04-08 13:03:51 +01:00
Peter Steinberger 640d39d482 test: inline cli metadata channel fixture 2026-04-08 12:58:48 +01:00
Peter Steinberger 4e41cf7a6e plugins: read contract inventory from manifests 2026-04-08 12:58:42 +01:00
Peter Steinberger 39cd6f3c76 auto-reply: type status auth overrides 2026-04-08 12:58:32 +01:00
Peter Steinberger f606867cc2 test: keep status tests off live usage probes 2026-04-08 12:51:59 +01:00
Peter Steinberger d35c46d6c7 test: fix postpublish verifier sidecar handling 2026-04-08 12:51:15 +01:00
Peter Steinberger 013ee39f8d test: skip duplicate package boundary wrapper in ci 2026-04-08 12:32:28 +01:00
Peter Steinberger e17cc51839 test: isolate agent gateway cli command mocks 2026-04-08 12:23:44 +01:00
Peter Steinberger 2b6b627fd1 test: stabilize plugin boundary invariants 2026-04-08 12:13:41 +01:00
Peter Steinberger 97dfbe0fe1 feat: add qa character vibes eval 2026-04-08 12:05:24 +01:00
Nimrod Gutman f3c304917a revert: undo background alive review findings fix 2026-04-08 14:02:49 +03:00
Peter Steinberger 0e6e974117 fix(test): keep warn log capture under openclaw temp dir 2026-04-08 12:00:51 +01:00
scoootscooob d52d5ad6ff release: mirror bundled channel deps at root (#63065)
Merged via squash.

Prepared head SHA: ac26799a54088b811d3dae926f5c47b4dcf10f9a
Co-authored-by: scoootscooob <167050519+scoootscooob@users.noreply.github.com>
Co-authored-by: scoootscooob <167050519+scoootscooob@users.noreply.github.com>
Reviewed-by: @scoootscooob
2026-04-08 04:00:17 -07:00
Peter Steinberger 9bf3482470 refactor: finish markdown-only qa runner 2026-04-08 11:56:02 +01:00
Vicky f25127f31c fix: classify Z.ai error codes 1311 (billing) and 1113 (auth) (#49552)
Merged via squash.

Prepared head SHA: 3e7b8bb260ff5676872fa24df59b90b420da538c
Co-authored-by: 1bcMax <195689928+1bcMax@users.noreply.github.com>
Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com>
Reviewed-by: @altaywtf
2026-04-08 11:54:41 +01:00
Peter Steinberger 8f17b8e964 fix(qqbot): parse entity encoded self-closing media tags 2026-04-08 11:51:32 +01:00
Peter Steinberger 93b574581f fix(qqbot): allow URL slashes in media tag attributes 2026-04-08 11:48:26 +01:00
Peter Steinberger 592c1e50d9 test: harden release gate flakes 2026-04-08 11:47:59 +01:00
Peter Steinberger 7311ca743a test: stabilize release gate drift 2026-04-08 11:47:59 +01:00
Peter Steinberger 928a9e4915 fix: keep installer doctor non-interactive 2026-04-08 11:47:59 +01:00
Nimrod Gutman b328c66115 fix: resolve background alive beacon review findings 2026-04-08 13:46:39 +03:00
Peter Steinberger 4b4825b875 test: stabilize model warning sanitizer checks 2026-04-08 11:41:07 +01:00
Peter Steinberger 3726a12bf9 test: keep agent policy tests off broad tool construction 2026-04-08 11:38:24 +01:00
游乐场 210ee4cfd2 fix(qqbot): support HTML entities in media tags (&lt; &gt;) (#60493)
* fix(qqbot): 支持媒体标签中的 HTML 实体(&lt; &gt;)

* fix(qqbot): support HTML entities in media tags

* test(qqbot): add unit tests for media tag regex with HTML entities

* test(qqbot): export regex constants to enable unit tests

* fix(qqbot): reset regex lastIndex in tests to avoid state pollution

* test(qqbot): add .js extension to import in media-tags.test.ts

* fix(qqbot): support HTML entities in media tags (#60493) (thanks @ylc0919)

---------

Co-authored-by: sliverp <870080352@qq.com>
2026-04-08 18:35:14 +08:00
Peter Steinberger 2fdeb7af96 test: stub image provider discovery in generation tool tests 2026-04-08 11:20:29 +01:00
Peter Steinberger 46480f531a test: dedupe msteams authz fixtures 2026-04-08 10:43:48 +01:00
Peter Steinberger 70ca0f07ff fix(test): align current main verification fixtures 2026-04-08 10:32:33 +01:00
Peter Steinberger 4c65fa8eae fix(test): refresh plugin-sdk package boundary exports 2026-04-08 10:29:37 +01:00
Vincent Koc 208c49841c perf(plugins): trim explicit web provider artifact imports 2026-04-08 10:28:09 +01:00
Vincent Koc b2076f0a3f perf(plugins): prefer require for source public artifacts 2026-04-08 10:24:07 +01:00
Vincent Koc 5436bb4c80 perf(plugin-sdk): narrow account-id export seam 2026-04-08 10:18:22 +01:00
Peter Steinberger dabd78e492 fix: export web search config contract from plugin sdk package 2026-04-08 10:07:41 +01:00
Vincent Koc b3e26b1192 perf(secrets): lazy-load web-tools manifest owner lookup 2026-04-08 10:04:12 +01:00
Peter Steinberger 9b0f7e0e82 fix: keep bundled dir test argv mutable 2026-04-08 09:58:22 +01:00
Peter Steinberger 0950bdf727 fix: resolve post-rebase boundary drift 2026-04-08 09:58:22 +01:00
Peter Steinberger 06008b9b4a fix: keep minimax test helper package-local 2026-04-08 09:58:22 +01:00
Peter Steinberger 8d79b87dc7 style: apply formatter output 2026-04-08 09:58:22 +01:00
Peter Steinberger 95e397a266 refactor: dedupe repeated test helpers 2026-04-08 09:58:22 +01:00
Vincent Koc 7834140bf9 perf(plugin-sdk): split web-search contract fields 2026-04-08 09:57:59 +01:00
Vincent Koc 092c56ce46 fix(plugins): prefer source bundled tree in tsx runs 2026-04-08 09:48:45 +01:00
Peter Steinberger a5b54e7c01 test: keep provider auth onboarding tests off runtime auth 2026-04-08 09:44:17 +01:00
Vincent Koc 54f078dc86 ci(test): fan out windows test lane 2026-04-08 09:40:47 +01:00
Vincent Koc 6f8ad56b09 ci(test): raise checks-node-test fanout 2026-04-08 09:39:06 +01:00
scoootscooob 34c1f43df1 Control UI: guard stale session history reloads (#62975)
* Control UI: guard stale session history reloads

* control-ui: guard stale session history reloads

* control-ui: refresh avatar on session switch

* Control UI: refresh and guard chat avatars on session switch
2026-04-08 01:35:43 -07:00
Vincent Koc f329a01e69 ci(test): parallelize checks-node-test 2026-04-08 09:32:59 +01:00
Mariano 93e509ccfe fix(reply): use runtime snapshot for queued reply runs (#62693)
Merged via squash.

Prepared head SHA: 2a3e4e5c60fdf7a8c27cbf0e1997836ccfb4f3b7
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Reviewed-by: @mbelinky
2026-04-08 10:31:01 +02:00
Nimrod Gutman 6681878339 feat(ios): pin calver release versioning (#63001)
* feat(ios): decouple app versioning from gateway

* feat(ios): pin calver release versioning

* refactor(ios): drop prerelease version helper fields

* docs(changelog): note pinned ios release versioning (#63001) (thanks @ngutman)
2026-04-08 11:25:35 +03:00
Peter Steinberger 37e667c4c5 test: keep tool-policy tests below coding tool construction 2026-04-08 09:20:27 +01:00
Peter Steinberger 492e98a88a refactor: move qa suite logic into scenario markdown 2026-04-08 09:13:57 +01:00
Vincent Koc 45542fa726 fix(test): stabilize windows tooling assertions 2026-04-08 09:12:08 +01:00
Peter Steinberger 945775007d test: cover model-list forward compat below command runtime 2026-04-08 09:10:30 +01:00
Vincent Koc d99e8ce619 test(plugin-sdk): satisfy tool payload carrier typing 2026-04-08 09:07:29 +01:00
Vincent Koc be530f085d refactor(plugin-sdk): share tool payload extraction 2026-04-08 09:07:28 +01:00
Vincent Koc a04b9a27fb refactor(plugins): reuse canonical media contract registries 2026-04-08 09:07:28 +01:00
Vincent Koc f38035a7b6 refactor(plugin-sdk): share web-search contract fields 2026-04-08 09:07:28 +01:00
Vincent Koc ed846a7157 refactor(agents): share media status action helpers 2026-04-08 09:07:28 +01:00
Vincent Koc 363c2bc171 refactor(agents): share media background task lifecycle 2026-04-08 09:07:28 +01:00
Vincent Koc 2e1ec9653c refactor(plugins): reuse interactive registry state 2026-04-08 09:07:28 +01:00
Vincent Koc e52cf224df refactor(doctor): share channel compat helpers 2026-04-08 09:07:28 +01:00
Vincent Koc 3574aedd68 test(plugins): refresh telegram runtime api guardrail 2026-04-08 09:07:05 +01:00
Vincent Koc 490c9c80ef perf(plugin-sdk): split web search config contract 2026-04-08 09:03:07 +01:00
Peter Steinberger 290bde2c14 test: cover multi-agent tool policy below tool construction 2026-04-08 08:58:50 +01:00
Peter Steinberger 279739d5c2 test: keep media-understanding defaults tests on tiny registry 2026-04-08 08:54:55 +01:00
Vincent Koc 952862b9e2 perf(plugins): narrow boundary compile import surfaces 2026-04-08 08:52:52 +01:00
Vincent Koc 73c475023f perf(plugins): trim channel boundary core imports 2026-04-08 08:52:52 +01:00
Vincent Koc 4260ac4cf6 perf(plugins): narrow boundary compile sdk imports 2026-04-08 08:52:51 +01:00
Vincent Koc 2e7a0fc7fb perf(plugins): report slow boundary compiles 2026-04-08 08:52:51 +01:00
Vincent Koc 680c0f77cb perf(config): trim web search config helper imports 2026-04-08 08:51:01 +01:00
Peter Steinberger a385121475 test: use stubbed OpenClaw tools in agent config tool suite 2026-04-08 08:49:10 +01:00
Peter Steinberger 7da23c36a1 test: mock web search provider discovery in onboard setup tests 2026-04-08 08:38:01 +01:00
Peter Steinberger 6507bc0294 test: keep models list auth sync off real discovery 2026-04-08 08:30:32 +01:00
Peter Steinberger 21d9bac5ec fix: stabilize live qa scenario suite 2026-04-08 08:17:59 +01:00
Vincent Koc 55cbcd829d fix(slack): preserve auth on same-origin media redirects (#62996) (thanks @vincentkoc)
- Verified: pnpm build\n- Verified: pnpm test extensions/slack/src/monitor/media.test.ts\n- Verified: pnpm exec oxlint extensions/slack/src/monitor/media.ts extensions/slack/src/monitor/media.test.ts\n- Verified: pnpm exec oxfmt --check extensions/slack/src/monitor/media.ts extensions/slack/src/monitor/media.test.ts CHANGELOG.md\n\nRepo-wide pnpm lint and pnpm test were not clean on current main outside this fix, and the first full-suite test attempt from the default core sparse profile was additionally contaminated by missing ui/packages/OpenClawKit paths until they were materialized.
2026-04-08 08:11:27 +01:00
Peter Steinberger 8cbd60d203 chore: prepare 2026.4.9 release 2026-04-08 08:02:53 +01:00
Vincent Koc 2205153ee8 perf(secrets): fast-path exact bundled web providers 2026-04-08 08:02:37 +01:00
Nyanako dc1e07ea41 test(plugin-sdk): cover packaged telegram setup sidecars (#62990) 2026-04-08 08:00:59 +01:00
Vincent Koc c727ac48d8 perf(secrets): cache web search risk lookup 2026-04-08 07:51:20 +01:00
Peter Steinberger 2f5b5b7e35 test: remove gpt 4.1 install e2e fallbacks 2026-04-08 07:41:00 +01:00
Vincent Koc 3e7e6f2f60 docs: cover 2026.4.7 changelog gaps 2026-04-08 07:26:56 +01:00
Peter Steinberger 95754cf57a test: isolate subagent resume persistence registry path 2026-04-08 07:26:43 +01:00
Peter Steinberger 4f5c137f88 fix: unblock windows update build 2026-04-08 07:18:31 +01:00
Vincent Koc 3eb47e9e73 perf(telegram): trim secret contract text import 2026-04-08 07:17:53 +01:00
Peter Steinberger 23fd3d32fb build: update appcast for 2026.4.8 2026-04-08 07:15:52 +01:00
Peter Steinberger 0a5aefefbd test: harden Docker install e2e agent lane 2026-04-08 07:15:51 +01:00
Peter Steinberger 3b1c6d3266 test: keep Discord payload contracts off broad test api 2026-04-08 07:09:03 +01:00
Vincent Koc f0f405cf47 perf(matrix): trim secret env-var import path 2026-04-08 07:05:49 +01:00
Vincent Koc 31b0d97c33 test(extensions): fix bundled lint regressions 2026-04-08 07:04:51 +01:00
Peter Steinberger 9a65a5166f test: load narrow Discord inbound context harness 2026-04-08 07:03:21 +01:00
Peter Steinberger 8a9a3984e4 test: isolate video media runner auth from main profile store 2026-04-08 07:01:00 +01:00
Peter Steinberger 1c5e4de3b0 test: share gateway server for chat history RPC suite 2026-04-08 06:51:35 +01:00
Peter Steinberger 890a0e4a99 test: fold config apply RPC cases into config gateway suite 2026-04-08 06:49:20 +01:00
Peter Steinberger 2920bc7a70 test: share gateway server for talk config RPC tests 2026-04-08 06:44:22 +01:00
Peter Steinberger b1a216c365 test: share gateway harness for session message event tests 2026-04-08 06:40:35 +01:00
Peter Steinberger fd5be4bcc0 test: fold OpenAI message channel check into shared HTTP suite 2026-04-08 06:34:55 +01:00
Peter Steinberger 0486c736fb test: keep model pricing cache tests off provider runtime 2026-04-08 06:32:24 +01:00
Peter Steinberger d398ed0660 test: avoid reconnect waits in node wake unit tests 2026-04-08 06:24:06 +01:00
Peter Steinberger f4c64168e7 test: route gateway HTTP history and startup wiring to e2e 2026-04-08 06:17:52 +01:00
Peter Steinberger abe7b2c49d chore: sync 2026.4.8 config docs baseline
Docker Release / validate_manual_backfill (push) Has been cancelled
Docker Release / approve_manual_backfill (push) Has been cancelled
Docker Release / build-amd64 (push) Has been cancelled
Docker Release / build-arm64 (push) Has been cancelled
Docker Release / create-manifest (push) Has been cancelled
2026-04-08 06:13:59 +01:00
Peter Steinberger e76542f9a0 test: fold talk provider override coverage into runtime suite 2026-04-08 06:12:39 +01:00
Gustavo Madeira Santana 17a2290f49 Docs: refresh schema, slash commands, and TTS refs 2026-04-08 01:10:00 -04:00
Peter Steinberger b0c5d2baf6 test: mock talk synthesis at gateway boundary 2026-04-08 06:07:08 +01:00
Peter Steinberger a53c13fc06 chore: prepare 2026.4.8 npm release 2026-04-08 06:03:20 +01:00
Peter Steinberger a34602c172 test: move openai talk override coverage to provider lane 2026-04-08 06:02:47 +01:00
Peter Steinberger 75fe554db7 test: smoke packed bundled channel entries 2026-04-08 05:58:29 +01:00
Gustavo Madeira Santana 6c0d25cea4 Slack: clarify native streaming config hint 2026-04-08 00:58:00 -04:00
Gustavo Madeira Santana 82c06e5604 Docs: clarify Slack streaming thread behavior
Clarify the canonical Slack streaming config keys and legacy migration notes
across the Slack docs and shared streaming concept docs.

Document that native Slack streaming and assistant thread status require a
reply thread, and call out the top-level DM fallback behavior.
2026-04-08 00:58:00 -04:00
Peter Steinberger 993abc1fb9 test: move gateway e2e fixture out of unit lane 2026-04-08 05:57:51 +01:00
Peter Steinberger 825028289b fix: pass resolved Slack download tokens (#62097) (thanks @martingarramon) 2026-04-08 05:44:23 +01:00
Martin Garramon fd68c28164 fix(slack): forward resolved botToken to downloadSlackFile
Closes #62088

When `buildActionOpts` returns undefined (default account, no token
override), `downloadSlackFile` calls `resolveToken(undefined, undefined)`
which re-reads raw config via `loadConfig()`. If botToken is a SecretRef
object, `normalizeResolvedSecretInputString` rejects it because it
expects a string — the download silently fails.

This injects the already-resolved botToken from the gateway runtime
snapshot into the download opts as a fallback, bypassing the raw config
re-read. Same root cause as the Discord fix in b51214ec3e.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 05:44:23 +01:00
Maxime Grenu d7c3210cd6 fix(net): skip DNS pinning before trusted env proxy dispatch 2026-04-08 05:41:58 +01:00
Peter Steinberger b4034b32c3 fix: honor Slack Socket Mode env proxies (#62878) (thanks @mjamiv) 2026-04-08 05:38:45 +01:00
Michael Martello 5609a35f67 fix: handle leading-dot NO_PROXY entries matching apex domain
`.slack.com` in NO_PROXY should match both `slack.com` (apex) and
`wss-primary.slack.com` (subdomain). Strip the leading dot before
comparison so the suffix check works for both cases.
2026-04-08 05:38:45 +01:00
Michael Martello 4ab6a7b324 fix: address review — honor NO_PROXY, guard malformed URLs
- Check NO_PROXY/no_proxy before creating HttpsProxyAgent; skip proxy
  when slack.com matches an exclusion entry (exact, suffix, or wildcard).
- Wrap HttpsProxyAgent construction in try/catch so malformed proxy URLs
  degrade to direct connectivity instead of crashing Slack channel init.
- Extract resolveProxyUrlFromEnv and isHostExcludedByNoProxy as testable
  helpers.
- Add tests for NO_PROXY exclusion, wildcard, unrelated hosts, and
  malformed URL resilience.
2026-04-08 05:38:45 +01:00
Michael Martello d4e5f250a0 fix(slack): honor HTTPS_PROXY for Socket Mode WebSocket connections
When HTTPS_PROXY or HTTP_PROXY env vars are set, create an
HttpsProxyAgent and pass it as the `agent` option through
@slack/bolt → @slack/socket-mode → ws, so the WebSocket upgrade
request is tunneled through the proxy.

This fixes Slack Socket Mode in environments where all outbound
traffic must go through an HTTP CONNECT proxy (e.g. sandboxed
containers, corporate networks). Previously the ws library opened
a direct connection to wss-primary.slack.com, ignoring proxy env
vars entirely.

The approach mirrors the existing Discord gateway proxy support
(extensions/discord/src/monitor/gateway-plugin.ts) which uses the
same https-proxy-agent library.

Fixes #57405
2026-04-08 05:38:45 +01:00
Peter Steinberger b73d8ef7d7 refactor: split qa scenarios into per-file markdown defs 2026-04-08 05:37:17 +01:00
Peter Steinberger 5eab61b45d test: add opt-in leaf project scheduler 2026-04-08 05:28:55 +01:00
Peter Steinberger e89dc72c35 test: stabilize provider auth alias test imports 2026-04-08 05:28:46 +01:00
Peter Steinberger 357fcaea12 test: avoid duplicating plugin contract lane 2026-04-08 05:28:33 +01:00
1083 changed files with 42932 additions and 25425 deletions
@@ -15,6 +15,7 @@ Use this skill for `qa-lab` / `qa-channel` work. Repo-local QA only.
- `qa/QA_KICKOFF_TASK.md`
- `qa/seed-scenarios.json`
- `extensions/qa-lab/src/suite.ts`
- `extensions/qa-lab/src/character-eval.ts`
## Model policy
@@ -48,6 +49,68 @@ pnpm openclaw qa suite \
5. If the user wants to watch the live UI, find the current `openclaw-qa` listen port and report `http://127.0.0.1:<port>`.
6. If a scenario fails, fix the product or harness root cause, then rerun the full lane.
## Character evals
Use `qa character-eval` for style/persona/vibe checks across multiple live models.
```bash
pnpm openclaw qa character-eval \
--model openai/gpt-5.4,thinking=xhigh \
--model openai/gpt-5.2,thinking=xhigh \
--model openai/gpt-5,thinking=xhigh \
--model anthropic/claude-opus-4-6,thinking=high \
--model anthropic/claude-sonnet-4-6,thinking=high \
--model zai/glm-5.1,thinking=high \
--model moonshot/kimi-k2.5,thinking=high \
--model google/gemini-3.1-pro-preview,thinking=high \
--judge-model openai/gpt-5.4,thinking=xhigh,fast \
--judge-model anthropic/claude-opus-4-6,thinking=high \
--concurrency 16 \
--judge-concurrency 16 \
--output-dir .artifacts/qa-e2e/character-eval-<tag>
```
- Runs local QA gateway child processes, not Docker.
- Preferred model spec syntax is `provider/model,thinking=<level>[,fast|,no-fast|,fast=<bool>]` for both `--model` and `--judge-model`.
- Do not add new examples with separate `--model-thinking`; keep that flag as legacy compatibility only.
- Defaults to candidate models `openai/gpt-5.4`, `openai/gpt-5.2`, `openai/gpt-5`, `anthropic/claude-opus-4-6`, `anthropic/claude-sonnet-4-6`, `zai/glm-5.1`, `moonshot/kimi-k2.5`, and `google/gemini-3.1-pro-preview` when no `--model` is passed.
- Candidate thinking defaults to `high`, with `xhigh` for OpenAI models that support it. Prefer inline `--model provider/model,thinking=<level>`; `--thinking <level>` and `--model-thinking <provider/model=level>` remain compatibility shims.
- OpenAI candidate refs default to fast mode so priority processing is used where supported. Use inline `,fast`, `,no-fast`, or `,fast=false` for one model; use `--fast` only to force fast mode for every candidate.
- Judges default to `openai/gpt-5.4,thinking=xhigh,fast` and `anthropic/claude-opus-4-6,thinking=high`.
- Report includes judge ranking, run stats, durations, and full transcripts; do not include raw judge replies. Duration is benchmark context, not a grading signal.
- Candidate and judge concurrency default to 16. Use `--concurrency <n>` and `--judge-concurrency <n>` to override when local gateways or provider limits need a gentler lane.
- Scenario source should stay markdown-driven under `qa/scenarios/`.
- For isolated character/persona evals, write the persona into `SOUL.md` and blank `IDENTITY.md` in the scenario flow. Use `SOUL.md + IDENTITY.md` only when intentionally testing how the normal OpenClaw identity combines with the character.
- Keep prompts natural and task-shaped. The candidate model should receive character setup through `SOUL.md`, then normal user turns such as chat, workspace help, and small file tasks; do not ask "how would you react?" or tell the model it is in an eval.
- Prefer at least one real task, such as creating or editing a tiny workspace artifact, so the transcript captures character under normal tool use instead of pure roleplay.
## Codex CLI model lane
Use model refs shaped like `codex-cli/<codex-model>` whenever QA should exercise Codex as a model backend.
Examples:
```bash
pnpm openclaw qa suite \
--provider-mode live-frontier \
--model codex-cli/<codex-model> \
--alt-model codex-cli/<codex-model> \
--scenario <scenario-id> \
--output-dir .artifacts/qa-e2e/codex-<tag>
```
```bash
pnpm openclaw qa manual \
--model codex-cli/<codex-model> \
--message "Reply exactly: CODEX_OK"
```
- Treat the concrete Codex model name as user/config input; do not hardcode it in source, docs examples, or scenarios.
- Live QA preserves `CODEX_HOME` so Codex CLI auth/config works while keeping `HOME` and `OPENCLAW_HOME` sandboxed.
- Mock QA should scrub `CODEX_HOME`.
- If Codex returns fallback/auth text every turn, first check `CODEX_HOME`, `~/.profile`, and gateway child logs before changing scenario assertions.
- For model comparison, include `codex-cli/<codex-model>` as another candidate in `qa character-eval`; the report should label it as an opaque model name.
## Repo facts
- Seed scenarios live in `qa/`.
+12 -2
View File
@@ -450,6 +450,7 @@ jobs:
- name: Run ${{ matrix.task }} (${{ matrix.runtime }})
env:
OPENCLAW_TEST_PROJECTS_PARALLEL: 3
TASK: ${{ matrix.task }}
shell: bash
run: |
@@ -548,6 +549,10 @@ jobs:
TASK: ${{ matrix.task }}
run: |
echo "OPENCLAW_VITEST_MAX_WORKERS=2" >> "$GITHUB_ENV"
if [ "$TASK" = "test" ]; then
echo "OPENCLAW_TEST_PROJECTS_LEAF_SHARDS=1" >> "$GITHUB_ENV"
echo "OPENCLAW_TEST_SKIP_FULL_EXTENSIONS_SHARD=1" >> "$GITHUB_ENV"
fi
if [ "$TASK" = "channels" ]; then
echo "OPENCLAW_VITEST_MAX_WORKERS=1" >> "$GITHUB_ENV"
fi
@@ -942,6 +947,7 @@ jobs:
NODE_OPTIONS: --max-old-space-size=6144
# Keep total concurrency predictable on the 32 vCPU runner.
OPENCLAW_VITEST_MAX_WORKERS: 1
OPENCLAW_TEST_SKIP_FULL_EXTENSIONS_SHARD: 1
defaults:
run:
shell: bash
@@ -1036,7 +1042,9 @@ jobs:
set -euo pipefail
case "$TASK" in
test)
pnpm test
# Linux owns the full repo test suite. Keep the Windows runner focused on
# Windows-native process/path wrappers so platform regressions fail fast.
pnpm test:windows:ci
;;
*)
echo "Unsupported Windows checks task: $TASK" >&2
@@ -1087,7 +1095,9 @@ jobs:
set -euo pipefail
case "$TASK" in
test)
pnpm test
# Linux owns the full repo test suite. Keep macOS CI focused on
# launchd/Homebrew/runtime path coverage and the process-group wrapper.
pnpm test:macos:ci
;;
*)
echo "Unsupported macOS node task: $TASK" >&2
+57 -3
View File
@@ -162,9 +162,63 @@ jobs:
RELEASE_NPM_DIST_TAG: ${{ inputs.npm_dist_tag }}
run: |
set -euo pipefail
PACK_JSON="$(npm pack --json)"
echo "$PACK_JSON"
PACK_PATH="$(printf '%s\n' "$PACK_JSON" | node -e 'const chunks=[]; process.stdin.on("data", (chunk) => chunks.push(chunk)); process.stdin.on("end", () => { const parsed = JSON.parse(Buffer.concat(chunks).toString("utf8")); const first = Array.isArray(parsed) ? parsed[0] : null; if (!first || typeof first.filename !== "string" || !first.filename) { process.exit(1); } process.stdout.write(first.filename); });')"
PACK_OUTPUT="$RUNNER_TEMP/npm-pack-output.txt"
npm pack --json 2>&1 | tee "$PACK_OUTPUT"
PACK_PATH="$(node - "$PACK_OUTPUT" <<'NODE'
const fs = require("node:fs");
const input = fs.readFileSync(process.argv[2], "utf8");
function arrayEndFrom(start) {
let depth = 0;
let inString = false;
let escape = false;
for (let i = start; i < input.length; i += 1) {
const char = input[i];
if (inString) {
if (escape) {
escape = false;
} else if (char === "\\") {
escape = true;
} else if (char === "\"") {
inString = false;
}
continue;
}
if (char === "\"") {
inString = true;
} else if (char === "[") {
depth += 1;
} else if (char === "]") {
depth -= 1;
if (depth === 0) {
return i + 1;
}
}
}
return -1;
}
for (let start = input.indexOf("["); start !== -1; start = input.indexOf("[", start + 1)) {
const end = arrayEndFrom(start);
if (end === -1) {
continue;
}
try {
const parsed = JSON.parse(input.slice(start, end));
const first = Array.isArray(parsed) ? parsed[0] : null;
if (first && typeof first.filename === "string" && first.filename) {
process.stdout.write(first.filename);
process.exit(0);
}
} catch {
// Keep scanning; npm lifecycle output can legally precede the JSON.
}
}
console.error("Could not find npm pack --json output with a filename.");
process.exit(1);
NODE
)"
if [[ -z "$PACK_PATH" || ! -f "$PACK_PATH" ]]; then
echo "npm pack did not produce a tarball file." >&2
exit 1
+61 -4
View File
@@ -4,14 +4,71 @@ Docs: https://docs.openclaw.ai
## Unreleased
## 2026.4.7-1
### Changes
### Fixes
- Agents/exec: keep `/exec` current-default reporting aligned with real runtime behavior so `host=auto` sessions surface the correct host-aware fallback policy (`full/off` on gateway or node, `deny/off` on sandbox) instead of stale stricter defaults.
- Agents/progress: keep `update_plan` available for OpenAI-family runs while returning compact success payloads and allowing `tools.experimental.planTool=false` to opt out.
- Telegram/setup: load setup and secret contracts through packaged top-level sidecars so installed 2026.4.7 npm builds no longer try to import missing `dist/extensions/telegram/src/*` files during gateway startup.
## 2026.4.9
### Changes
- Memory/dreaming: add a grounded REM backfill lane with historical `rem-harness --path`, diary commit/reset flows, cleaner durable-fact extraction, and live short-term promotion integration so old daily notes can replay into Dreams and durable memory without a second memory stack. Thanks @mbelinky.
- Control UI/dreaming: add a structured diary view with timeline navigation, backfill/reset controls, traceable dreaming summaries, and a grounded Scene lane with promotion hints plus a safe clear-grounded action for staged backfill signals. (#63395) Thanks @mbelinky.
- QA/lab: add character-vibes evaluation reports with model selection and parallel runs so live QA can compare candidate behavior faster.
- Plugins/provider-auth: let provider manifests declare `providerAuthAliases` so provider variants can share env vars, auth profiles, config-backed auth, and API-key onboarding choices without core-specific wiring.
- iOS: pin release versioning to an explicit CalVer in `apps/ios/version.json`, keep TestFlight iteration on the same short version until maintainers intentionally promote the next gateway version, and add the documented `pnpm ios:version:pin -- --from-gateway` workflow for release trains. (#63001) Thanks @ngutman.
### Fixes
- Browser/security: re-run blocked-destination safety checks after interaction-driven main-frame navigations from click, evaluate, hook-triggered click, and batched action flows, so browser interactions cannot bypass the SSRF quarantine when they land on forbidden URLs. (#63226) Thanks @eleqtrizit.
- Security/dotenv: block runtime-control env vars plus browser-control override and skip-server env vars from untrusted workspace `.env` files, and reject unsafe URL-style browser control override specifiers before lazy loading. (#62660, #62663) Thanks @eleqtrizit.
- Gateway/node exec events: mark remote node `exec.started`, `exec.finished`, and `exec.denied` summaries as untrusted system events and sanitize node-provided command/output/reason text before enqueueing them, so remote node output cannot inject trusted `System:` content into later turns. (#62659) Thanks @eleqtrizit.
- Plugins/onboarding auth choices: prevent untrusted workspace plugins from colliding with bundled provider auth-choice ids during non-interactive onboarding, so bundled provider setup keeps operator secrets out of untrusted workspace plugin handlers unless those plugins are explicitly trusted. (#62368) Thanks @pgondhi987.
- Security/dependency audit: force `basic-ftp` to `5.2.1` for the CRLF command-injection fix and bump Hono plus `@hono/node-server` in production resolution paths.
- Android/pairing: clear stale setup-code auth on new QR scans, bootstrap operator and node sessions from fresh pairing, prefer stored device tokens after bootstrap handoff, and pause pairing auto-retry while the app is backgrounded so scan-once Android pairing recovers reliably again. (#63199) Thanks @obviyus.
- Matrix/gateway: wait for Matrix sync readiness before marking startup successful, keep Matrix background handler failures contained, and route fatal Matrix sync stops through channel-level restart handling instead of crashing the whole gateway. (#62779) Thanks @gumadeiras.
- Slack/media: preserve bearer auth across same-origin `files.slack.com` redirects while still stripping it on cross-origin Slack CDN hops, so `url_private_download` image attachments load again. (#62960) Thanks @vincentkoc.
- Reply/doctor: use the active runtime snapshot for queued reply runs, resolve reply-run SecretRefs before preflight helpers touch config, surface gateway OAuth reauth failures to users, and make `openclaw doctor` call out exact reauth commands. (#62693, #63217) Thanks @mbelinky.
- Control UI: guard stale session-history reloads during fast session switches so the selected session and rendered transcript stay in sync. (#62975) Thanks @scoootscooob.
- Gateway/chat: suppress exact and streamed `ANNOUNCE_SKIP` / `REPLY_SKIP` control replies across live chat updates and history sanitization so internal agent-to-agent control tokens no longer leak into user-facing gateway chat surfaces. (#51739) Thanks @Pinghuachiu.
- Auto-reply/NO_REPLY: strip glued leading `NO_REPLY` tokens before reply normalization and ACP-visible streaming so silent sentinel text no longer leaks into user-visible replies while preserving substantive `NO_REPLY ...` text. Thanks @frankekn.
- Sessions/routing: preserve established external routes on inter-session announce traffic so `sessions_send` follow-ups do not steal delivery from Telegram, Discord, or other external channels. (#58013) Thanks @duqaXxX.
- Gateway/sessions: clear auto-fallback-pinned model overrides on `/reset` and `/new` while still preserving explicit user model selections, including legacy sessions created before override-source tracking existed. (#63155) Thanks @frankekn.
- Slack/ACP: treat Slack ACP block replies as visible delivered output so OpenClaw stops re-sending the final fallback text after Slack already rendered the reply. (#62858) Thanks @gumadeiras.
- Slack/partial streaming: key turn-local dedupe by dispatch kind and keep the final fallback reply path active when preview finalization fails so stale preview text cannot suppress the actual final answer. (#62859) Thanks @gumadeiras.
- Matrix/doctor: migrate legacy `channels.matrix.dm.policy: "trusted"` configs back to compatible DM policies during `openclaw doctor --fix`, preserving explicit `allowFrom` boundaries as `allowlist` and defaulting empty legacy configs to `pairing`. (#62942) Thanks @lukeboyett.
- npm packaging: mirror bundled channel runtime deps, stage Nostr runtime deps, derive required root mirrors from manifests and built chunks, and test packed release tarballs without repo `node_modules` so fresh installs fail fast on missing plugin deps instead of crashing at runtime. (#63065) Thanks @scoootscooob.
- QA/live auth: fail fast when live QA scenarios hit classified auth or runtime failure replies, including raw scenario wait paths, and sanitize missing-key guidance so gateway auth problems surface as actionable errors instead of timeouts. (#63333) Thanks @shakkernerd.
- Providers/OpenAI: default missing reasoning effort to `high` on OpenAI Responses, WebSocket, and compatible completions transports, while still honoring explicit per-run reasoning levels.
- Providers/Ollama: allow Ollama models using the native `api: "ollama"` path to optionally display thinking output when `/think` is set to a non-off level. (#62712) Thanks @hoyyeva.
- Codex CLI: pass OpenClaw's system prompt through Codex's `model_instructions_file` config override so fresh Codex CLI sessions receive the same prompt guidance as Claude CLI sessions.
- Auth/profiles: persist explicit auth-profile upserts directly and skip external CLI sync for local writes so profile changes are saved without stale external credential state.
- Agents/timeouts: make the LLM idle timeout inherit `agents.defaults.timeoutSeconds` when configured, disable the unconfigured idle watchdog for cron runs, and point idle-timeout errors at `agents.defaults.llm.idleTimeoutSeconds`. Thanks @drvoss.
- Agents/failover: classify Z.ai vendor code `1311` as billing and `1113` as auth, including long wrapped `1311` payloads, so these errors stop falling through to generic failover handling. (#49552) Thanks @1bcMax.
- QQBot/media-tags: support HTML entity-encoded angle brackets (`&lt;`/`&gt;`), URL slashes in attributes, and self-closing media tags so upstream `<qqimg>` payloads are correctly parsed and normalized. (#60493) Thanks @ylc0919.
- Memory/dreaming: harden grounded backfill inputs, diary writes, status payloads, and diary action classification by preserving source-day labels, rejecting missing or symlinked targets cleanly, normalizing diary headings in gateway backfills, and tightening claim splitting plus diary source metadata. Thanks @mbelinky.
- Memory/dreaming: accept embedded heartbeat trigger tokens so light and REM dreaming still run when runtime wrappers include extra heartbeat text.
- Android/manual connect: allow blank port input only for TLS manual gateway endpoints so standard HTTPS Tailscale hosts default to `443` without silently changing cleartext manual connects. (#63134) Thanks @Tyler-RNG.
- Windows/update: add heap headroom to Windows `pnpm build` steps during dev updates so update preflight builds stop failing on low default Node memory.
- Plugin SDK: export the channel plugin base and web-search config contract through the public package so plugins can use them without private imports.
- Plugins/contracts: keep test-only helpers out of production contract barrels, load shared contract harnesses through bundled test surfaces, and harden guardrails so indirect re-exports and canonical `*.test.ts` files stay blocked. (#63311) Thanks @altaywtf.
- 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.
## 2026.4.8
### Fixes
- Telegram/setup: load setup and secret contracts through packaged top-level sidecars so installed npm builds no longer try to import missing `dist/extensions/telegram/src/*` files during gateway startup.
- Bundled channels/setup: load shared secret contracts through packaged top-level sidecars across BlueBubbles, Feishu, Google Chat, IRC, Matrix, Mattermost, Microsoft Teams, Nextcloud Talk, Slack, and Zalo so installed npm builds no longer rely on missing `dist/extensions/*/src/*` files during gateway startup.
- Bundled plugins: align packaged plugin compatibility metadata with the release version so bundled channels and providers load on OpenClaw 2026.4.8.
- Agents/progress: keep `update_plan` available for OpenAI-family runs while returning compact success payloads and allowing `tools.experimental.planTool=false` to opt out.
- Agents/exec: keep `/exec` current-default reporting aligned with real runtime behavior so `host=auto` sessions surface the correct host-aware fallback policy (`full/off` on gateway or node, `deny/off` on sandbox) instead of stale stricter defaults.
- Slack: honor ambient HTTP(S) proxy settings for Socket Mode WebSocket connections, including NO_PROXY exclusions, so proxy-only deployments can connect without a monkey patch. (#62878) Thanks @mjamiv.
- Slack/actions: pass the already resolved read token into `downloadFile` so SecretRef-backed bot tokens no longer fail after a raw config re-read. (#62097) Thanks @martingarramon.
- Network/fetch guard: skip target DNS pinning when trusted env-proxy mode is active so proxy-only sandboxes can let the trusted proxy resolve outbound hosts. (#59007) Thanks @cluster2600.
## 2026.4.7-1
## 2026.4.7
+23 -114
View File
@@ -2,6 +2,29 @@
<rss xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" version="2.0">
<channel>
<title>OpenClaw</title>
<item>
<title>2026.4.8</title>
<pubDate>Wed, 08 Apr 2026 06:12:50 +0000</pubDate>
<link>https://raw.githubusercontent.com/openclaw/openclaw/main/appcast.xml</link>
<sparkle:version>2026040890</sparkle:version>
<sparkle:shortVersionString>2026.4.8</sparkle:shortVersionString>
<sparkle:minimumSystemVersion>15.0</sparkle:minimumSystemVersion>
<description><![CDATA[<h2>OpenClaw 2026.4.8</h2>
<h3>Fixes</h3>
<ul>
<li>Telegram/setup: load setup and secret contracts through packaged top-level sidecars so installed npm builds no longer try to import missing <code>dist/extensions/telegram/src/*</code> files during gateway startup.</li>
<li>Bundled channels/setup: load shared secret contracts through packaged top-level sidecars across BlueBubbles, Feishu, Google Chat, IRC, Matrix, Mattermost, Microsoft Teams, Nextcloud Talk, Slack, and Zalo so installed npm builds no longer rely on missing <code>dist/extensions/*/src/*</code> files during gateway startup.</li>
<li>Bundled plugins: align packaged plugin compatibility metadata with the release version so bundled channels and providers load on OpenClaw 2026.4.8.</li>
<li>Agents/progress: keep <code>update_plan</code> available for OpenAI-family runs while returning compact success payloads and allowing <code>tools.experimental.planTool=false</code> to opt out.</li>
<li>Agents/exec: keep <code>/exec</code> current-default reporting aligned with real runtime behavior so <code>host=auto</code> sessions surface the correct host-aware fallback policy (<code>full/off</code> on gateway or node, <code>deny/off</code> on sandbox) instead of stale stricter defaults.</li>
<li>Slack: honor ambient HTTP(S) proxy settings for Socket Mode WebSocket connections, including NO_PROXY exclusions, so proxy-only deployments can connect without a monkey patch. (#62878) Thanks @mjamiv.</li>
<li>Slack/actions: pass the already resolved read token into <code>downloadFile</code> so SecretRef-backed bot tokens no longer fail after a raw config re-read. (#62097) Thanks @martingarramon.</li>
<li>Network/fetch guard: skip target DNS pinning when trusted env-proxy mode is active so proxy-only sandboxes can let the trusted proxy resolve outbound hosts. (#59007) Thanks @cluster2600.</li>
</ul>
<p><a href="https://github.com/openclaw/openclaw/blob/main/CHANGELOG.md">View full changelog</a></p>
]]></description>
<enclosure url="https://github.com/openclaw/openclaw/releases/download/v2026.4.8/OpenClaw-2026.4.8.zip" length="25324810" type="application/octet-stream" sparkle:edSignature="aogl3hJf+FeRvQj0W4WDGMQnIRPpxXPQam50U7SBT3ljA1CeSbIGsnaj20aLF0Qc9DikPEXt5AEg7LMOen4+BQ=="/>
</item>
<item>
<title>2026.4.7</title>
<pubDate>Wed, 08 Apr 2026 02:54:26 +0000</pubDate>
@@ -357,119 +380,5 @@
]]></description>
<enclosure url="https://github.com/openclaw/openclaw/releases/download/v2026.4.5/OpenClaw-2026.4.5.zip" length="25050620" type="application/octet-stream" sparkle:edSignature="gVbB/73byllY0utwGIi3P5t0FyvLldeR0Uq2pAa6LTBr8VyZlwNCZ2xPlt2zDFshSUBFKxicYzohOmfJ28ACBg=="/>
</item>
<item>
<title>2026.4.2</title>
<pubDate>Thu, 02 Apr 2026 18:57:54 +0000</pubDate>
<link>https://raw.githubusercontent.com/openclaw/openclaw/main/appcast.xml</link>
<sparkle:version>2026040290</sparkle:version>
<sparkle:shortVersionString>2026.4.2</sparkle:shortVersionString>
<sparkle:minimumSystemVersion>15.0</sparkle:minimumSystemVersion>
<description><![CDATA[<h2>OpenClaw 2026.4.2</h2>
<h3>Breaking</h3>
<ul>
<li>Plugins/xAI: move <code>x_search</code> settings from the legacy core <code>tools.web.x_search.*</code> path to the plugin-owned <code>plugins.entries.xai.config.xSearch.*</code> path, standardize <code>x_search</code> auth on <code>plugins.entries.xai.config.webSearch.apiKey</code> / <code>XAI_API_KEY</code>, and migrate legacy config with <code>openclaw doctor --fix</code>. (#59674) Thanks @vincentkoc.</li>
<li>Plugins/web fetch: move Firecrawl <code>web_fetch</code> config from the legacy core <code>tools.web.fetch.firecrawl.*</code> path to the plugin-owned <code>plugins.entries.firecrawl.config.webFetch.*</code> path, route <code>web_fetch</code> fallback through the new fetch-provider boundary instead of a Firecrawl-only core branch, and migrate legacy config with <code>openclaw doctor --fix</code>. (#59465) Thanks @vincentkoc.</li>
</ul>
<h3>Changes</h3>
<ul>
<li>Tasks/Task Flow: restore the core Task Flow substrate with managed-vs-mirrored sync modes, durable flow state/revision tracking, and <code>openclaw flows</code> inspection/recovery primitives so background orchestration can persist and be operated separately from plugin authoring layers. (#58930) Thanks @mbelinky.</li>
<li>Tasks/Task Flow: add managed child task spawning plus sticky cancel intent, so external orchestrators can stop scheduling immediately and let parent Task Flows settle to <code>cancelled</code> once active child tasks finish. (#59610) Thanks @mbelinky.</li>
<li>Plugins/Task Flow: add a bound <code>api.runtime.taskFlow</code> seam so plugins and trusted authoring layers can create and drive managed Task Flows from host-resolved OpenClaw context without passing owner identifiers on each call. (#59622) Thanks @mbelinky.</li>
<li>Android/assistant: add assistant-role entrypoints plus Google Assistant App Actions metadata so Android can launch OpenClaw from the assistant trigger and hand prompts into the chat composer. (#59596) Thanks @obviyus.</li>
<li>Exec defaults: make gateway/node host exec default to YOLO mode by requesting <code>security=full</code> with <code>ask=off</code>, and align host approval-file fallbacks plus docs/doctor reporting with that no-prompt default.</li>
<li>Providers/runtime: add provider-owned replay hook surfaces for transcript policy, replay cleanup, and reasoning-mode dispatch. (#59143) Thanks @jalehman.</li>
<li>Plugins/hooks: add <code>before_agent_reply</code> so plugins can short-circuit the LLM with synthetic replies after inline actions. (#20067) Thanks @JoshuaLelon.</li>
<li>Channels/session routing: move provider-specific session conversation grammar into plugin-owned session-key surfaces, preserving Telegram topic routing and Feishu scoped inheritance across bootstrap, model override, restart, and tool-policy paths.</li>
<li>Feishu/comments: add a dedicated Drive comment-event flow with comment-thread context resolution, in-thread replies, and <code>feishu_drive</code> comment actions for document collaboration workflows. (#58497) Thanks @wittam-01.</li>
<li>Matrix/plugin: emit spec-compliant <code>m.mentions</code> metadata across text sends, media captions, edits, poll fallback text, and action-driven edits so Matrix mentions notify reliably in clients like Element. (#59323) Thanks @gumadeiras.</li>
<li>Diffs: add plugin-owned <code>viewerBaseUrl</code> so viewer links can use a stable proxy/public origin without passing <code>baseUrl</code> on every tool call. (#59341) Related #59227. Thanks @gumadeiras.</li>
<li>Agents/compaction: resolve <code>agents.defaults.compaction.model</code> consistently for manual <code>/compact</code> and other context-engine compaction paths, so engine-owned compaction uses the configured override model across runtime entrypoints. (#56710) Thanks @oliviareid-svg.</li>
<li>Agents/compaction: add <code>agents.defaults.compaction.notifyUser</code> so the <code>🧹 Compacting context...</code> start notice is opt-in instead of always being shown. (#54251) Thanks @oguricap0327.</li>
<li>WhatsApp/reactions: add <code>reactionLevel</code> guidance for agent reactions. Thanks @mcaxtr.</li>
<li>Exec approvals/channels: auto-enable DM-first native chat approvals when supported channels can infer approvers from existing owner config, while keeping channel fanout explicit and clarifying forwarding versus native approval client config.</li>
</ul>
<h3>Fixes</h3>
<ul>
<li>Providers/transport policy: centralize request auth, proxy, TLS, and header shaping across shared HTTP, stream, and websocket paths, block insecure TLS/runtime transport overrides, and keep proxy-hop TLS separate from target mTLS settings. (#59682) Thanks @vincentkoc.</li>
<li>Providers/Copilot: classify native GitHub Copilot API hosts in the shared provider endpoint resolver and harden token-derived proxy endpoint parsing so Copilot base URL routing stays centralized and fails closed on malformed hints. (#59644) Thanks @vincentkoc.</li>
<li>Providers/streaming headers: centralize default and attribution header merging across OpenAI websocket, embedded-runner, and proxy stream paths so provider-specific headers stay consistent and caller overrides only win where intended. (#59542) Thanks @vincentkoc.</li>
<li>Providers/media HTTP: centralize base URL normalization, default auth/header injection, and explicit header override handling across shared OpenAI-compatible audio, Deepgram audio, Gemini media/image, and Moonshot video request paths. (#59469) Thanks @vincentkoc.</li>
<li>Providers/OpenAI-compatible routing: centralize native-vs-proxy request policy so hidden attribution and related OpenAI-family defaults only apply on verified native endpoints across stream, websocket, and shared audio HTTP paths. (#59433) Thanks @vincentkoc.</li>
<li>Providers/Anthropic routing: centralize native-vs-proxy endpoint classification for direct Anthropic <code>service_tier</code> handling so spoofed or proxied hosts do not inherit native Anthropic defaults. (#59608) Thanks @vincentkoc.</li>
<li>Gateway/exec loopback: restore legacy-role fallback for empty paired-device token maps and allow silent local role upgrades so local exec and node clients stop failing with pairing-required errors after <code>2026.3.31</code>. (#59092) Thanks @openperf.</li>
<li>Agents/subagents: pin admin-only subagent gateway calls to <code>operator.admin</code> while keeping <code>agent</code> at least privilege, so <code>sessions_spawn</code> no longer dies on loopback scope-upgrade pairing with <code>close(1008) "pairing required"</code>. (#59555) Thanks @openperf.</li>
<li>Exec approvals/config: strip invalid <code>security</code>, <code>ask</code>, and <code>askFallback</code> values from <code>~/.openclaw/exec-approvals.json</code> during normalization so malformed policy enums fall back cleanly to the documented defaults instead of corrupting runtime policy resolution. (#59112) Thanks @openperf.</li>
<li>Exec approvals/doctor: report host policy sources from the real approvals file path and ignore malformed host override values when attributing effective policy conflicts. (#59367) Thanks @gumadeiras.</li>
<li>Exec/runtime: treat <code>tools.exec.host=auto</code> as routing-only, keep implicit no-config exec on sandbox when available or gateway otherwise, and reject per-call host overrides that would bypass the configured sandbox or host target. (#58897) Thanks @vincentkoc.</li>
<li>Slack/mrkdwn formatting: add built-in Slack mrkdwn guidance in inbound context so Slack replies stop falling back to generic Markdown patterns that render poorly in Slack. (#59100) Thanks @jadewon.</li>
<li>WhatsApp/presence: send <code>unavailable</code> presence on connect in self-chat mode so personal-phone users stop losing all push notifications while the gateway is running. (#59410) Thanks @mcaxtr.</li>
<li>WhatsApp/media: add HTML, XML, and CSS to the MIME map and fall back gracefully for unknown media types instead of dropping the attachment. (#51562) Thanks @bobbyt74.</li>
<li>Matrix/onboarding: restore guided setup in <code>openclaw channels add</code> and <code>openclaw configure --section channels</code>, while keeping custom plugin wizards on the shared <code>setupWizard</code> seam. (#59462) Thanks @gumadeiras.</li>
<li>Matrix/streaming: keep live partial previews for the current assistant block while preserving completed block updates as separate messages when <code>channels.matrix.blockStreaming</code> is enabled. (#59384) Thanks @gumadeiras.</li>
<li>Feishu/comment threads: harden document comment-thread delivery so whole-document comments fall back to <code>add_comment</code>, delayed reply lookups retry more reliably, and user-visible replies avoid reasoning/planning spillover. (#59129) Thanks @wittam-01.</li>
<li>MS Teams/streaming: strip already-streamed text from fallback block delivery when replies exceed the 4000-character streaming limit so long responses stop duplicating content. (#59297) Thanks @bradgroux.</li>
<li>Slack/thread context: filter thread starter and history by the effective conversation allowlist without dropping valid open-room, DM, or group DM context. (#58380) Thanks @jacobtomlinson.</li>
<li>Mattermost/probes: route status probes through the SSRF guard and honor <code>allowPrivateNetwork</code> so connectivity checks stay safe for self-hosted Mattermost deployments. (#58529) Thanks @mappel-nv.</li>
<li>Zalo/webhook replay: scope replay dedupe key by chat and sender so reused message IDs across different chats or senders no longer collide, and harden metadata reads for partially missing payloads. (#58444)</li>
<li>QQBot/structured payloads: restrict local file paths to QQ Bot-owned media storage, block traversal outside that root, reduce path leakage in logs, and keep inline image data URLs working. (#58453) Thanks @jacobtomlinson.</li>
<li>Image generation/providers: route OpenAI, MiniMax, and fal image requests through the shared provider HTTP transport path so custom base URLs, guarded private-network routing, and provider request defaults stay aligned with the rest of provider HTTP. Thanks @vincentkoc.</li>
<li>Image generation/providers: stop inferring private-network access from configured OpenAI, MiniMax, and fal image base URLs, and cap shared HTTP error-body reads so hostile or misconfigured endpoints fail closed without relaxing SSRF policy or buffering unbounded error payloads. Thanks @vincentkoc.</li>
<li>Browser/host inspection: keep static Chrome inspection helpers out of the activated browser runtime so <code>openclaw doctor browser</code> and related checks do not eagerly load the bundled browser plugin. (#59471) Thanks @vincentkoc.</li>
<li>Browser/CDP: normalize trailing-dot localhost absolute-form hosts before loopback checks so remote CDP websocket URLs like <code>ws://localhost.:...</code> rewrite back to the configured remote host. (#59236) Thanks @mappel-nv.</li>
<li>Agents/output sanitization: strip namespaced <code>antml:thinking</code> blocks from user-visible text so Anthropic-style internal monologue tags do not leak into replies. (#59550) Thanks @obviyus.</li>
<li>Kimi Coding/tools: normalize Anthropic tool payloads into the OpenAI-compatible function shape Kimi Coding expects so tool calls stop losing required arguments. (#59440) Thanks @obviyus.</li>
<li>Image tool/paths: resolve relative local media paths against the agent <code>workspaceDir</code> instead of <code>process.cwd()</code> so inputs like <code>inbox/receipt.png</code> pass the local-path allowlist reliably. (#57222) Thanks Priyansh Gupta.</li>
<li>Podman/launch: remove noisy container output from <code>scripts/run-openclaw-podman.sh</code> and align the Podman install guidance with the quieter startup flow. (#59368) Thanks @sallyom.</li>
<li>Plugins/runtime: keep LINE reply directives and browser-backed cleanup/reset flows working even when those plugins are disabled while tightening bundled plugin activation guards. (#59412) Thanks @vincentkoc.</li>
<li>ACP/gateway reconnects: keep ACP prompts alive across transient websocket drops while still failing boundedly when reconnect recovery does not complete. (#59473) Thanks @obviyus.</li>
<li>ACP/gateway reconnects: reject stale pre-ack ACP prompts after reconnect grace expiry so callers fail cleanly instead of hanging indefinitely when the gateway never confirms the run.</li>
<li>Gateway/session kill: enforce HTTP operator scopes on session kill requests and gate authorization before session lookup so unauthenticated callers cannot probe session existence. (#59128) Thanks @jacobtomlinson.</li>
<li>MS Teams/logging: format non-<code>Error</code> failures with the shared unknown-error helper so logs stop collapsing caught SDK or Axios objects into <code>[object Object]</code>. (#59321) Thanks @bradgroux.</li>
<li>Channels/setup: ignore untrusted workspace channel plugins during setup resolution so a shadowing workspace plugin cannot override built-in channel setup/login flows unless explicitly trusted in config. (#59158) Thanks @mappel-nv.</li>
<li>Exec/Windows: restore allowlist enforcement with quote-aware <code>argPattern</code> matching across gateway and node exec, and surface accurate dynamic pre-approved executable hints in the exec tool description. (#56285) Thanks @kpngr.</li>
<li>Gateway: prune empty <code>node-pending-work</code> state entries after explicit acknowledgments and natural expiry so the per-node state map no longer grows indefinitely. (#58179) Thanks @gavyngong.</li>
<li>Webhooks/secret comparison: replace ad-hoc timing-safe secret comparisons across BlueBubbles, Feishu, Mattermost, Telegram, Twilio, and Zalo webhook handlers with the shared <code>safeEqualSecret</code> helper and reject empty auth tokens in BlueBubbles. (#58432) Thanks @eleqtrizit.</li>
<li>OpenShell/mirror: constrain <code>remoteWorkspaceDir</code> and <code>remoteAgentWorkspaceDir</code> to the managed <code>/sandbox</code> and <code>/agent</code> roots, and keep mirror sync from overwriting or removing user-added shell roots during config synchronization. (#58515) Thanks @eleqtrizit.</li>
<li>Plugins/activation: preserve explicit, auto-enabled, and default activation provenance plus reason metadata across CLI, gateway bootstrap, and status surfaces so plugin enablement state stays accurate after auto-enable resolution. (#59641) Thanks @vincentkoc.</li>
<li>Exec/env: block additional host environment override pivots for package roots, language runtimes, compiler include paths, and credential/config locations so request-scoped exec cannot redirect trusted toolchains or config lookups. (#59233) Thanks @drobison00.</li>
<li>Dotenv/workspace overrides: block workspace <code>.env</code> files from overriding <code>OPENCLAW_PINNED_PYTHON</code> and <code>OPENCLAW_PINNED_WRITE_PYTHON</code> so trusted helper interpreters cannot be redirected by repo-local env injection. (#58473) Thanks @eleqtrizit.</li>
<li>Plugins/install: accept JSON5 syntax in <code>openclaw.plugin.json</code> and bundle <code>plugin.json</code> manifests during install/validation, so third-party plugins with trailing commas, comments, or unquoted keys no longer fail to install. (#59084) Thanks @singleGanghood.</li>
<li>Telegram/exec approvals: rewrite shared <code>/approve … allow-always</code> callback payloads to <code>/approve … always</code> before Telegram button rendering so plugin approval IDs still fit Telegram's <code>callback_data</code> limit and keep the Allow Always action visible. (#59217) Thanks @jameslcowan.</li>
<li>Cron/exec timeouts: surface timed-out <code>exec</code> and <code>bash</code> failures in isolated cron runs even when <code>verbose: off</code>, including custom session-target cron jobs, so scheduled runs stop failing silently. (#58247) Thanks @skainguyen1412.</li>
<li>Telegram/exec approvals: fall back to the origin session key for async approval followups and keep resume-failure status delivery sanitized so Telegram followups still land without leaking raw exec metadata. (#59351) Thanks @seonang.</li>
<li>Node-host/exec approvals: bind <code>pnpm dlx</code> invocations through the approval planner's mutable-script path so the effective runtime command is resolved for approval instead of being left unbound. (#58374)</li>
<li>Exec/node hosts: stop forwarding the gateway workspace cwd to remote node exec when no workdir was explicitly requested, so cross-platform node approvals fall back to the node default cwd instead of failing with <code>SYSTEM_RUN_DENIED</code>. (#58977) Thanks @Starhappysh.</li>
<li>Exec approvals/channels: decouple initiating-surface approval availability from native delivery enablement so Telegram, Slack, and Discord still expose approvals when approvers exist and native target routing is configured separately. (#59776) Thanks @joelnishanth.</li>
</ul>
<h3>Changes</h3>
<ul>
<li>macOS/Voice Wake: add the Voice Wake option to trigger Talk Mode. (#58490) Thanks @SmoothExec.</li>
<li>Tasks/chat: add <code>/tasks</code> as a chat-native background task board for the current session, with recent task details and agent-local fallback counts when no linked tasks are visible. Related #54226. Thanks @vincentkoc.</li>
<li>Web search/SearXNG: add the bundled SearXNG provider plugin for <code>web_search</code> with configurable host support. (#57317) Thanks @cgdusek.</li>
<li>Telegram/errors: add configurable <code>errorPolicy</code> and <code>errorCooldownMs</code> controls so Telegram can suppress repeated delivery errors per account, chat, and topic without muting distinct failures. (#51914) Thanks @chinar-amrutkar</li>
<li>Gateway/webchat: make <code>chat.history</code> text truncation configurable with <code>gateway.webchat.chatHistoryMaxChars</code> and per-request <code>maxChars</code>, while preserving silent-reply filtering and existing default payload limits. (#58900)</li>
<li>Amazon Bedrock/Guardrails: add Bedrock Guardrails support to the bundled provider. (#58588) Thanks @MikeORed.</li>
<li>ZAI/models: add <code>glm-5.1</code> and <code>glm-5v-turbo</code> to the bundled Z.AI provider catalog. (#58793) Thanks @tomsun28</li>
<li>Agents/default params: add <code>agents.defaults.params</code> for global default provider parameters. (#58548) Thanks @lpender.</li>
<li>Agents/failover: cap prompt-side and assistant-side same-provider auth-profile retries for rate-limit failures before cross-provider model fallback, add the <code>auth.cooldowns.rateLimitedProfileRotations</code> knob, and document the new fallback behavior. (#58707) Thanks @Forgely3D</li>
<li>Agents/compaction: resolve <code>agents.defaults.compaction.model</code> consistently for manual <code>/compact</code> and other context-engine compaction paths, so engine-owned compaction uses the configured override model across runtime entrypoints. (#56710) Thanks @oliviareid-svg</li>
<li>Cron/tools allowlist: add <code>openclaw cron --tools</code> for per-job tool allowlists. (#58504) Thanks @andyk-ms.</li>
</ul>
<h3>Fixes</h3>
<ul>
<li>Chat/error replies: stop leaking raw provider/runtime failures into external chat channels, return a friendly retry message instead, and add a specific <code>/new</code> hint for Bedrock toolResult/toolUse session mismatches. (#58831) Thanks @ImLukeF.</li>
<li>Sessions/model switching: keep <code>/model</code> changes queued behind busy runs instead of interrupting the active turn, and retarget queued followups so later work picks up the new model as soon as the current turn finishes.</li>
<li>Web UI/OpenResponses: preserve rewritten stream snapshots in webchat and keep OpenResponses final streamed text aligned when models rewind earlier output. (#58641) Thanks @neeravmakwana</li>
<li>Discord/inbound media: pass Discord attachment and sticker downloads through the shared idle-timeout and worker-abort path so slow or stuck inbound media fetches stop hanging message processing. (#58593) Thanks @aquaright1</li>
<li>Telegram/retries: keep non-idempotent sends on the strict safe-send path, retry wrapped pre-connect failures, and preserve <code>429</code> / <code>retry_after</code> backoff for safe delivery retries. (#51895) Thanks @chinar-amrutkar</li>
<li>Telegram/exec approvals: route topic-aware exec approval followups through Telegram-owned threading and approval-target parsing, so forum-topic approvals stay in the originating topic instead of falling back to the root chat. (#58783)</li>
<li>Telegram/local Bot API: preserve media MIME types for absolute-path downloads so local audio files still trigger transcription and other MIME-based handling. (#54603) Thanks @jzakirov</li>
<li>Channels/WhatsApp: pass inbound message timestamp to model context so the AI can see when WhatsApp messages were sent. (#58590) Thanks @Maninae</li>
<li>QQBot/voice: lazy-load <code>silk-wasm</code> in <code>audio-convert.ts</code> so qqbot still starts when the optional voice dependency is missing, while voice encode/decode degrades gracefully instead of crashing at module load time. (#58829) Thanks @WideLee.</li>
</ul>
<p><a href="https://github.com/openclaw/openclaw/blob/main/CHANGELOG.md">View full changelog</a></p>
]]></description>
<enclosure url="https://github.com/openclaw/openclaw/releases/download/v2026.4.2/OpenClaw-2026.4.2.zip" length="25843797" type="application/octet-stream" sparkle:edSignature="bNNXr4BJEU8W7ghXOujLJTYHZL2PL/r/p4llGBw0BFL+46mJ2Bir+IK8XQaCj5zp+O5JSuh5mY+Y/Nrq6TR7Cg=="/>
</item>
</channel>
</rss>
+2 -2
View File
@@ -65,8 +65,8 @@ android {
applicationId = "ai.openclaw.app"
minSdk = 31
targetSdk = 36
versionCode = 2026040801
versionName = "2026.4.8"
versionCode = 2026040901
versionName = "2026.4.9"
ndk {
// Support all major ABIs — native libs are tiny (~47 KB per ABI)
abiFilters += listOf("armeabi-v7a", "arm64-v8a", "x86", "x86_64")
@@ -204,6 +204,10 @@ class MainViewModel(app: Application) : AndroidViewModel(app) {
prefs.setGatewayPassword(value)
}
fun resetGatewaySetupAuth() {
ensureRuntime().resetGatewaySetupAuth()
}
fun setOnboardingCompleted(value: Boolean) {
if (value) {
ensureRuntime()
@@ -556,6 +556,12 @@ class NodeRuntime(
fun setGatewayToken(value: String) = prefs.setGatewayToken(value)
fun setGatewayBootstrapToken(value: String) = prefs.setGatewayBootstrapToken(value)
fun setGatewayPassword(value: String) = prefs.setGatewayPassword(value)
fun resetGatewaySetupAuth() {
prefs.clearGatewaySetupAuth()
val deviceId = identityStore.loadOrCreate().deviceId
deviceAuthStore.clearToken(deviceId, "node")
deviceAuthStore.clearToken(deviceId, "operator")
}
fun setOnboardingCompleted(value: Boolean) = prefs.setOnboardingCompleted(value)
val lastDiscoveredStableId: StateFlow<String> = prefs.lastDiscoveredStableId
val canvasDebugStatusEnabled: StateFlow<Boolean> = prefs.canvasDebugStatusEnabled
@@ -1325,8 +1331,6 @@ internal fun resolveOperatorSessionConnectAuth(
val storedToken = storedOperatorToken?.trim()?.takeIf { it.isNotEmpty() }
if (storedToken != null) {
// Bootstrap can seed the operator token, but operator should reconnect
// through the stored device-token path rather than bootstrap auth itself.
return NodeRuntime.GatewayConnectAuth(
token = null,
bootstrapToken = null,
@@ -1334,6 +1338,15 @@ internal fun resolveOperatorSessionConnectAuth(
)
}
val explicitBootstrapToken = auth.bootstrapToken?.trim()?.takeIf { it.isNotEmpty() }
if (explicitBootstrapToken != null) {
return NodeRuntime.GatewayConnectAuth(
token = null,
bootstrapToken = explicitBootstrapToken,
password = null,
)
}
return null
}
@@ -402,6 +402,18 @@ class SecurePrefs(
securePrefs.edit { putString(key, password.trim()) }
}
fun clearGatewaySetupAuth() {
val instanceId = _instanceId.value
securePrefs.edit {
remove("gateway.manual.token")
remove("gateway.token.$instanceId")
remove("gateway.bootstrapToken.$instanceId")
remove("gateway.password.$instanceId")
}
_gatewayToken.value = ""
_gatewayBootstrapToken.value = ""
}
fun loadGatewayTlsFingerprint(stableId: String): String? {
val key = "gateway.tls.$stableId"
return plainPrefs.getString(key, null)?.trim()?.takeIf { it.isNotEmpty() }
@@ -38,6 +38,7 @@ import androidx.compose.material3.SwitchDefaults
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
@@ -140,8 +141,13 @@ fun ConnectTabScreen(viewModel: MainViewModel) {
}
val showDiagnostics = !isConnected && gatewayStatusHasDiagnostics(statusText)
val pairingRequired = !isConnected && gatewayStatusLooksLikePairing(statusText)
val statusLabel = gatewayStatusForDisplay(statusText)
PairingAutoRetryEffect(enabled = pairingRequired) {
viewModel.refreshGatewayConnection()
}
Column(
modifier = Modifier.verticalScroll(rememberScrollState()).padding(horizontal = 20.dp, vertical = 16.dp),
verticalArrangement = Arrangement.spacedBy(14.dp),
@@ -278,6 +284,9 @@ fun ConnectTabScreen(viewModel: MainViewModel) {
}
validationText = null
if (inputMode == ConnectInputMode.SetupCode) {
viewModel.resetGatewaySetupAuth()
}
viewModel.setManualEnabled(true)
viewModel.setManualHost(config.host)
viewModel.setManualPort(config.port)
@@ -319,8 +328,17 @@ fun ConnectTabScreen(viewModel: MainViewModel) {
modifier = Modifier.fillMaxWidth().padding(horizontal = 14.dp, vertical = 14.dp),
verticalArrangement = Arrangement.spacedBy(10.dp),
) {
Text("Last gateway error", style = mobileHeadline, color = mobileWarning)
Text(if (pairingRequired) "Pairing required" else "Last gateway error", style = mobileHeadline, color = mobileWarning)
Text(statusLabel, style = mobileBody.copy(fontFamily = FontFamily.Monospace), color = mobileText)
if (pairingRequired) {
Text(
"Approve this phone on the gateway. OpenClaw retries automatically while this screen stays open.",
style = mobileCallout,
color = mobileTextSecondary,
)
CommandBlock("openclaw devices list")
CommandBlock("openclaw devices approve <requestId>")
}
Text("OpenClaw Android ${openClawAndroidVersionLabel()}", style = mobileCaption1, color = mobileTextSecondary)
Button(
onClick = {
@@ -464,14 +482,18 @@ fun ConnectTabScreen(viewModel: MainViewModel) {
colors = outlinedColors(),
)
Text("Port", style = mobileCaption1.copy(fontWeight = FontWeight.SemiBold), color = mobileTextSecondary)
Text(
if (manualTlsInput) "Port (optional, defaults to 443)" else "Port",
style = mobileCaption1.copy(fontWeight = FontWeight.SemiBold),
color = mobileTextSecondary,
)
OutlinedTextField(
value = manualPortInput,
onValueChange = {
manualPortInput = it
validationText = null
},
placeholder = { Text("18789", style = mobileBody, color = mobileTextTertiary) },
placeholder = { Text(if (manualTlsInput) "443" else "18789", style = mobileBody, color = mobileTextTertiary) },
modifier = Modifier.fillMaxWidth(),
singleLine = true,
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
@@ -235,15 +235,21 @@ internal fun gatewayEndpointValidationMessage(
when (source) {
GatewayEndpointInputSource.SETUP_CODE -> "Setup code has invalid gateway URL."
GatewayEndpointInputSource.QR_SCAN -> "QR code did not contain a valid setup code."
GatewayEndpointInputSource.MANUAL -> "Enter a valid manual host and port to connect."
GatewayEndpointInputSource.MANUAL -> "Enter a valid manual endpoint to connect."
}
}
}
internal fun composeGatewayManualUrl(hostInput: String, portInput: String, tls: Boolean): String? {
val host = hostInput.trim()
val port = portInput.trim().toIntOrNull() ?: return null
if (host.isEmpty() || port !in 1..65535) return null
if (host.isEmpty()) return null
val portTrimmed = portInput.trim()
val port = if (portTrimmed.isEmpty()) {
if (tls) 443 else return null
} else {
portTrimmed.toIntOrNull() ?: return null
}
if (port !in 1..65535) return null
val scheme = if (tls) "https" else "http"
return "$scheme://$host:$port"
}
@@ -0,0 +1,45 @@
package ai.openclaw.app.ui
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleEventObserver
import androidx.lifecycle.compose.LocalLifecycleOwner
import kotlinx.coroutines.delay
internal const val PAIRING_AUTO_RETRY_MS = 6_000L
@Composable
internal fun PairingAutoRetryEffect(enabled: Boolean, onRetry: () -> Unit) {
val lifecycleOwner = LocalLifecycleOwner.current
var lifecycleStarted by
remember(lifecycleOwner) {
mutableStateOf(lifecycleOwner.lifecycle.currentState.isAtLeast(Lifecycle.State.STARTED))
}
DisposableEffect(lifecycleOwner) {
val observer =
LifecycleEventObserver { _, _ ->
lifecycleStarted = lifecycleOwner.lifecycle.currentState.isAtLeast(Lifecycle.State.STARTED)
}
lifecycleOwner.lifecycle.addObserver(observer)
onDispose {
lifecycleOwner.lifecycle.removeObserver(observer)
}
}
LaunchedEffect(enabled, lifecycleStarted) {
if (!enabled || !lifecycleStarted) {
return@LaunchedEffect
}
while (true) {
delay(PAIRING_AUTO_RETRY_MS)
onRetry()
}
}
}
@@ -576,6 +576,7 @@ fun OnboardingFlow(viewModel: MainViewModel, modifier: Modifier = Modifier) {
return@addOnSuccessListener
}
setupCode = scannedSetupCode.setupCode
viewModel.resetGatewaySetupAuth()
gatewayInputMode = GatewayInputMode.SetupCode
gatewayError = null
attemptedConnect = false
@@ -737,6 +738,7 @@ fun OnboardingFlow(viewModel: MainViewModel, modifier: Modifier = Modifier) {
)
OnboardingStep.FinalCheck ->
FinalStep(
viewModel = viewModel,
parsedGateway = parseGatewayEndpoint(gatewayUrl),
statusText = statusText,
isConnected = canFinishOnboarding,
@@ -812,6 +814,7 @@ fun OnboardingFlow(viewModel: MainViewModel, modifier: Modifier = Modifier) {
)
return@Button
}
viewModel.resetGatewaySetupAuth()
gatewayUrl = parsedSetup.url
viewModel.setGatewayBootstrapToken(parsedSetup.bootstrapToken.orEmpty())
val sharedToken = parsedSetup.token.orEmpty().trim()
@@ -887,6 +890,12 @@ fun OnboardingFlow(viewModel: MainViewModel, modifier: Modifier = Modifier) {
}
val token = persistedGatewayToken.trim()
val password = gatewayPassword.trim()
val bootstrapToken =
if (gatewayInputMode == GatewayInputMode.SetupCode) {
decodeGatewaySetupCode(setupCode)?.bootstrapToken?.trim()?.ifEmpty { null }
} else {
null
}
attemptedConnect = true
viewModel.setManualEnabled(true)
viewModel.setManualHost(parsed.config.host)
@@ -894,6 +903,9 @@ fun OnboardingFlow(viewModel: MainViewModel, modifier: Modifier = Modifier) {
viewModel.setManualTls(parsed.config.tls)
if (gatewayInputMode == GatewayInputMode.Manual) {
viewModel.setGatewayBootstrapToken("")
} else {
viewModel.resetGatewaySetupAuth()
viewModel.setGatewayBootstrapToken(bootstrapToken.orEmpty())
}
if (token.isNotEmpty()) {
viewModel.setGatewayToken(token)
@@ -904,12 +916,7 @@ fun OnboardingFlow(viewModel: MainViewModel, modifier: Modifier = Modifier) {
viewModel.connect(
GatewayEndpoint.manual(host = parsed.config.host, port = parsed.config.port),
token = token.ifEmpty { null },
bootstrapToken =
if (gatewayInputMode == GatewayInputMode.SetupCode) {
decodeGatewaySetupCode(setupCode)?.bootstrapToken?.trim()?.ifEmpty { null }
} else {
null
},
bootstrapToken = bootstrapToken,
password = password.ifEmpty { null },
)
},
@@ -1148,11 +1155,15 @@ private fun GatewayStep(
onboardingTextFieldColors(),
)
Text("PORT", style = onboardingCaption1Style.copy(letterSpacing = 0.9.sp), color = onboardingTextSecondary)
Text(
if (manualTls) "PORT (optional, defaults to 443)" else "PORT",
style = onboardingCaption1Style.copy(letterSpacing = 0.9.sp),
color = onboardingTextSecondary,
)
OutlinedTextField(
value = manualPort,
onValueChange = onManualPortChange,
placeholder = { Text("18789", color = onboardingTextTertiary, style = onboardingBodyStyle) },
placeholder = { Text(if (manualTls) "443" else "18789", color = onboardingTextTertiary, style = onboardingBodyStyle) },
modifier = Modifier.fillMaxWidth(),
singleLine = true,
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Number),
@@ -1562,6 +1573,7 @@ private fun PermissionToggleRow(
@Composable
private fun FinalStep(
viewModel: MainViewModel,
parsedGateway: GatewayEndpointConfig?,
statusText: String,
isConnected: Boolean,
@@ -1577,6 +1589,10 @@ private fun FinalStep(
val showDiagnostics = gatewayStatusHasDiagnostics(statusText)
val pairingRequired = gatewayStatusLooksLikePairing(statusText)
PairingAutoRetryEffect(enabled = pairingRequired && attemptedConnect) {
viewModel.refreshGatewayConnection()
}
Column(verticalArrangement = Arrangement.spacedBy(10.dp)) {
Text("Review", style = onboardingTitle1Style, color = onboardingText)
@@ -1757,7 +1773,11 @@ private fun FinalStep(
if (pairingRequired) {
CommandBlock("openclaw devices list")
CommandBlock("openclaw devices approve <requestId>")
Text("Then tap Connect again.", style = onboardingCalloutStyle, color = onboardingTextSecondary)
Text(
"OpenClaw retries automatically while this screen stays open.",
style = onboardingCalloutStyle,
color = onboardingTextSecondary,
)
}
}
}
@@ -1,6 +1,8 @@
package ai.openclaw.app
import ai.openclaw.app.gateway.GatewayEndpoint
import ai.openclaw.app.gateway.DeviceAuthStore
import ai.openclaw.app.gateway.DeviceIdentityStore
import ai.openclaw.app.gateway.GatewaySession
import ai.openclaw.app.gateway.GatewayTlsProbeFailure
import ai.openclaw.app.gateway.GatewayTlsProbeResult
@@ -21,14 +23,14 @@ import java.util.UUID
@Config(sdk = [34])
class GatewayBootstrapAuthTest {
@Test
fun skipsOperatorSessionWhenOnlyBootstrapAuthExists() {
assertFalse(
fun connectsOperatorSessionWhenOnlyBootstrapAuthExists() {
assertTrue(
shouldConnectOperatorSession(
NodeRuntime.GatewayConnectAuth(token = "", bootstrapToken = "bootstrap-1", password = ""),
storedOperatorToken = "",
),
)
assertFalse(
assertTrue(
shouldConnectOperatorSession(
NodeRuntime.GatewayConnectAuth(token = null, bootstrapToken = "bootstrap-1", password = null),
storedOperatorToken = null,
@@ -75,6 +77,20 @@ class GatewayBootstrapAuthTest {
assertEquals(NodeRuntime.GatewayConnectAuth(token = null, bootstrapToken = null, password = null), resolved)
}
@Test
fun resolveOperatorSessionConnectAuthUsesBootstrapWhenNoStoredOperatorTokenExists() {
val resolved =
resolveOperatorSessionConnectAuth(
auth = NodeRuntime.GatewayConnectAuth(token = null, bootstrapToken = "bootstrap-1", password = null),
storedOperatorToken = null,
)
assertEquals(
NodeRuntime.GatewayConnectAuth(token = null, bootstrapToken = "bootstrap-1", password = null),
resolved,
)
}
@Test
fun resolveOperatorSessionConnectAuthPrefersExplicitSharedAuth() {
val resolved =
@@ -152,7 +168,7 @@ class GatewayBootstrapAuthTest {
assertEquals("fp-1", prefs.loadGatewayTlsFingerprint(endpoint.stableId))
assertEquals("setup-bootstrap-token", desiredBootstrapToken(runtime, "nodeSession"))
assertNull(desiredBootstrapToken(runtime, "operatorSession"))
assertEquals("setup-bootstrap-token", desiredBootstrapToken(runtime, "operatorSession"))
}
@Test
@@ -178,6 +194,33 @@ class GatewayBootstrapAuthTest {
assertNull(runtime.pendingGatewayTrust.value)
}
@Test
fun resetGatewaySetupAuth_clearsStoredGatewayAndDeviceTokens() {
val app = RuntimeEnvironment.getApplication()
val securePrefs =
app.getSharedPreferences(
"openclaw.node.secure.test.${UUID.randomUUID()}",
android.content.Context.MODE_PRIVATE,
)
val prefs = SecurePrefs(app, securePrefsOverride = securePrefs)
val runtime = NodeRuntime(app, prefs)
val deviceId = DeviceIdentityStore(app).loadOrCreate().deviceId
val authStore = DeviceAuthStore(prefs)
prefs.setGatewayToken("stale-shared-token")
prefs.setGatewayBootstrapToken("stale-bootstrap-token")
prefs.setGatewayPassword("stale-password")
authStore.saveToken(deviceId, "node", "stale-node-token")
authStore.saveToken(deviceId, "operator", "stale-operator-token")
runtime.resetGatewaySetupAuth()
assertNull(prefs.loadGatewayToken())
assertNull(prefs.loadGatewayBootstrapToken())
assertNull(prefs.loadGatewayPassword())
assertNull(authStore.loadToken(deviceId, "node"))
assertNull(authStore.loadToken(deviceId, "operator"))
}
private fun waitForGatewayTrustPrompt(runtime: NodeRuntime): NodeRuntime.GatewayTrustPrompt {
repeat(50) {
runtime.pendingGatewayTrust.value?.let { return it }
@@ -2,6 +2,7 @@ package ai.openclaw.app
import android.content.Context
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNull
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
@@ -35,4 +36,24 @@ class SecurePrefsTest {
assertEquals("bootstrap-token", prefs.loadGatewayBootstrapToken())
assertEquals("bootstrap-token", prefs.gatewayBootstrapToken.value)
}
@Test
fun clearGatewaySetupAuth_removesStoredGatewayAuth() {
val context = RuntimeEnvironment.getApplication()
val securePrefs = context.getSharedPreferences("openclaw.node.secure.test.clear", Context.MODE_PRIVATE)
securePrefs.edit().clear().commit()
val prefs = SecurePrefs(context, securePrefsOverride = securePrefs)
prefs.setGatewayToken("shared-token")
prefs.setGatewayBootstrapToken("bootstrap-token")
prefs.setGatewayPassword("password-token")
prefs.clearGatewaySetupAuth()
assertEquals("", prefs.gatewayToken.value)
assertEquals("", prefs.gatewayBootstrapToken.value)
assertNull(prefs.loadGatewayToken())
assertNull(prefs.loadGatewayBootstrapToken())
assertNull(prefs.loadGatewayPassword())
}
}
@@ -464,6 +464,42 @@ class GatewayConfigResolverTest {
assertEquals(false, resolved?.tls)
}
@Test
fun composeGatewayManualUrlDefaultsPortTo443WhenTlsAndPortBlank() {
val url = composeGatewayManualUrl("mydevice.tail1234.ts.net", "", tls = true)
assertEquals("https://mydevice.tail1234.ts.net:443", url)
}
@Test
fun composeGatewayManualUrlRejectsBlankPortWhenTlsIsOff() {
val url = composeGatewayManualUrl("127.0.0.1", "", tls = false)
assertNull(url)
}
@Test
fun resolveGatewayConnectConfigManualAcceptsTailscaleHostWithoutPort() {
val resolved =
resolveGatewayConnectConfig(
useSetupCode = false,
setupCode = "",
savedManualHost = "",
savedManualPort = "",
savedManualTls = true,
manualHostInput = "mydevice.tail1234.ts.net",
manualPortInput = "",
manualTlsInput = true,
fallbackBootstrapToken = "",
fallbackToken = "",
fallbackPassword = "",
)
assertEquals("mydevice.tail1234.ts.net", resolved?.host)
assertEquals(443, resolved?.port)
assertEquals(true, resolved?.tls)
}
private fun encodeSetupCode(payloadJson: String): String {
return Base64.getUrlEncoder().withoutPadding().encodeToString(payloadJson.toByteArray(Charsets.UTF_8))
}
+13
View File
@@ -0,0 +1,13 @@
# OpenClaw iOS Changelog
## Unreleased
### Added
### Changed
### Fixed
## 2026.4.6 - 2026-04-06
First App Store release of OpenClaw for iPhone. Pair with your OpenClaw Gateway to use chat, voice, sharing, and device actions from iOS.
+5 -4
View File
@@ -1,8 +1,9 @@
// Shared iOS version defaults.
// Generated overrides live in build/Version.xcconfig (git-ignored).
// Source of truth: apps/ios/version.json
// Generated by scripts/ios-sync-versioning.ts.
OPENCLAW_GATEWAY_VERSION = 2026.4.8
OPENCLAW_MARKETING_VERSION = 2026.4.8
OPENCLAW_BUILD_VERSION = 2026040801
OPENCLAW_IOS_VERSION = 2026.4.6
OPENCLAW_MARKETING_VERSION = 2026.4.6
OPENCLAW_BUILD_VERSION = 1
#include? "../build/Version.xcconfig"
+62 -9
View File
@@ -64,10 +64,14 @@ Release behavior:
- Beta release uses canonical `ai.openclaw.client*` bundle IDs through a temporary generated xcconfig in `apps/ios/build/BetaRelease.xcconfig`.
- Beta release also switches the app to `OpenClawPushTransport=relay`, `OpenClawPushDistribution=official`, and `OpenClawPushAPNsEnvironment=production`.
- The beta flow does not modify `apps/ios/.local-signing.xcconfig` or `apps/ios/LocalSigning.xcconfig`.
- Root `package.json.version` is the only version source for iOS.
- A root version like `2026.4.1-beta.1` becomes:
- `CFBundleShortVersionString = 2026.4.1`
- `CFBundleVersion = next TestFlight build number for 2026.4.1`
- `apps/ios/version.json` is the pinned iOS release version source.
- `apps/ios/CHANGELOG.md` is the iOS-only changelog and release-note source.
- The pinned iOS version must use CalVer like `2026.4.10`.
- That pinned value becomes:
- `CFBundleShortVersionString = 2026.4.10`
- `CFBundleVersion = next TestFlight build number for 2026.4.10`
- Changing the root gateway version does not change the iOS app version until you explicitly pin from the gateway.
- See `apps/ios/VERSIONING.md` for the full workflow.
Required env for beta builds:
@@ -120,25 +124,74 @@ This should create `apps/ios/fastlane/.env` with the non-secret ASC variables wh
export OPENCLAW_PUSH_RELAY_BASE_URL=https://relay.example.com
```
4. Upload the beta:
4. If you are starting a brand-new production release train, pin iOS to the current gateway version first:
```bash
pnpm ios:version:pin -- --from-gateway
```
5. Upload the beta:
```bash
pnpm ios:beta
```
5. Expected behavior:
- Fastlane reads `package.json.version`
6. Expected behavior:
- Fastlane reads `apps/ios/version.json`
- verifies synced iOS versioning artifacts
- resolves the next TestFlight build number for that short version
- generates `apps/ios/build/BetaRelease.xcconfig`
- archives `OpenClaw`
- uploads the IPA to TestFlight
6. Expected outputs after a successful run:
7. Expected outputs after a successful run:
- `apps/ios/build/beta/OpenClaw-<version>.ipa`
- `apps/ios/build/beta/OpenClaw-<version>.app.dSYM.zip`
- Fastlane log line like `Uploaded iOS beta: version=<version> short=<short> build=<build>`
7. If this is a fresh clone on a maintainer machine that already works elsewhere, it is OK to copy the non-secret `apps/ios/fastlane/.env` from another trusted local clone on the same Mac. The Keychain-backed private key remains machine-local and is not stored in the repo.
8. If this is a fresh clone on a maintainer machine that already works elsewhere, it is OK to copy the non-secret `apps/ios/fastlane/.env` from another trusted local clone on the same Mac. The Keychain-backed private key remains machine-local and is not stored in the repo.
## iOS Versioning Workflow
- Pinned iOS release version: `apps/ios/version.json`
- iOS-only changelog: `apps/ios/CHANGELOG.md`
- Generated checked-in artifacts:
- `apps/ios/Config/Version.xcconfig`
- `apps/ios/fastlane/metadata/en-US/release_notes.txt`
- Useful commands:
```bash
pnpm ios:version
pnpm ios:version:check
pnpm ios:version:sync
pnpm ios:version:pin -- --from-gateway
pnpm ios:version:pin -- --version 2026.4.10
```
Recommended flow:
### TestFlight iteration on an existing train
1. Keep `apps/ios/version.json` pinned to the current train version.
2. Update `apps/ios/CHANGELOG.md`, usually under `## Unreleased` while iterating.
3. Run `pnpm ios:version:sync` after changelog changes.
4. Upload more TestFlight builds with `pnpm ios:beta`.
5. Let Fastlane bump only the numeric build number.
### Starting the next production release train
1. Pin iOS to the current gateway version:
```bash
pnpm ios:version:pin -- --from-gateway
```
2. Update `apps/ios/CHANGELOG.md` for the new release as needed.
3. Run `pnpm ios:version:sync`.
4. Submit the first TestFlight build for that newly pinned version.
5. Keep iterating on that same version until the release candidate is ready.
See `apps/ios/VERSIONING.md` for the detailed spec.
## APNs Expectations For Local/Manual Builds
@@ -50,9 +50,11 @@ enum DeviceInfoHelper {
return trimmed.isEmpty ? "unknown" : trimmed
}
/// App marketing version only, e.g. "2026.2.0" or "dev".
/// Canonical app version when present, otherwise the Apple marketing version.
static func appVersion() -> String {
Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "dev"
(Bundle.main.infoDictionary?["OpenClawCanonicalVersion"] as? String)
?? (Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String)
?? "dev"
}
/// App build string, e.g. "123" or "".
+2
View File
@@ -24,6 +24,8 @@
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(OPENCLAW_MARKETING_VERSION)</string>
<key>OpenClawCanonicalVersion</key>
<string>$(OPENCLAW_IOS_VERSION)</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
+150
View File
@@ -0,0 +1,150 @@
# OpenClaw iOS Versioning
OpenClaw iOS uses a **pinned CalVer release version** instead of reading the current gateway version automatically on every build.
## Goals
- keep TestFlight submissions on one stable app version while iterating
- change only `CFBundleVersion` during normal TestFlight iteration
- promote the iOS release version to the current gateway version only when a maintainer chooses to do that
- keep Apple bundle fields valid for App Store Connect
- generate App Store release notes from an iOS-owned changelog
## Version model
The pinned iOS release version lives in `apps/ios/version.json`.
Supported pinned format:
- `YYYY.M.D`
Examples:
- `2026.4.6`
- `2026.4.10`
The root gateway version in `package.json` may still be one of:
- `YYYY.M.D`
- `YYYY.M.D-beta.N`
- `YYYY.M.D-N`
When you pin iOS from the gateway version, the iOS tooling strips the gateway suffix and keeps only the base CalVer.
Examples:
- gateway `2026.4.10` -> iOS `2026.4.10`
- gateway `2026.4.10-beta.3` -> iOS `2026.4.10`
- gateway `2026.4.10-2` -> iOS `2026.4.10`
## Apple bundle mapping
Pinned iOS version `2026.4.10` maps to:
- `CFBundleShortVersionString = 2026.4.10`
- `CFBundleVersion = numeric build number only`
`CFBundleShortVersionString` stays fixed for a TestFlight train until you intentionally pin a newer iOS release version.
## Source of truth and generated files
### Source files
- `apps/ios/version.json`
- pinned iOS release version
- `apps/ios/CHANGELOG.md`
- iOS-only changelog and release-note source
- `apps/ios/VERSIONING.md`
- workflow and constraints
### Generated or derived files
- `apps/ios/Config/Version.xcconfig`
- checked-in defaults derived from `apps/ios/version.json`
- `apps/ios/fastlane/metadata/en-US/release_notes.txt`
- generated from `apps/ios/CHANGELOG.md`
- `apps/ios/build/Version.xcconfig`
- local gitignored build override generated per build or beta prep
## Tooling surfaces
### Version parsing and sync tooling
- `scripts/lib/ios-version.ts`
- validates pinned iOS CalVer
- normalizes gateway version -> pinned iOS CalVer
- renders checked-in xcconfig and release notes
- `scripts/ios-version.ts`
- CLI for JSON, shell, or single-field version reads
- `scripts/ios-sync-versioning.ts`
- syncs checked-in derived files from the pinned iOS version
- `scripts/ios-pin-version.ts`
- explicitly pins iOS to a chosen release version or the current gateway version
### Build and beta flow
- `scripts/ios-write-version-xcconfig.sh`
- reads the pinned iOS version
- writes the local numeric build override file in `apps/ios/build/Version.xcconfig`
- `scripts/ios-beta-prepare.sh`
- prepares beta signing and bundle settings against the pinned iOS version
- `apps/ios/fastlane/Fastfile`
- resolves version metadata from the pinned iOS helper
- increments TestFlight build numbers for the pinned short version
## Release-note resolution order
When generating `apps/ios/fastlane/metadata/en-US/release_notes.txt`, the tooling reads the first available changelog section in this order:
1. exact pinned version, for example `## 2026.4.10`
2. `## Unreleased`
Recommended workflow:
- while iterating on a TestFlight train, keep pending notes under `## Unreleased`
- before the production release, move or copy the final notes under `## <pinned version>` and run sync again
## Common commands
```bash
pnpm ios:version
pnpm ios:version:check
pnpm ios:version:sync
pnpm ios:version:pin -- --from-gateway
pnpm ios:version:pin -- --version 2026.4.10
```
## Normal TestFlight iteration workflow
1. keep `apps/ios/version.json` pinned to the current TestFlight train version
2. update `apps/ios/CHANGELOG.md` under `## Unreleased` while iterating
3. upload more betas with the usual flow
4. let Fastlane increment only `CFBundleVersion`
This keeps the TestFlight version stable while review is in flight.
## New release promotion workflow
When you want the next production iOS release to align with the current gateway release:
1. pin iOS from the root gateway version:
```bash
pnpm ios:version:pin -- --from-gateway
```
2. review the generated changes in:
- `apps/ios/version.json`
- `apps/ios/Config/Version.xcconfig`
- `apps/ios/fastlane/metadata/en-US/release_notes.txt`
3. update `apps/ios/CHANGELOG.md` for the new release if needed
4. run `pnpm ios:version:sync` again if the changelog changed
5. submit the first TestFlight build for that newly pinned version
6. keep iterating only by build number until the release candidate is ready
7. release that reviewed TestFlight build to production
## Important invariant
Fastlane and Xcode should consume only the pinned iOS version from `apps/ios/version.json`.
Changing `package.json.version` alone must not change the iOS app version until a maintainer explicitly runs the pin step.
+49 -21
View File
@@ -95,35 +95,60 @@ def ios_root
File.expand_path("..", __dir__)
end
def normalize_release_version(raw_value)
version = raw_value.to_s.strip.sub(/\Av/, "")
UI.user_error!("Missing root package.json version.") unless env_present?(version)
unless version.match?(/\A\d+\.\d+\.\d+(?:[.-]?beta[.-]\d+)?\z/i)
UI.user_error!("Invalid package.json version '#{raw_value}'. Expected YYYY.M.D or YYYY.M.D-beta.N.")
def read_ios_version_metadata
script_path = File.join(repo_root, "scripts", "ios-version.ts")
stdout, stderr, status = Open3.capture3(
"node",
"--import",
"tsx",
script_path,
"--json",
chdir: repo_root
)
unless status.success?
detail = stderr.to_s.strip
detail = stdout.to_s.strip if detail.empty?
UI.user_error!("Failed to read iOS version metadata: #{detail}")
end
version
end
parsed = JSON.parse(stdout)
version = parsed["canonicalVersion"].to_s.strip
short_version = parsed["marketingVersion"].to_s.strip
if !env_present?(version) || !env_present?(short_version)
UI.user_error!("iOS version helper returned incomplete metadata.")
end
def read_root_package_version
package_json_path = File.join(repo_root, "package.json")
UI.user_error!("Missing package.json at #{package_json_path}.") unless File.exist?(package_json_path)
parsed = JSON.parse(File.read(package_json_path))
normalize_release_version(parsed["version"])
{
short_version: short_version,
version: version
}
rescue JSON::ParserError => e
UI.user_error!("Invalid package.json at #{package_json_path}: #{e.message}")
UI.user_error!("Invalid JSON from iOS version helper: #{e.message}")
end
def short_release_version(version)
normalize_release_version(version).sub(/([.-]?beta[.-]\d+)\z/i, "")
def sync_ios_versioning!
script_path = File.join(repo_root, "scripts", "ios-sync-versioning.ts")
stdout, stderr, status = Open3.capture3(
"node",
"--import",
"tsx",
script_path,
"--check",
chdir: repo_root
)
return if status.success?
detail = stderr.to_s.strip
detail = stdout.to_s.strip if detail.empty?
UI.user_error!("iOS versioning artifacts are stale. Run `pnpm ios:version:sync`.\n#{detail}")
end
def shell_join(parts)
Shellwords.join(parts.compact)
end
def resolve_beta_build_number(api_key:, version:)
def resolve_beta_build_number(api_key:, short_version:)
explicit = ENV["IOS_BETA_BUILD_NUMBER"]
if env_present?(explicit)
UI.user_error!("Invalid IOS_BETA_BUILD_NUMBER '#{explicit}'. Expected digits only.") unless explicit.match?(/\A\d+\z/)
@@ -131,7 +156,6 @@ def resolve_beta_build_number(api_key:, version:)
return explicit
end
short_version = short_release_version(version)
latest_build = latest_testflight_build_number(
api_key: api_key,
app_identifier: BETA_APP_IDENTIFIER,
@@ -244,15 +268,18 @@ platform :ios do
require_api_key = options[:require_api_key] == true
needs_api_key = require_api_key || beta_build_number_needs_asc_auth?
api_key = needs_api_key ? asc_api_key : nil
version = read_root_package_version
build_number = resolve_beta_build_number(api_key: api_key, version: version)
sync_ios_versioning!
version_metadata = read_ios_version_metadata
version = version_metadata[:version]
short_version = version_metadata[:short_version]
build_number = resolve_beta_build_number(api_key: api_key, short_version: short_version)
beta_xcconfig = prepare_beta_release!(version: version, build_number: build_number)
{
api_key: api_key,
beta_xcconfig: beta_xcconfig,
build_number: build_number,
short_version: short_release_version(version),
short_version: short_version,
version: version
}
end
@@ -286,6 +313,7 @@ platform :ios do
desc "Upload App Store metadata (and optionally screenshots)"
lane :metadata do
sync_ios_versioning!
api_key = asc_api_key
clear_empty_env_var("APP_STORE_CONNECT_API_KEY_PATH")
app_identifier = ENV["ASC_APP_IDENTIFIER"]
+17 -5
View File
@@ -109,13 +109,19 @@ cd apps/ios
fastlane ios auth_check
```
4. Set the official/TestFlight relay URL before release:
4. If you are starting a brand-new production release train, pin iOS to the current gateway version:
```bash
pnpm ios:version:pin -- --from-gateway
```
5. Set the official/TestFlight relay URL before release:
```bash
export OPENCLAW_PUSH_RELAY_BASE_URL=https://relay.example.com
```
5. Upload:
6. Upload:
```bash
pnpm ios:beta
@@ -129,9 +135,15 @@ Quick verification after upload:
Versioning rules:
- Root `package.json.version` is the single source of truth for iOS
- Use `YYYY.M.D` for stable versions and `YYYY.M.D-beta.N` for beta versions
- Fastlane stamps `CFBundleShortVersionString` to `YYYY.M.D`
- `apps/ios/version.json` is the pinned iOS release version source
- `apps/ios/CHANGELOG.md` is the iOS-only changelog and release-note source
- Supported pinned iOS versions use CalVer: `YYYY.M.D`
- `pnpm ios:version:pin -- --from-gateway` promotes the current root gateway version into the pinned iOS release version
- Fastlane uses the pinned iOS version only; changing `package.json.version` alone does not change the iOS app version
- Fastlane sets `CFBundleShortVersionString` to the pinned iOS version, for example `2026.4.10`
- Fastlane resolves `CFBundleVersion` as the next integer TestFlight build number for that short version
- Run `pnpm ios:version:sync` after changing `apps/ios/version.json` or `apps/ios/CHANGELOG.md`
- `pnpm ios:version:check` validates that checked-in iOS version artifacts are in sync
- The beta flow regenerates `apps/ios/OpenClaw.xcodeproj` from `apps/ios/project.yml` before archiving
- Local beta signing uses a temporary generated xcconfig and leaves local development signing overrides untouched
- See `apps/ios/VERSIONING.md` for the detailed workflow
+3
View File
@@ -36,6 +36,9 @@ Or set `APP_STORE_CONNECT_API_KEY_PATH`.
## Notes
- Locale files live under `metadata/en-US/`.
- `release_notes.txt` is generated from `apps/ios/CHANGELOG.md`; after changelog updates, run `pnpm ios:version:sync`.
- Release notes resolve from `## <pinned iOS version>` first, then fall back to `## Unreleased` while a TestFlight train is still in progress.
- When starting a new production release train, pin the iOS version first with `pnpm ios:version:pin -- --from-gateway`.
- `privacy_url.txt` is set to `https://openclaw.ai/privacy`.
- If app lookup fails in `deliver`, set one of:
- `ASC_APP_IDENTIFIER` (bundle ID)
+1
View File
@@ -119,6 +119,7 @@ targets:
CFBundleURLSchemes:
- openclaw
CFBundleShortVersionString: "$(OPENCLAW_MARKETING_VERSION)"
OpenClawCanonicalVersion: "$(OPENCLAW_IOS_VERSION)"
CFBundleVersion: "$(OPENCLAW_BUILD_VERSION)"
UILaunchScreen: {}
UIApplicationSceneManifest:
+3
View File
@@ -0,0 +1,3 @@
{
"version": "2026.4.6"
}
@@ -15,9 +15,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2026.4.8</string>
<string>2026.4.9</string>
<key>CFBundleVersion</key>
<string>2026040801</string>
<string>2026040901</string>
<key>CFBundleIconFile</key>
<string>OpenClaw</string>
<key>CFBundleURLTypes</key>
+4 -4
View File
@@ -1,4 +1,4 @@
2cbfd5571e122ea9b9ca6b3e407f63976f630354e7d6544aa0fd0a8e2c391fc9 config-baseline.json
065f474b340fc22b19358cb298131037cbb2a3411ef0b6f765072bbaafedf751 config-baseline.core.json
d22f4414b79ee03d896e58d875c80523bcc12303cbacb1700261e6ec73945187 config-baseline.channel.json
e655872f3712fa34c3dc82f09a994f38aa92f5108b2815498bc7fddac36d8c35 config-baseline.plugin.json
0a75b57f5dbb0bb1488eacb47111ee22ff42dd3747bfe07bb69c9445d5e55c3e config-baseline.json
ff15bb8b4231fc80174249ae89bcb61439d7adda5ee6be95e4d304680253a59f config-baseline.core.json
7f42b22b46c487d64aaac46001ba9d9096cf7bf0b1c263a54d39946303ff5018 config-baseline.channel.json
483d4f3c1d516719870ad6f2aba6779b9950f85471ee77b9994a077a7574a892 config-baseline.plugin.json
@@ -1,2 +1,2 @@
20b57f1d7dd9545d6812b895d896d9441e30867f00598e3eb7cab0ae916eb0f2 plugin-sdk-api-baseline.json
164c2da632598f9d84789926bd6589347420db949da3461096cfb32c82cf47c1 plugin-sdk-api-baseline.jsonl
087dc7fe9759330c953a00130ea20242b3d7f460eaa530d631cfb2a9f96e0370 plugin-sdk-api-baseline.json
a84765a726e0493dc87d2799020fd454407b1fe2c4d3ad69e8c3cc3a0cde834b plugin-sdk-api-baseline.jsonl
+2
View File
@@ -1003,6 +1003,8 @@ Core examples:
- moderation: `timeout`, `kick`, `ban`
- presence: `setPresence`
The `event-create` action accepts an optional `image` parameter (URL or local file path) to set the scheduled event cover image.
Action gates live under `channels.discord.actions.*`.
Default gate behavior:
+86 -124
View File
@@ -8,7 +8,7 @@ title: "Matrix"
# Matrix
Matrix is the Matrix bundled channel plugin for OpenClaw.
Matrix is a bundled channel plugin for OpenClaw.
It uses the official `matrix-js-sdk` and supports DMs, rooms, threads, media, reactions, polls, location, and E2EE.
## Bundled plugin
@@ -53,27 +53,23 @@ openclaw channels add
openclaw configure --section channels
```
What the Matrix wizard actually asks for:
The Matrix wizard asks for:
- homeserver URL
- auth method: access token or password
- user ID only when you choose password auth
- user ID (password auth only)
- optional device name
- whether to enable E2EE
- whether to configure Matrix room access now
- whether to configure Matrix invite auto-join now
- when invite auto-join is enabled, whether it should be `allowlist`, `always`, or `off`
- whether to configure room access and invite auto-join
Wizard behavior that matters:
Key wizard behaviors:
- If Matrix auth env vars already exist for the selected account, and that account does not already have auth saved in config, the wizard offers an env shortcut so setup can keep auth in env vars instead of copying secrets into config.
- When you add another Matrix account interactively, the entered account name is normalized into the account ID used in config and env vars. For example, `Ops Bot` becomes `ops-bot`.
- DM allowlist prompts accept full `@user:server` values immediately. Display names only work when live directory lookup finds one exact match; otherwise the wizard asks you to retry with a full Matrix ID.
- Room allowlist prompts accept room IDs and aliases directly. They can also resolve joined-room names live, but unresolved names are only kept as typed during setup and are ignored later by runtime allowlist resolution. Prefer `!room:server` or `#alias:server`.
- The wizard now shows an explicit warning before the invite auto-join step because `channels.matrix.autoJoin` defaults to `off`; agents will not join invited rooms or fresh DM-style invites unless you set it.
- If Matrix auth env vars already exist and that account does not already have auth saved in config, the wizard offers an env shortcut to keep auth in env vars.
- Account names are normalized to the account ID. For example, `Ops Bot` becomes `ops-bot`.
- DM allowlist entries accept `@user:server` directly; display names only work when live directory lookup finds one exact match.
- Room allowlist entries accept room IDs and aliases directly. Prefer `!room:server` or `#alias:server`; unresolved names are ignored at runtime by allowlist resolution.
- In invite auto-join allowlist mode, use only stable invite targets: `!roomId:server`, `#alias:server`, or `*`. Plain room names are rejected.
- Runtime room/session identity uses the stable Matrix room ID. Room-declared aliases are only used as lookup inputs, not as the long-term session key or stable group identity.
- To resolve room names before saving them, use `openclaw channels resolve --channel matrix "Project Room"`.
- To resolve room names before saving, use `openclaw channels resolve --channel matrix "Project Room"`.
<Warning>
`channels.matrix.autoJoin` defaults to `off`.
@@ -220,12 +216,9 @@ This is a practical baseline config with DM pairing, room allowlist, and E2EE en
}
```
`autoJoin` applies to Matrix invites in general, not only room/group invites.
That includes fresh DM-style invites. At invite time, OpenClaw does not reliably know whether the
invited room will end up being treated as a DM or a group, so all invites go through the same
`autoJoin` decision first. `dm.policy` still applies after the bot has joined and the room is
classified as a DM, so `autoJoin` controls join behavior while `dm.policy` controls reply/access
behavior.
`autoJoin` applies to all Matrix invites, including DM-style invites. OpenClaw cannot reliably
classify an invited room as a DM or group at invite time, so all invites go through `autoJoin`
first. `dm.policy` applies after the bot has joined and the room is classified as a DM.
## Streaming previews
@@ -420,11 +413,7 @@ For Tuwunel, use the same setup flow and push-rule API call shown above:
- If normal Matrix notifications already work for that user, the user token + `pushrules` call above is the main setup step.
- If notifications seem to disappear while the user is active on another device, check whether `suppress_push_when_active` is enabled. Tuwunel added this option in Tuwunel 1.4.2 on September 12, 2025, and it can intentionally suppress pushes to other devices while one device is active.
## Encryption and verification
In encrypted (E2EE) rooms, outbound image events use `thumbnail_file` so image previews are encrypted alongside the full attachment. Unencrypted rooms still use plain `thumbnail_url`. No configuration is needed — the plugin detects E2EE state automatically.
### Bot to bot rooms
## Bot-to-bot rooms
By default, Matrix messages from other configured OpenClaw Matrix accounts are ignored.
@@ -453,6 +442,10 @@ Use `allowBots` when you intentionally want inter-agent Matrix traffic:
Use strict room allowlists and mention requirements when enabling bot-to-bot traffic in shared rooms.
## Encryption and verification
In encrypted (E2EE) rooms, outbound image events use `thumbnail_file` so image previews are encrypted alongside the full attachment. Unencrypted rooms still use plain `thumbnail_url`. No configuration is needed — the plugin detects E2EE state automatically.
Enable encryption:
```json5
@@ -493,8 +486,6 @@ Bootstrap cross-signing and verification state:
openclaw matrix verify bootstrap
```
Multi-account support: use `channels.matrix.accounts` with per-account credentials and optional `name`. See [Configuration reference](/gateway/configuration-reference#multi-account-all-channels) for the shared pattern.
Verbose bootstrap diagnostics:
```bash
@@ -625,64 +616,11 @@ That pass tries to reuse the current secret storage and cross-signing identity f
If startup finds broken bootstrap state and `channels.matrix.password` is configured, OpenClaw can attempt a stricter repair path.
If the current device is already owner-signed, OpenClaw preserves that identity instead of resetting it automatically.
Upgrading from the previous public Matrix plugin:
See [Matrix migration](/install/migrating-matrix) for the full upgrade flow, limits, recovery commands, and common migration messages.
- OpenClaw automatically reuses the same Matrix account, access token, and device identity when possible.
- Before any actionable Matrix migration changes run, OpenClaw creates or reuses a recovery snapshot under `~/Backups/openclaw-migrations/`.
- If you use multiple Matrix accounts, set `channels.matrix.defaultAccount` before upgrading from the old flat-store layout so OpenClaw knows which account should receive that shared legacy state.
- If the previous plugin stored a Matrix room-key backup decryption key locally, startup or `openclaw doctor --fix` will import it into the new recovery-key flow automatically.
- If the Matrix access token changed after migration was prepared, startup now scans sibling token-hash storage roots for pending legacy restore state before giving up on the automatic backup restore.
- If the Matrix access token changes later for the same account, homeserver, and user, OpenClaw now prefers reusing the most complete existing token-hash storage root instead of starting from an empty Matrix state directory.
- On the next gateway start, backed-up room keys are restored automatically into the new crypto store.
- If the old plugin had local-only room keys that were never backed up, OpenClaw will warn clearly. Those keys cannot be exported automatically from the previous rust crypto store, so some old encrypted history may remain unavailable until recovered manually.
- See [Matrix migration](/install/migrating-matrix) for the full upgrade flow, limits, recovery commands, and common migration messages.
### Verification notices
Encrypted runtime state is organized under per-account, per-user token-hash roots in
`~/.openclaw/matrix/accounts/<account>/<homeserver>__<user>/<token-hash>/`.
That directory contains the sync store (`bot-storage.json`), crypto store (`crypto/`),
recovery key file (`recovery-key.json`), IndexedDB snapshot (`crypto-idb-snapshot.json`),
thread bindings (`thread-bindings.json`), and startup verification state (`startup-verification.json`)
when those features are in use.
When the token changes but the account identity stays the same, OpenClaw reuses the best existing
root for that account/homeserver/user tuple so prior sync state, crypto state, thread bindings,
and startup verification state remain visible.
### Node crypto store model
Matrix E2EE in this plugin uses the official `matrix-js-sdk` Rust crypto path in Node.
That path expects IndexedDB-backed persistence when you want crypto state to survive restarts.
OpenClaw currently provides that in Node by:
- using `fake-indexeddb` as the IndexedDB API shim expected by the SDK
- restoring the Rust crypto IndexedDB contents from `crypto-idb-snapshot.json` before `initRustCrypto`
- persisting the updated IndexedDB contents back to `crypto-idb-snapshot.json` after init and during runtime
- serializing snapshot restore and persist against `crypto-idb-snapshot.json` with an advisory file lock so gateway runtime persistence and CLI maintenance do not race on the same snapshot file
This is compatibility/storage plumbing, not a custom crypto implementation.
The snapshot file is sensitive runtime state and is stored with restrictive file permissions.
Under OpenClaw's security model, the gateway host and local OpenClaw state directory are already inside the trusted operator boundary, so this is primarily an operational durability concern rather than a separate remote trust boundary.
Planned improvement:
- add SecretRef support for persistent Matrix key material so recovery keys and related store-encryption secrets can be sourced from OpenClaw secrets providers instead of only local files
## Profile management
Update the Matrix self-profile for the selected account with:
```bash
openclaw matrix profile set --name "OpenClaw Assistant"
openclaw matrix profile set --avatar-url https://cdn.example.org/avatar.png
```
Add `--account <id>` when you want to target a named Matrix account explicitly.
Matrix accepts `mxc://` avatar URLs directly. When you pass an `http://` or `https://` avatar URL, OpenClaw uploads it to Matrix first and stores the resolved `mxc://` URL back into `channels.matrix.avatarUrl` (or the selected account override).
## Automatic verification notices
Matrix now posts verification lifecycle notices directly into the strict DM verification room as `m.notice` messages.
Matrix posts verification lifecycle notices directly into the strict DM verification room as `m.notice` messages.
That includes:
- verification request notices
@@ -714,27 +652,31 @@ Remove stale OpenClaw-managed devices with:
openclaw matrix devices prune-stale
```
### Direct Room Repair
### Crypto store
If direct-message state gets out of sync, OpenClaw can end up with stale `m.direct` mappings that point at old solo rooms instead of the live DM. Inspect the current mapping for a peer with:
Matrix E2EE uses the official `matrix-js-sdk` Rust crypto path in Node, with `fake-indexeddb` as the IndexedDB shim. Crypto state is persisted to a snapshot file (`crypto-idb-snapshot.json`) and restored on startup. The snapshot file is sensitive runtime state stored with restrictive file permissions.
Encrypted runtime state lives under per-account, per-user token-hash roots in
`~/.openclaw/matrix/accounts/<account>/<homeserver>__<user>/<token-hash>/`.
That directory contains the sync store (`bot-storage.json`), crypto store (`crypto/`),
recovery key file (`recovery-key.json`), IndexedDB snapshot (`crypto-idb-snapshot.json`),
thread bindings (`thread-bindings.json`), and startup verification state (`startup-verification.json`).
When the token changes but the account identity stays the same, OpenClaw reuses the best existing
root for that account/homeserver/user tuple so prior sync state, crypto state, thread bindings,
and startup verification state remain visible.
## Profile management
Update the Matrix self-profile for the selected account with:
```bash
openclaw matrix direct inspect --user-id @alice:example.org
openclaw matrix profile set --name "OpenClaw Assistant"
openclaw matrix profile set --avatar-url https://cdn.example.org/avatar.png
```
Repair it with:
Add `--account <id>` when you want to target a named Matrix account explicitly.
```bash
openclaw matrix direct repair --user-id @alice:example.org
```
Repair keeps the Matrix-specific logic inside the plugin:
- it prefers a strict 1:1 DM that is already mapped in `m.direct`
- otherwise it falls back to any currently joined strict 1:1 DM with that user
- if no healthy DM exists, it creates a fresh direct room and rewrites `m.direct` to point at it
The repair flow does not delete old rooms automatically. It only picks the healthy DM and updates the mapping so new Matrix sends, verification notices, and other direct-message flows target the right room again.
Matrix accepts `mxc://` avatar URLs directly. When you pass an `http://` or `https://` avatar URL, OpenClaw uploads it to Matrix first and stores the resolved `mxc://` URL back into `channels.matrix.avatarUrl` (or the selected account override).
## Threads
@@ -748,10 +690,10 @@ Matrix supports native Matrix threads for both automatic replies and message-too
- `threadReplies: "always"` keeps room replies in a thread rooted at the triggering message and routes that conversation through the matching thread-scoped session from the first triggering message.
- `dm.threadReplies` overrides the top-level setting for DMs only. For example, you can keep room threads isolated while keeping DMs flat.
- Inbound threaded messages include the thread root message as extra agent context.
- Message-tool sends now auto-inherit the current Matrix thread when the target is the same room, or the same DM user target, unless an explicit `threadId` is provided.
- Message-tool sends auto-inherit the current Matrix thread when the target is the same room, or the same DM user target, unless an explicit `threadId` is provided.
- Same-session DM user-target reuse only kicks in when the current session metadata proves the same DM peer on the same Matrix account; otherwise OpenClaw falls back to normal user-scoped routing.
- When OpenClaw sees a Matrix DM room collide with another DM room on the same shared Matrix DM session, it posts a one-time `m.notice` in that room with the `/focus` escape hatch when thread bindings are enabled and the `dm.sessionScope` hint.
- Runtime thread bindings are supported for Matrix. `/focus`, `/unfocus`, `/agents`, `/session idle`, `/session max-age`, and thread-bound `/acp spawn` now work in Matrix rooms and DMs.
- Runtime thread bindings are supported for Matrix. `/focus`, `/unfocus`, `/agents`, `/session idle`, `/session max-age`, and thread-bound `/acp spawn` work in Matrix rooms and DMs.
- Top-level Matrix room/DM `/focus` creates a new Matrix thread and binds it to the target session when `threadBindings.spawnSubagentSessions=true`.
- Running `/focus` or `/acp spawn --thread here` inside an existing Matrix thread binds that current thread instead.
@@ -772,7 +714,7 @@ Notes:
- `--bind here` does not create a child Matrix thread.
- `threadBindings.spawnAcpSessions` is only required for `/acp spawn --thread auto|here`, where OpenClaw needs to create or bind a child Matrix thread.
### Thread Binding Config
### Thread binding config
Matrix inherits global defaults from `session.threadBindings`, and also supports per-channel overrides:
@@ -816,16 +758,15 @@ Reaction notification mode resolves in this order:
- `channels["matrix"].reactionNotifications`
- default: `own`
Current behavior:
Behavior:
- `reactionNotifications: "own"` forwards added `m.reaction` events when they target bot-authored Matrix messages.
- `reactionNotifications: "off"` disables reaction system events.
- Reaction removals are still not synthesized into system events because Matrix surfaces those as redactions, not as standalone `m.reaction` removals.
- Reaction removals are not synthesized into system events because Matrix surfaces those as redactions, not as standalone `m.reaction` removals.
## History context
- `channels.matrix.historyLimit` controls how many recent room messages are included as `InboundHistory` when a Matrix room message triggers the agent.
- It falls back to `messages.groupChat.historyLimit`. If both are unset, the effective default is `0`, so mention-gated room messages are not buffered. Set `0` to disable.
- `channels.matrix.historyLimit` controls how many recent room messages are included as `InboundHistory` when a Matrix room message triggers the agent. Falls back to `messages.groupChat.historyLimit`; if both are unset, the effective default is `0`. Set `0` to disable.
- Matrix room history is room-only. DMs keep using normal session history.
- Matrix room history is pending-only: OpenClaw buffers room messages that did not trigger a reply yet, then snapshots that window when a mention or other trigger arrives.
- The current trigger message is not included in `InboundHistory`; it stays in the main inbound body for that turn.
@@ -842,7 +783,7 @@ Matrix supports the shared `contextVisibility` control for supplemental room con
This setting affects supplemental context visibility, not whether the inbound message itself can trigger a reply.
Trigger authorization still comes from `groupPolicy`, `groups`, `groupAllowFrom`, and DM policy settings.
## DM and room policy example
## DM and room policy
```json5
{
@@ -878,6 +819,28 @@ If an unapproved Matrix user keeps messaging you before approval, OpenClaw reuse
See [Pairing](/channels/pairing) for the shared DM pairing flow and storage layout.
## Direct room repair
If direct-message state gets out of sync, OpenClaw can end up with stale `m.direct` mappings that point at old solo rooms instead of the live DM. Inspect the current mapping for a peer with:
```bash
openclaw matrix direct inspect --user-id @alice:example.org
```
Repair it with:
```bash
openclaw matrix direct repair --user-id @alice:example.org
```
The repair flow:
- prefers a strict 1:1 DM that is already mapped in `m.direct`
- falls back to any currently joined strict 1:1 DM with that user
- creates a fresh direct room and rewrites `m.direct` if no healthy DM exists
The repair flow does not delete old rooms automatically. It only picks the healthy DM and updates the mapping so new Matrix sends, verification notices, and other direct-message flows target the right room again.
## Exec approvals
Matrix can act as a native approval client for a Matrix account. The native
@@ -891,7 +854,7 @@ DM/channel routing knobs still live under exec approval config:
Approvers must be Matrix user IDs such as `@owner:example.org`. Matrix auto-enables native approvals when `enabled` is unset or `"auto"` and at least one approver can be resolved. Exec approvals use `execApprovals.approvers` first and can fall back to `channels.matrix.dm.allowFrom`. Plugin approvals authorize through `channels.matrix.dm.allowFrom`. Set `enabled: false` to disable Matrix as a native approval client explicitly. Approval requests otherwise fall back to other configured approval routes or the approval fallback policy.
Matrix native routing now supports both approval kinds:
Matrix native routing supports both approval kinds:
- `channels.matrix.execApprovals.*` controls the native DM/channel fanout mode for Matrix approval prompts.
- Exec approvals use the exec approver set from `execApprovals.approvers` or `channels.matrix.dm.allowFrom`.
@@ -914,15 +877,13 @@ Approvers can react on that message or use the fallback slash commands: `/approv
Only resolved approvers can approve or deny. For exec approvals, channel delivery includes the command text, so only enable `channel` or `both` in trusted rooms.
Matrix approval prompts reuse the shared core approval planner. The Matrix-specific native surface handles room/DM routing, reactions, and message send/update/delete behavior for both exec and plugin approvals.
Per-account override:
- `channels.matrix.accounts.<account>.execApprovals`
Related docs: [Exec approvals](/tools/exec-approvals)
## Multi-account example
## Multi-account
```json5
{
@@ -953,7 +914,7 @@ Related docs: [Exec approvals](/tools/exec-approvals)
```
Top-level `channels.matrix` values act as defaults for named accounts unless an account overrides them.
You can scope inherited room entries to one Matrix account with `groups.<room>.account` (or legacy `rooms.<room>.account`).
You can scope inherited room entries to one Matrix account with `groups.<room>.account`.
Entries without `account` stay shared across all Matrix accounts, and entries with `account: "default"` still work when the default account is configured directly on top-level `channels.matrix.*`.
Partial shared auth defaults do not create a separate implicit default account by themselves. OpenClaw only synthesizes the top-level `default` account when that default has fresh auth (`homeserver` plus `accessToken`, or `homeserver` plus `userId` and `password`); named accounts can still stay discoverable from `homeserver` plus `userId` when cached credentials satisfy auth later.
If Matrix already has exactly one named account, or `defaultAccount` points at an existing named account key, single-account-to-multi-account repair/setup promotion preserves that account instead of creating a fresh `accounts.default` entry. Only Matrix auth/bootstrap keys move into that promoted account; shared delivery-policy keys stay at the top level.
@@ -961,6 +922,8 @@ Set `defaultAccount` when you want OpenClaw to prefer one named Matrix account f
If you configure multiple named accounts, set `defaultAccount` or pass `--account <id>` for CLI commands that rely on implicit account selection.
Pass `--account <id>` to `openclaw matrix verify ...` and `openclaw matrix devices ...` when you want to override that implicit selection for one command.
See [Configuration reference](/gateway/configuration-reference#multi-account-all-channels) for the shared multi-account pattern.
## Private/LAN homeservers
By default, OpenClaw blocks private/internal Matrix homeservers for SSRF protection unless you
@@ -1042,43 +1005,42 @@ Live directory lookup uses the logged-in Matrix account:
- `password`: password for password-based login. Plaintext values and SecretRef values are supported.
- `deviceId`: explicit Matrix device ID.
- `deviceName`: device display name for password login.
- `avatarUrl`: stored self-avatar URL for profile sync and `set-profile` updates.
- `initialSyncLimit`: startup sync event limit.
- `avatarUrl`: stored self-avatar URL for profile sync and `profile set` updates.
- `initialSyncLimit`: maximum number of events fetched during startup sync.
- `encryption`: enable E2EE.
- `allowlistOnly`: force allowlist-only behavior for DMs and rooms.
- `allowlistOnly`: when `true`, upgrades `open` room policy to `allowlist`, and forces all active DM policies except `disabled` (including `pairing` and `open`) to `allowlist`. Does not affect `disabled` policies.
- `allowBots`: allow messages from other configured OpenClaw Matrix accounts (`true` or `"mentions"`).
- `groupPolicy`: `open`, `allowlist`, or `disabled`.
- `contextVisibility`: supplemental room-context visibility mode (`all`, `allowlist`, `allowlist_quote`).
- `groupAllowFrom`: allowlist of user IDs for room traffic.
- `groupAllowFrom` entries should be full Matrix user IDs. Unresolved names are ignored at runtime.
- `groupAllowFrom`: allowlist of user IDs for room traffic. Entries should be full Matrix user IDs; unresolved names are ignored at runtime.
- `historyLimit`: max room messages to include as group history context. Falls back to `messages.groupChat.historyLimit`; if both are unset, the effective default is `0`. Set `0` to disable.
- `replyToMode`: `off`, `first`, `all`, or `batched`.
- `markdown`: optional Markdown rendering configuration for outbound Matrix text.
- `streaming`: `off` (default), `partial`, `quiet`, `true`, or `false`. `partial` and `true` enable preview-first draft updates with normal Matrix text messages. `quiet` uses non-notifying preview notices for self-hosted push-rule setups.
- `streaming`: `off` (default), `"partial"`, `"quiet"`, `true`, or `false`. `"partial"` and `true` enable preview-first draft updates with normal Matrix text messages. `"quiet"` uses non-notifying preview notices for self-hosted push-rule setups. `false` is equivalent to `"off"`.
- `blockStreaming`: `true` enables separate progress messages for completed assistant blocks while draft preview streaming is active.
- `threadReplies`: `off`, `inbound`, or `always`.
- `threadBindings`: per-channel overrides for thread-bound session routing and lifecycle.
- `startupVerification`: automatic self-verification request mode on startup (`if-unverified`, `off`).
- `startupVerificationCooldownHours`: cooldown before retrying automatic startup verification requests.
- `textChunkLimit`: outbound message chunk size.
- `chunkMode`: `length` or `newline`.
- `responsePrefix`: optional message prefix for outbound replies.
- `textChunkLimit`: outbound message chunk size in characters (applies when `chunkMode` is `length`).
- `chunkMode`: `length` splits messages by character count; `newline` splits at line boundaries.
- `responsePrefix`: optional string prepended to all outbound replies for this channel.
- `ackReaction`: optional ack reaction override for this channel/account.
- `ackReactionScope`: optional ack reaction scope override (`group-mentions`, `group-all`, `direct`, `all`, `none`, `off`).
- `reactionNotifications`: inbound reaction notification mode (`own`, `off`).
- `mediaMaxMb`: media size cap in MB for Matrix media handling. It applies to outbound sends and inbound media processing.
- `autoJoin`: invite auto-join policy (`always`, `allowlist`, `off`). Default: `off`. This applies to Matrix invites in general, including DM-style invites, not only room/group invites. OpenClaw makes this decision at invite time, before it can reliably classify the joined room as a DM or a group.
- `mediaMaxMb`: media size cap in MB for outbound sends and inbound media processing.
- `autoJoin`: invite auto-join policy (`always`, `allowlist`, `off`). Default: `off`. Applies to all Matrix invites, including DM-style invites.
- `autoJoinAllowlist`: rooms/aliases allowed when `autoJoin` is `allowlist`. Alias entries are resolved to room IDs during invite handling; OpenClaw does not trust alias state claimed by the invited room.
- `dm`: DM policy block (`enabled`, `policy`, `allowFrom`, `sessionScope`, `threadReplies`).
- `dm.policy`: controls DM access after OpenClaw has joined the room and classified it as a DM. It does not change whether an invite is auto-joined.
- `dm.allowFrom` entries should be full Matrix user IDs unless you already resolved them through live directory lookup.
- `dm.allowFrom`: entries should be full Matrix user IDs unless you already resolved them through live directory lookup.
- `dm.sessionScope`: `per-user` (default) or `per-room`. Use `per-room` when you want each Matrix DM room to keep separate context even if the peer is the same.
- `dm.threadReplies`: DM-only thread policy override (`off`, `inbound`, `always`). It overrides the top-level `threadReplies` setting for both reply placement and session isolation in DMs.
- `execApprovals`: Matrix-native exec approval delivery (`enabled`, `approvers`, `target`, `agentFilter`, `sessionFilter`).
- `execApprovals.approvers`: Matrix user IDs allowed to approve exec requests. Optional when `dm.allowFrom` already identifies the approvers.
- `execApprovals.target`: `dm | channel | both` (default: `dm`).
- `accounts`: named per-account overrides. Top-level `channels.matrix` values act as defaults for these entries.
- `groups`: per-room policy map. Prefer room IDs or aliases; unresolved room names are ignored at runtime. Session/group identity uses the stable room ID after resolution, while human-readable labels still come from room names.
- `groups`: per-room policy map. Prefer room IDs or aliases; unresolved room names are ignored at runtime. Session/group identity uses the stable room ID after resolution.
- `groups.<room>.account`: restrict one inherited room entry to a specific Matrix account in multi-account setups.
- `groups.<room>.allowBots`: room-level override for configured-bot senders (`true` or `"mentions"`).
- `groups.<room>.users`: per-room sender allowlist.
+12 -7
View File
@@ -463,9 +463,11 @@ Notes:
- `block`: append chunked preview updates.
- `progress`: show progress status text while generating, then send final text.
`channels.slack.nativeStreaming` controls Slack native text streaming when `streaming` is `partial` (default: `true`).
`channels.slack.streaming.nativeTransport` controls Slack native text streaming when `channels.slack.streaming.mode` is `partial` (default: `true`).
- A reply thread must be available for native text streaming to appear. Thread selection still follows `replyToMode`. Without one, the normal draft preview is used.
- A reply thread must be available for native text streaming and Slack assistant thread status to appear. Thread selection still follows `replyToMode`.
- Channel and group-chat roots can still use the normal draft preview when native streaming is unavailable.
- Top-level Slack DMs stay off-thread by default, so they do not show the thread-style preview; use thread replies or `typingReaction` if you want visible progress there.
- Media and non-text payloads fall back to normal delivery.
- If streaming fails mid-reply, OpenClaw falls back to normal delivery for remaining payloads.
@@ -475,8 +477,10 @@ Use draft preview instead of Slack native text streaming:
{
channels: {
slack: {
streaming: "partial",
nativeStreaming: false,
streaming: {
mode: "partial",
nativeTransport: false,
},
},
},
}
@@ -484,8 +488,9 @@ Use draft preview instead of Slack native text streaming:
Legacy keys:
- `channels.slack.streamMode` (`replace | status_final | append`) is auto-migrated to `channels.slack.streaming`.
- boolean `channels.slack.streaming` is auto-migrated to `channels.slack.nativeStreaming`.
- `channels.slack.streamMode` (`replace | status_final | append`) is auto-migrated to `channels.slack.streaming.mode`.
- boolean `channels.slack.streaming` is auto-migrated to `channels.slack.streaming.mode` and `channels.slack.streaming.nativeTransport`.
- legacy `channels.slack.nativeStreaming` is auto-migrated to `channels.slack.streaming.nativeTransport`.
## Typing reaction fallback
@@ -687,7 +692,7 @@ Primary reference:
- compatibility toggle: `dangerouslyAllowNameMatching` (break-glass; keep off unless needed)
- channel access: `groupPolicy`, `channels.*`, `channels.*.users`, `channels.*.requireMention`
- threading/history: `replyToMode`, `replyToModeByChatType`, `thread.*`, `historyLimit`, `dmHistoryLimit`, `dms.*.historyLimit`
- delivery: `textChunkLimit`, `chunkMode`, `mediaMaxMb`, `streaming`, `nativeStreaming`
- delivery: `textChunkLimit`, `chunkMode`, `mediaMaxMb`, `streaming`, `streaming.nativeTransport`
- ops/features: `configWrites`, `commands.native`, `slashCommand.*`, `actions.*`, `userToken`, `userTokenReadOnly`
## Troubleshooting
+4
View File
@@ -167,4 +167,8 @@ Notes:
- If effectively active memory remote API key fields are configured as SecretRefs, the command resolves those values from the active gateway snapshot. If gateway is unavailable, the command fails fast.
- Gateway version skew note: this command path requires a gateway that supports `secrets.resolve`; older gateways return an unknown-method error.
- Tune scheduled sweep cadence with `dreaming.frequency`. Deep promotion policy is otherwise internal; use CLI flags on `memory promote` when you need one-off manual overrides.
- `memory rem-harness --path <file-or-dir> --grounded` previews grounded `What Happened`, `Reflections`, and `Possible Lasting Updates` from historical daily notes without writing anything.
- `memory rem-backfill --path <file-or-dir>` writes reversible grounded diary entries into `DREAMS.md` for UI review.
- `memory rem-backfill --path <file-or-dir> --stage-short-term` also seeds grounded durable candidates into the live short-term promotion store so the normal deep phase can rank them.
- `memory rem-backfill --rollback` removes previously written grounded diary entries, and `memory rem-backfill --rollback-short-term` removes previously staged grounded short-term candidates.
- See [Dreaming](/concepts/dreaming) for full phase descriptions and configuration reference.
+1
View File
@@ -151,6 +151,7 @@ See [Plugin hooks](/plugins/architecture#provider-runtime-hooks) for the hook AP
- `agent.wait` default: 30s (just the wait). `timeoutMs` param overrides.
- Agent runtime: `agents.defaults.timeoutSeconds` default 172800s (48 hours); enforced in `runEmbeddedPiAgent` abort timer.
- LLM idle timeout: `agents.defaults.llm.idleTimeoutSeconds` aborts a model request when no response chunks arrive before the idle window. Set it explicitly for slow local models or reasoning/tool-call providers; set it to 0 to disable. If it is not set, OpenClaw uses `agents.defaults.timeoutSeconds` when configured, otherwise 60s. Cron-triggered runs with no explicit LLM or agent timeout disable the idle watchdog and rely on the cron outer timeout.
## Where things can end early
+24 -2
View File
@@ -42,7 +42,7 @@ These phases are internal implementation details, not separate user-configured
Light phase ingests recent daily memory signals and recall traces, dedupes them,
and stages candidate lines.
- Reads from short-term recall state and recent daily memory files.
- Reads from short-term recall state, recent daily memory files, and redacted session transcripts when available.
- Writes a managed `## Light Sleep` block when storage includes inline output.
- Records reinforcement signals for later deep ranking.
- Never writes to `MEMORY.md`.
@@ -66,6 +66,13 @@ REM phase extracts patterns and reflective signals.
- Records REM reinforcement signals used by deep ranking.
- Never writes to `MEMORY.md`.
## Session transcript ingestion
Dreaming can ingest redacted session transcripts into the dreaming corpus. When
transcripts are available, they are fed into the light phase alongside daily
memory signals and recall traces. Personal and sensitive content is redacted
before ingestion.
## Dream Diary
Dreaming also keeps a narrative **Dream Diary** in `DREAMS.md`.
@@ -74,6 +81,20 @@ subagent turn (using the default runtime model) and appends a short diary entry.
This diary is for human reading in the Dreams UI, not a promotion source.
There is also a grounded historical backfill lane for review and recovery work:
- `memory rem-harness --path ... --grounded` previews grounded diary output from historical `YYYY-MM-DD.md` notes.
- `memory rem-backfill --path ...` writes reversible grounded diary entries into `DREAMS.md`.
- `memory rem-backfill --path ... --stage-short-term` stages grounded durable candidates into the same short-term evidence store the normal deep phase already uses.
- `memory rem-backfill --rollback` and `--rollback-short-term` remove those staged backfill artifacts without touching ordinary diary entries or live short-term recall.
The Control UI exposes the same diary backfill/reset flow so you can inspect
results in the Dreams scene before deciding whether the grounded candidates
deserve promotion. The Scene also shows a distinct grounded lane so you can see
which staged short-term entries came from historical replay, which promoted
items were grounded-led, and clear only grounded-only staged entries without
touching ordinary live short-term state.
## Deep ranking signals
Deep ranking uses six weighted base signals plus phase reinforcement:
@@ -200,8 +221,9 @@ When enabled, the Gateway **Dreams** tab shows:
- current dreaming enabled state
- phase-level status and managed-sweep presence
- short-term, long-term, and promoted-today counts
- short-term, grounded, signal, and promoted-today counts
- next scheduled run timing
- a distinct grounded Scene lane for staged historical replay entries
- an expandable Dream Diary reader backed by `doctor.memory.dreamDiary`
## Related
+36 -1
View File
@@ -21,7 +21,7 @@ Your agent has three memory-related files:
- **`memory/YYYY-MM-DD.md`** -- daily notes. Running context and observations.
Today and yesterday's notes are loaded automatically.
- **`DREAMS.md`** (experimental, optional) -- Dream Diary and dreaming sweep
summaries for human review.
summaries for human review, including grounded historical backfill entries.
These files live in the agent workspace (default `~/.openclaw/workspace`).
@@ -133,6 +133,41 @@ It is designed to keep long-term memory high signal:
For phase behavior, scoring signals, and Dream Diary details, see
[Dreaming (experimental)](/concepts/dreaming).
## Grounded backfill and live promotion
The dreaming system now has two closely related review lanes:
- **Live dreaming** works from the short-term dreaming store under
`memory/.dreams/` and is what the normal deep phase uses when deciding what
can graduate into `MEMORY.md`.
- **Grounded backfill** reads historical `memory/YYYY-MM-DD.md` notes as
standalone day files and writes structured review output into `DREAMS.md`.
Grounded backfill is useful when you want to replay older notes and inspect what
the system thinks is durable without manually editing `MEMORY.md`.
When you use:
```bash
openclaw memory rem-backfill --path ./memory --stage-short-term
```
the grounded durable candidates are not promoted directly. They are staged into
the same short-term dreaming store the normal deep phase already uses. That
means:
- `DREAMS.md` stays the human review surface.
- the short-term store stays the machine-facing ranking surface.
- `MEMORY.md` is still only written by deep promotion.
If you decide the replay was not useful, you can remove the staged artifacts
without touching ordinary diary entries or normal recall state:
```bash
openclaw memory rem-backfill --rollback
openclaw memory rem-backfill --rollback-short-term
```
## CLI
```bash
+5 -4
View File
@@ -23,10 +23,11 @@ For model selection rules, see [/concepts/models](/concepts/models).
- Provider plugins can inject model catalogs via `registerProvider({ catalog })`;
OpenClaw merges that output into `models.providers` before writing
`models.json`.
- Provider manifests can declare `providerAuthEnvVars` so generic env-based
auth probes do not need to load plugin runtime. The remaining core env-var
map is now just for non-plugin/core providers and a few generic-precedence
cases such as Anthropic API-key-first onboarding.
- Provider manifests can declare `providerAuthEnvVars` and
`providerAuthAliases` so generic env-based auth probes and provider variants
do not need to load plugin runtime. The remaining core env-var map is now
just for non-plugin/core providers and a few generic-precedence cases such
as Anthropic API-key-first onboarding.
- Provider plugins can also own provider runtime behavior via
`normalizeModelId`, `normalizeTransport`, `normalizeConfig`,
`applyNativeStreamingUsageCompat`, `resolveConfigApiKey`,
+55 -1
View File
@@ -56,7 +56,8 @@ asset hash changes.
Seed assets live in `qa/`:
- `qa/scenarios.md`
- `qa/scenarios/index.md`
- `qa/scenarios/*.md`
These are intentionally in git so the QA plan is visible to both humans and the
agent. The baseline list should stay broad enough to cover:
@@ -81,6 +82,59 @@ The report should answer:
- What stayed blocked
- What follow-up scenarios are worth adding
For character and style checks, run the same scenario across multiple live model
refs and write a judged Markdown report:
```bash
pnpm openclaw qa character-eval \
--model openai/gpt-5.4,thinking=xhigh \
--model openai/gpt-5.2,thinking=xhigh \
--model openai/gpt-5,thinking=xhigh \
--model anthropic/claude-opus-4-6,thinking=high \
--model anthropic/claude-sonnet-4-6,thinking=high \
--model zai/glm-5.1,thinking=high \
--model moonshot/kimi-k2.5,thinking=high \
--model google/gemini-3.1-pro-preview,thinking=high \
--judge-model openai/gpt-5.4,thinking=xhigh,fast \
--judge-model anthropic/claude-opus-4-6,thinking=high \
--blind-judge-models \
--concurrency 16 \
--judge-concurrency 16
```
The command runs local QA gateway child processes, not Docker. Character eval
scenarios should set the persona through `SOUL.md`, then run ordinary user turns
such as chat, workspace help, and small file tasks. The candidate model should
not be told that it is being evaluated. The command preserves each full
transcript, records basic run stats, then asks the judge models in fast mode with
`xhigh` reasoning to rank the runs by naturalness, vibe, and humor.
Use `--blind-judge-models` when comparing providers: the judge prompt still gets
every transcript and run status, but candidate refs are replaced with neutral
labels such as `candidate-01`; the report maps rankings back to real refs after
parsing.
Candidate runs default to `high` thinking, with `xhigh` for OpenAI models that
support it. Override a specific candidate inline with
`--model provider/model,thinking=<level>`. `--thinking <level>` still sets a
global fallback, and the older `--model-thinking <provider/model=level>` form is
kept for compatibility.
OpenAI candidate refs default to fast mode so priority processing is used where
the provider supports it. Add `,fast`, `,no-fast`, or `,fast=false` inline when a
single candidate or judge needs an override. Pass `--fast` only when you want to
force fast mode on for every candidate model. Candidate and judge durations are
recorded in the report for benchmark analysis, but judge prompts explicitly say
not to rank by speed.
Candidate and judge model runs both default to concurrency 16. Lower
`--concurrency` or `--judge-concurrency` when provider limits or local gateway
pressure make a run too noisy.
When no candidate `--model` is passed, the character eval defaults to
`openai/gpt-5.4`, `openai/gpt-5.2`, `openai/gpt-5`, `anthropic/claude-opus-4-6`,
`anthropic/claude-sonnet-4-6`, `zai/glm-5.1`,
`moonshot/kimi-k2.5`, and
`google/gemini-3.1-pro-preview` when no `--model` is passed.
When no `--judge-model` is passed, the judges default to
`openai/gpt-5.4,thinking=xhigh,fast` and
`anthropic/claude-opus-4-6,thinking=high`.
## Related docs
- [Testing](/help/testing)
+3 -2
View File
@@ -126,13 +126,14 @@ Modes:
Slack-only:
- `channels.slack.nativeStreaming` toggles Slack native streaming API calls when `streaming=partial` (default: `true`).
- `channels.slack.streaming.nativeTransport` toggles Slack native streaming API calls when `channels.slack.streaming.mode="partial"` (default: `true`).
- Slack native streaming and Slack assistant thread status require a reply thread target; top-level DMs do not show that thread-style preview.
Legacy key migration:
- Telegram: `streamMode` + boolean `streaming` auto-migrate to `streaming` enum.
- Discord: `streamMode` + boolean `streaming` auto-migrate to `streaming` enum.
- Slack: `streamMode` auto-migrates to `streaming` enum; boolean `streaming` auto-migrates to `nativeStreaming`.
- Slack: `streamMode` auto-migrates to `streaming.mode`; boolean `streaming` auto-migrates to `streaming.mode` plus `streaming.nativeTransport`; legacy `nativeStreaming` auto-migrates to `streaming.nativeTransport`.
### Runtime behavior
+9
View File
@@ -124,6 +124,9 @@ The provider id becomes the left side of your model ref:
sessionMode: "existing",
sessionIdFields: ["session_id", "conversation_id"],
systemPromptArg: "--system",
// Codex-style CLIs can point at a prompt file instead:
// systemPromptFileConfigArg: "-c",
// systemPromptFileConfigKey: "model_instructions_file",
systemPromptWhen: "first",
imageArg: "--image",
imageMode: "repeat",
@@ -150,6 +153,12 @@ told us OpenClaw-style Claude CLI usage is allowed again, so OpenClaw treats
a new policy.
</Note>
The bundled OpenAI `codex-cli` backend passes OpenClaw's system prompt through
Codex's `model_instructions_file` config override (`-c
model_instructions_file="..."`). Codex does not expose a Claude-style
`--append-system-prompt` flag, so OpenClaw writes the assembled prompt to a
temporary file for each fresh Codex CLI session.
## Sessions
- If the CLI supports sessions, set `sessionArg` (e.g. `--session-id`) or
+75 -14
View File
@@ -1,6 +1,6 @@
---
title: "Configuration Reference"
summary: "Complete reference for every OpenClaw config key, defaults, and channel settings"
summary: "Gateway config reference for core OpenClaw keys, defaults, and links to dedicated subsystem references"
read_when:
- You need exact field-level config semantics or defaults
- You are validating channel, model, gateway, or tool config blocks
@@ -8,7 +8,21 @@ read_when:
# Configuration Reference
Every field available in `~/.openclaw/openclaw.json`. For a task-oriented overview, see [Configuration](/gateway/configuration).
Core config reference for `~/.openclaw/openclaw.json`. For a task-oriented overview, see [Configuration](/gateway/configuration).
This page covers the main OpenClaw config surfaces and links out when a subsystem has its own deeper reference. It does **not** try to inline every channel/plugin-owned command catalog or every deep memory/QMD knob on one page.
Code truth:
- `openclaw config schema` prints the live JSON Schema used for validation and Control UI, with bundled/plugin/channel metadata merged in when available
- `config.schema.lookup` returns one path-scoped schema node for drill-down tooling
- `pnpm config:docs:check` / `pnpm config:docs:gen` validate the config-doc baseline hash against the current schema surface
Dedicated deep references:
- [Memory configuration reference](/reference/memory-config) for `agents.defaults.memorySearch.*`, `memory.qmd.*`, `memory.citations`, and dreaming config under `plugins.entries.memory-core.config.dreaming`
- [Slash Commands](/tools/slash-commands) for the current built-in + bundled command catalog
- owning channel/plugin pages for channel-specific command surfaces
Config format is **JSON5** (comments + trailing commas allowed). All fields are optional — OpenClaw uses safe defaults when omitted.
@@ -426,8 +440,10 @@ WhatsApp runs through the gateway's web channel (Baileys Web). It starts automat
typingReaction: "hourglass_flowing_sand",
textChunkLimit: 4000,
chunkMode: "length",
streaming: "partial", // off | partial | block | progress (preview mode)
nativeStreaming: true, // use Slack native streaming API when streaming=partial
streaming: {
mode: "partial", // off | partial | block | progress
nativeTransport: true, // use Slack native streaming API when mode=partial
},
mediaMaxMb: 20,
execApprovals: {
enabled: "auto", // true | false | "auto"
@@ -452,13 +468,14 @@ WhatsApp runs through the gateway's web channel (Baileys Web). It starts automat
resolve the secret value.
- `configWrites: false` blocks Slack-initiated config writes.
- Optional `channels.slack.defaultAccount` overrides default account selection when it matches a configured account id.
- `channels.slack.streaming` is the canonical stream mode key. Legacy `streamMode` and boolean `streaming` values are auto-migrated.
- `channels.slack.streaming.mode` is the canonical Slack stream mode key. `channels.slack.streaming.nativeTransport` controls Slack's native streaming transport. Legacy `streamMode`, boolean `streaming`, and `nativeStreaming` values are auto-migrated.
- Use `user:<id>` (DM) or `channel:<id>` for delivery targets.
**Reaction notification modes:** `off`, `own` (default), `all`, `allowlist` (from `reactionAllowlist`).
**Thread session isolation:** `thread.historyScope` is per-thread (default) or shared across channel. `thread.inheritParent` copies parent channel transcript to new threads.
- Slack native streaming plus the Slack assistant-style "is typing..." thread status require a reply thread target. Top-level DMs stay off-thread by default, so they use `typingReaction` or normal delivery instead of the thread-style preview.
- `typingReaction` adds a temporary reaction to the inbound Slack message while a reply is running, then removes it on completion. Use a Slack emoji shortcode such as `"hourglass_flowing_sand"`.
- `channels.slack.execApprovals`: Slack-native exec approval delivery and approver authorization. Same schema as Discord: `enabled` (`true`/`false`/`"auto"`), `approvers` (Slack user IDs), `agentFilter`, `sessionFilter`, and `target` (`"dm"`, `"channel"`, or `"both"`).
@@ -814,12 +831,18 @@ Include your own number in `allowFrom` to enable self-chat mode (ignores native
{
commands: {
native: "auto", // register native commands when supported
nativeSkills: "auto", // register native skill commands when supported
text: true, // parse /commands in chat messages
bash: false, // allow ! (alias: /bash)
bashForegroundMs: 2000,
config: false, // allow /config
mcp: false, // allow /mcp
plugins: false, // allow /plugins
debug: false, // allow /debug
restart: false, // allow /restart + gateway restart tool
restart: true, // allow /restart + gateway restart tool
ownerAllowFrom: ["discord:123456789012345678"],
ownerDisplay: "raw", // raw | hash
ownerDisplaySecret: "${OWNER_ID_HASH_SECRET}",
allowFrom: {
"*": ["user1"],
discord: ["user:123"],
@@ -831,16 +854,32 @@ Include your own number in `allowFrom` to enable self-chat mode (ignores native
<Accordion title="Command details">
- This block configures command surfaces. For the current built-in + bundled command catalog, see [Slash Commands](/tools/slash-commands).
- This page is a **config-key reference**, not the full command catalog. Channel/plugin-owned commands such as QQ Bot `/bot-ping` `/bot-help` `/bot-logs`, LINE `/card`, device-pair `/pair`, memory `/dreaming`, phone-control `/phone`, and Talk `/voice` are documented in their channel/plugin pages plus [Slash Commands](/tools/slash-commands).
- Text commands must be **standalone** messages with leading `/`.
- `native: "auto"` turns on native commands for Discord/Telegram, leaves Slack off.
- `nativeSkills: "auto"` turns on native skill commands for Discord/Telegram, leaves Slack off.
- Override per channel: `channels.discord.commands.native` (bool or `"auto"`). `false` clears previously registered commands.
- Override native skill registration per channel with `channels.<provider>.commands.nativeSkills`.
- `channels.telegram.customCommands` adds extra Telegram bot menu entries.
- `bash: true` enables `! <cmd>` for host shell. Requires `tools.elevated.enabled` and sender in `tools.elevated.allowFrom.<channel>`.
- `config: true` enables `/config` (reads/writes `openclaw.json`). For gateway `chat.send` clients, persistent `/config set|unset` writes also require `operator.admin`; read-only `/config show` stays available to normal write-scoped operator clients.
- `mcp: true` enables `/mcp` for OpenClaw-managed MCP server config under `mcp.servers`.
- `plugins: true` enables `/plugins` for plugin discovery, install, and enable/disable controls.
- `channels.<provider>.configWrites` gates config mutations per channel (default: true).
- For multi-account channels, `channels.<provider>.accounts.<id>.configWrites` also gates writes that target that account (for example `/allowlist --config --account <id>` or `/config set channels.<provider>.accounts.<id>...`).
- `restart: false` disables `/restart` and gateway restart tool actions. Default: `true`.
- `ownerAllowFrom` is the explicit owner allowlist for owner-only commands/tools. It is separate from `allowFrom`.
- `ownerDisplay: "hash"` hashes owner ids in the system prompt. Set `ownerDisplaySecret` to control hashing.
- `allowFrom` is per-provider. When set, it is the **only** authorization source (channel allowlists/pairing and `useAccessGroups` are ignored).
- `useAccessGroups: false` allows commands to bypass access-group policies when `allowFrom` is not set.
- Command docs map:
- built-in + bundled catalog: [Slash Commands](/tools/slash-commands)
- channel-specific command surfaces: [Channels](/channels)
- QQ Bot commands: [QQ Bot](/channels/qqbot)
- pairing commands: [Pairing](/channels/pairing)
- LINE card command: [LINE](/channels/line)
- memory dreaming: [Dreaming](/concepts/dreaming)
</Accordion>
@@ -1049,7 +1088,7 @@ Time format in system prompt. Default: `auto` (OS preference).
- Typical values: `qwen/wan2.6-t2v`, `qwen/wan2.6-i2v`, `qwen/wan2.6-r2v`, `qwen/wan2.6-r2v-flash`, or `qwen/wan2.7-r2v`.
- If omitted, `video_generate` can still infer an auth-backed provider default. It tries the current default provider first, then the remaining registered video-generation providers in provider-id order.
- If you select a provider/model directly, configure the matching provider auth/API key too.
- The bundled Qwen video-generation provider currently supports up to 1 output video, 1 input image, 4 input videos, 10 seconds duration, and provider-level `size`, `aspectRatio`, `resolution`, `audio`, and `watermark` options.
- The bundled Qwen video-generation provider supports up to 1 output video, 1 input image, 4 input videos, 10 seconds duration, and provider-level `size`, `aspectRatio`, `resolution`, `audio`, and `watermark` options.
- `pdfModel`: accepts either a string (`"provider/model"`) or an object (`{ primary, fallbacks }`).
- Used by the `pdf` tool for model routing.
- If omitted, the PDF tool falls back to `imageModel`, then to the resolved session/default model.
@@ -1117,6 +1156,20 @@ Optional CLI backends for text-only fallback runs (no tool calls). Useful as a b
- Sessions supported when `sessionArg` is set.
- Image pass-through supported when `imageArg` accepts file paths.
### `agents.defaults.systemPromptOverride`
Replace the entire OpenClaw-assembled system prompt with a fixed string. Set at the default level (`agents.defaults.systemPromptOverride`) or per agent (`agents.list[].systemPromptOverride`). Per-agent values take precedence; an empty or whitespace-only value is ignored. Useful for controlled prompt experiments.
```json5
{
agents: {
defaults: {
systemPromptOverride: "You are a helpful assistant.",
},
},
}
```
### `agents.defaults.heartbeat`
Periodic heartbeat runs.
@@ -1129,6 +1182,7 @@ Periodic heartbeat runs.
every: "30m", // 0m disables
model: "openai/gpt-5.4-mini",
includeReasoning: false,
includeSystemPromptSection: true, // default: true; false omits the Heartbeat section from the system prompt
lightContext: false, // default: false; true keeps only HEARTBEAT.md from workspace bootstrap files
isolatedSession: false, // default: false; true runs each heartbeat in a fresh session (no conversation history)
session: "main",
@@ -1145,6 +1199,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.
- `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.
@@ -1503,7 +1558,7 @@ noVNC observer access uses VNC auth by default and OpenClaw emits a short-lived
</Accordion>
Browser sandboxing and `sandbox.docker.binds` are currently Docker-only.
Browser sandboxing and `sandbox.docker.binds` are Docker-only.
Build images:
@@ -1780,7 +1835,7 @@ See [Multi-Agent Sandbox & Tools](/tools/multi-agent-sandbox-tools) for preceden
- **`parentForkMaxTokens`**: max parent-session `totalTokens` allowed when creating a forked thread session (default `100000`).
- If parent `totalTokens` is above this value, OpenClaw starts a fresh thread session instead of inheriting parent transcript history.
- Set `0` to disable this guard and always allow parent forking.
- **`mainKey`**: legacy field. Runtime now always uses `"main"` for the main direct-chat bucket.
- **`mainKey`**: legacy field. Runtime always uses `"main"` for the main direct-chat bucket.
- **`agentToAgent.maxPingPongTurns`**: maximum reply-back turns between agents during agent-to-agent exchanges (integer, range: `0``5`). `0` disables ping-pong chaining.
- **`sendPolicy`**: match by `channel`, `chatType` (`direct|group|channel`, with legacy `dm` alias), `keyPrefix`, or `rawKeyPrefix`. First deny wins.
- **`maintenance`**: session-store cleanup + retention controls.
@@ -1904,7 +1959,7 @@ Batches rapid text-only messages from the same sender into a single agent turn.
}
```
- `auto` controls auto-TTS. `/tts off|always|inbound|tagged` overrides per session.
- `auto` controls the default auto-TTS mode: `off`, `always`, `inbound`, or `tagged`. `/tts on|off` can override local prefs, and `/tts status` shows the effective state.
- `summaryModel` overrides `agents.defaults.model.primary` for auto-summary.
- `modelOverrides` is enabled by default; `modelOverrides.allowProvider` defaults to `false` (opt-in).
- API keys fall back to `ELEVENLABS_API_KEY`/`XI_API_KEY` and `OPENAI_API_KEY`.
@@ -2476,8 +2531,8 @@ Set `ZAI_API_KEY`. `z.ai/*` and `z-ai/*` are accepted aliases. Shortcut: `opencl
For the China endpoint: `baseUrl: "https://api.moonshot.cn/v1"` or `openclaw onboard --auth-choice moonshot-api-key-cn`.
Native Moonshot endpoints advertise streaming usage compatibility on the shared
`openai-completions` transport, and OpenClaw now keys that off endpoint
capabilities rather than the built-in provider id alone.
`openai-completions` transport, and OpenClaw keys that off endpoint capabilities
rather than the built-in provider id alone.
</Accordion>
@@ -2577,7 +2632,7 @@ Base URL should omit `/v1` (Anthropic client appends it). Shortcut: `openclaw on
Set `MINIMAX_API_KEY`. Shortcuts:
`openclaw onboard --auth-choice minimax-global-api` or
`openclaw onboard --auth-choice minimax-cn-api`.
The model catalog now defaults to M2.7 only.
The model catalog defaults to M2.7 only.
On the Anthropic-compatible streaming path, OpenClaw disables MiniMax thinking
by default unless you explicitly set `thinking` yourself. `/fast on` or
`params.fastMode: true` rewrites `MiniMax-M2.7` to
@@ -2676,6 +2731,12 @@ See [Local Models](/gateway/local-models). TL;DR: run a large local model via LM
- `enabled`: master dreaming switch (default `false`).
- `frequency`: cron cadence for each full dreaming sweep (`"0 3 * * *"` by default).
- phase policy and thresholds are implementation details (not user-facing config keys).
- Full memory config lives in [Memory configuration reference](/reference/memory-config):
- `agents.defaults.memorySearch.*`
- `memory.backend`
- `memory.citations`
- `memory.qmd.*`
- `plugins.entries.memory-core.config.dreaming`
- Enabled Claude bundle plugins can also contribute embedded Pi defaults from `settings.json`; OpenClaw applies those as sanitized agent settings, not as raw OpenClaw config patches.
- `plugins.slots.memory`: pick the active memory plugin id, or `"none"` to disable memory plugins.
- `plugins.slots.contextEngine`: pick the active context engine plugin id; defaults to `"legacy"` unless you install and select another engine.
@@ -3577,7 +3638,7 @@ Applies only to one-shot cron jobs. Recurring jobs use separate failure handling
- `to`: explicit announce target or webhook URL. Required for webhook mode.
- `accountId`: optional account override for delivery.
- Per-job `delivery.failureDestination` overrides this global default.
- When neither global nor per-job failure destination is set, jobs that already deliver via `announce` now fall back to that primary announce target on failure.
- When neither global nor per-job failure destination is set, jobs that already deliver via `announce` fall back to that primary announce target on failure.
- `delivery.failureDestination` is only supported for `sessionTarget="isolated"` jobs unless the job's primary `delivery.mode` is `"webhook"`.
See [Cron Jobs](/automation/cron-jobs). Isolated cron executions are tracked as [background tasks](/automation/tasks).
+4
View File
@@ -72,6 +72,8 @@ Schema tooling notes:
- `openclaw config schema` prints the same JSON Schema family used by Control UI
and config validation.
- Treat that schema output as the canonical machine-readable contract for
`openclaw.json`; this overview and the configuration reference summarize it.
- Field `title` and `description` values are carried into the schema output for
editor and form tooling.
- Nested object, wildcard (`*`), and array-item (`[]`) entries inherit the same
@@ -84,6 +86,8 @@ Schema tooling notes:
summaries for drill-down tooling.
- Runtime plugin/channel schemas are merged in when the gateway can load the
current manifest registry.
- `pnpm config:docs:check` detects drift between docs-facing config baseline
artifacts and the current schema surface.
When validation fails:
+39
View File
@@ -93,6 +93,40 @@ cat ~/.openclaw/openclaw.json
- Source install checks (pnpm workspace mismatch, missing UI assets, missing tsx binary).
- Writes updated config + wizard metadata.
## Dreams UI backfill and reset
The Control UI Dreams scene includes **Backfill**, **Reset**, and **Clear Grounded**
actions for the grounded dreaming workflow. These actions use gateway
doctor-style RPC methods, but they are **not** part of `openclaw doctor` CLI
repair/migration.
What they do:
- **Backfill** scans historical `memory/YYYY-MM-DD.md` files in the active
workspace, runs the grounded REM diary pass, and writes reversible backfill
entries into `DREAMS.md`.
- **Reset** removes only those marked backfill diary entries from `DREAMS.md`.
- **Clear Grounded** removes only staged grounded-only short-term entries that
came from historical replay and have not accumulated live recall or daily
support yet.
What they do **not** do by themselves:
- they do not edit `MEMORY.md`
- they do not run full doctor migrations
- they do not automatically stage grounded candidates into the live short-term
promotion store unless you explicitly run the staged CLI path first
If you want grounded historical replay to influence the normal deep promotion
lane, use the CLI flow instead:
```bash
openclaw memory rem-backfill --path ./memory --stage-short-term
```
That stages grounded durable candidates into the short-term dreaming store while
keeping `DREAMS.md` as the review surface.
## Detailed behavior and rationale
### 0) Optional update (git installs)
@@ -323,6 +357,11 @@ Anthropic setup-token path.
Refresh prompts only appear when running interactively (TTY); `--non-interactive`
skips refresh attempts.
When an OAuth refresh fails permanently (for example `refresh_token_reused`,
`invalid_grant`, or a provider telling you to sign in again), doctor reports
that re-auth is required and prints the exact `openclaw models auth login --provider ...`
command to run.
Doctor also reports auth profiles that are temporarily unusable due to:
- short cooldowns (rate limits/timeouts/auth failures)
+2
View File
@@ -203,6 +203,7 @@ Live tests are split into two layers so we can isolate failures:
- `OPENCLAW_LIVE_MODELS=modern` to run the modern allowlist (Opus/Sonnet 4.6+, GPT-5.x + Codex, Gemini 3, GLM 4.7, MiniMax M2.7, Grok 4)
- `OPENCLAW_LIVE_MODELS=all` is an alias for the modern allowlist
- or `OPENCLAW_LIVE_MODELS="openai/gpt-5.4,anthropic/claude-opus-4-6,..."` (comma allowlist)
- Modern/all sweeps default to a curated high-signal cap; set `OPENCLAW_LIVE_MAX_MODELS=0` for an exhaustive modern sweep or a positive number for a smaller cap.
- How to select providers:
- `OPENCLAW_LIVE_PROVIDERS="google,google-antigravity,google-gemini-cli"` (comma allowlist)
- Where keys come from:
@@ -234,6 +235,7 @@ Live tests are split into two layers so we can isolate failures:
- Default: modern allowlist (Opus/Sonnet 4.6+, GPT-5.x + Codex, Gemini 3, GLM 4.7, MiniMax M2.7, Grok 4)
- `OPENCLAW_LIVE_GATEWAY_MODELS=all` is an alias for the modern allowlist
- Or set `OPENCLAW_LIVE_GATEWAY_MODELS="provider/model"` (or comma list) to narrow
- Modern/all gateway sweeps default to a curated high-signal cap; set `OPENCLAW_LIVE_GATEWAY_MAX_MODELS=0` for an exhaustive modern sweep or a positive number for a smaller cap.
- How to select providers (avoid “OpenRouter everything”):
- `OPENCLAW_LIVE_GATEWAY_PROVIDERS="google,google-antigravity,google-gemini-cli,openai,anthropic,zai,minimax"` (comma allowlist)
- Tool + image probes are always on in this live test:
@@ -1,580 +0,0 @@
---
title: "refactor: Make plugin-sdk a real workspace package incrementally"
type: refactor
status: active
date: 2026-04-05
---
# refactor: Make plugin-sdk a real workspace package incrementally
## Overview
This plan introduces a real workspace package for the plugin SDK at
`packages/plugin-sdk` and uses it to opt in a small first wave of extensions to
compiler-enforced package boundaries. The goal is to make illegal relative
imports fail under normal `tsc` for a selected set of bundled provider
extensions, without forcing a repo-wide migration or a giant merge-conflict
surface.
The key incremental move is to run two modes in parallel for a while:
| Mode | Import shape | Who uses it | Enforcement |
| ----------- | ------------------------ | ------------------------------------ | -------------------------------------------- |
| Legacy mode | `openclaw/plugin-sdk/*` | all existing non-opted-in extensions | current permissive behavior remains |
| Opt-in mode | `@openclaw/plugin-sdk/*` | first-wave extensions only | package-local `rootDir` + project references |
## Problem Frame
The current repo exports a large public plugin SDK surface, but it is not a real
workspace package. Instead:
- root `tsconfig.json` maps `openclaw/plugin-sdk/*` directly to
`src/plugin-sdk/*.ts`
- extensions that were not opted into the previous experiment still share that
global source-alias behavior
- adding `rootDir` only works when allowed SDK imports stop resolving into raw
repo source
That means the repo can describe the desired boundary policy, but TypeScript
does not enforce it cleanly for most extensions.
You want an incremental path that:
- makes `plugin-sdk` real
- moves the SDK toward a workspace package named `@openclaw/plugin-sdk`
- changes only about 10 extensions in the first PR
- leaves the rest of the extension tree on the old scheme until later cleanup
- avoids the `tsconfig.plugin-sdk.dts.json` + postinstall-generated declaration
workflow as the primary mechanism for the first-wave rollout
## Requirements Trace
- R1. Create a real workspace package for the plugin SDK under `packages/`.
- R2. Name the new package `@openclaw/plugin-sdk`.
- R3. Give the new SDK package its own `package.json` and `tsconfig.json`.
- R4. Keep legacy `openclaw/plugin-sdk/*` imports working for non-opted-in
extensions during the migration window.
- R5. Opt in only a small first wave of extensions in the first PR.
- R6. The first-wave extensions must fail closed for relative imports that leave
their package root.
- R7. The first-wave extensions must consume the SDK through a package
dependency and a TS project reference, not through root `paths` aliases.
- R8. The plan must avoid a repo-wide mandatory postinstall generation step for
editor correctness.
- R9. The first-wave rollout must be reviewable and mergeable as a moderate PR,
not a repo-wide 300+ file refactor.
## Scope Boundaries
- No full migration of all bundled extensions in the first PR.
- No requirement to delete `src/plugin-sdk` in the first PR.
- No requirement to rewire every root build or test path to use the new package
immediately.
- No attempt to force VS Code squiggles for every non-opted-in extension.
- No broad lint cleanup for the rest of the extension tree.
- No large runtime behavior changes beyond import resolution, package ownership,
and boundary enforcement for the opted-in extensions.
## Context & Research
### Relevant Code and Patterns
- `pnpm-workspace.yaml` already includes `packages/*` and `extensions/*`, so a
new workspace package under `packages/plugin-sdk` fits the existing repo
layout.
- Existing workspace packages such as `packages/memory-host-sdk/package.json`
and `packages/plugin-package-contract/package.json` already use package-local
`exports` maps rooted in `src/*.ts`.
- Root `package.json` currently publishes the SDK surface through `./plugin-sdk`
and `./plugin-sdk/*` exports backed by `dist/plugin-sdk/*.js` and
`dist/plugin-sdk/*.d.ts`.
- `src/plugin-sdk/entrypoints.ts` and `scripts/lib/plugin-sdk-entrypoints.json`
already act as the canonical entrypoint inventory for the SDK surface.
- Root `tsconfig.json` currently maps:
- `openclaw/plugin-sdk` -> `src/plugin-sdk/index.ts`
- `openclaw/plugin-sdk/*` -> `src/plugin-sdk/*.ts`
- The previous boundary experiment showed that package-local `rootDir` works for
illegal relative imports only after allowed SDK imports stop resolving to raw
source outside the extension package.
### First-Wave Extension Set
This plan assumes the first wave is the provider-heavy set that is least likely
to drag in complex channel-runtime edge cases:
- `extensions/anthropic`
- `extensions/exa`
- `extensions/firecrawl`
- `extensions/groq`
- `extensions/mistral`
- `extensions/openai`
- `extensions/perplexity`
- `extensions/tavily`
- `extensions/together`
- `extensions/xai`
### First-Wave SDK Surface Inventory
The first-wave extensions currently import a manageable subset of SDK subpaths.
The initial `@openclaw/plugin-sdk` package only needs to cover these:
- `agent-runtime`
- `cli-runtime`
- `config-runtime`
- `core`
- `image-generation`
- `media-runtime`
- `media-understanding`
- `plugin-entry`
- `plugin-runtime`
- `provider-auth`
- `provider-auth-api-key`
- `provider-auth-login`
- `provider-auth-runtime`
- `provider-catalog-shared`
- `provider-entry`
- `provider-http`
- `provider-model-shared`
- `provider-onboard`
- `provider-stream-family`
- `provider-stream-shared`
- `provider-tools`
- `provider-usage`
- `provider-web-fetch`
- `provider-web-search`
- `realtime-transcription`
- `realtime-voice`
- `runtime-env`
- `secret-input`
- `security-runtime`
- `speech`
- `testing`
### Institutional Learnings
- No relevant `docs/solutions/` entries were present in this worktree.
### External References
- No external research was needed for this plan. The repo already contains the
relevant workspace-package and SDK-export patterns.
## Key Technical Decisions
- Introduce `@openclaw/plugin-sdk` as a new workspace package while keeping the
legacy root `openclaw/plugin-sdk/*` surface alive during migration.
Rationale: this lets a first-wave extension set move onto real package
resolution without forcing every extension and every root build path to change
at once.
- Use a dedicated opt-in boundary base config such as
`extensions/tsconfig.package-boundary.base.json` instead of replacing the
existing extension base for everyone.
Rationale: the repo needs to support both legacy and opt-in extension modes
simultaneously during migration.
- Use TS project references from first-wave extensions to
`packages/plugin-sdk/tsconfig.json` and set
`disableSourceOfProjectReferenceRedirect` for the opt-in boundary mode.
Rationale: this gives `tsc` a real package graph while discouraging editor and
compiler fallback to raw source traversal.
- Keep `@openclaw/plugin-sdk` private in the first wave.
Rationale: the immediate goal is internal boundary enforcement and migration
safety, not publishing a second external SDK contract before the surface is
stable.
- Move only the first-wave SDK subpaths in the first implementation slice, and
keep compatibility bridges for the rest.
Rationale: physically moving all 315 `src/plugin-sdk/*.ts` files in one PR is
exactly the merge-conflict surface this plan is trying to avoid.
- Do not rely on `scripts/postinstall-bundled-plugins.mjs` to build SDK
declarations for the first wave.
Rationale: explicit build/reference flows are easier to reason about and keep
repo behavior more predictable.
## Open Questions
### Resolved During Planning
- Which extensions should be in the first wave?
Use the 10 provider/web-search extensions listed above because they are more
structurally isolated than the heavier channel packages.
- Should the first PR replace the entire extension tree?
No. The first PR should support two modes in parallel and only opt in the
first wave.
- Should the first wave require a postinstall declaration build?
No. The package/reference graph should be explicit, and CI should run the
relevant package-local typecheck intentionally.
### Deferred to Implementation
- Whether the first-wave package can point directly at package-local `src/*.ts`
via project references alone, or whether a small declaration-emission step is
still required for the `@openclaw/plugin-sdk` package.
This is an implementation-owned TS graph validation question.
- Whether the root `openclaw` package should proxy first-wave SDK subpaths to
`packages/plugin-sdk` outputs immediately or continue using generated
compatibility shims under `src/plugin-sdk`.
This is a compatibility and build-shape detail that depends on the minimal
implementation path that keeps CI green.
## High-Level Technical Design
> This illustrates the intended approach and is directional guidance for review, not implementation specification. The implementing agent should treat it as context, not code to reproduce.
```mermaid
flowchart TB
subgraph Legacy["Legacy extensions (unchanged)"]
L1["extensions/*\nopenclaw/plugin-sdk/*"]
L2["root tsconfig paths"]
L1 --> L2
L2 --> L3["src/plugin-sdk/*"]
end
subgraph OptIn["First-wave extensions"]
O1["10 opted-in extensions"]
O2["extensions/tsconfig.package-boundary.base.json"]
O3["rootDir = '.'\nproject reference"]
O4["@openclaw/plugin-sdk"]
O1 --> O2
O2 --> O3
O3 --> O4
end
subgraph SDK["New workspace package"]
P1["packages/plugin-sdk/package.json"]
P2["packages/plugin-sdk/tsconfig.json"]
P3["packages/plugin-sdk/src/<first-wave-subpaths>.ts"]
P1 --> P2
P2 --> P3
end
O4 --> SDK
```
## Implementation Units
- [ ] **Unit 1: Introduce the real `@openclaw/plugin-sdk` workspace package**
**Goal:** Create a real workspace package for the SDK that can own the
first-wave subpath surface without forcing a repo-wide migration.
**Requirements:** R1, R2, R3, R8, R9
**Dependencies:** None
**Files:**
- Create: `packages/plugin-sdk/package.json`
- Create: `packages/plugin-sdk/tsconfig.json`
- Create: `packages/plugin-sdk/src/index.ts`
- Create: `packages/plugin-sdk/src/*.ts` for the first-wave SDK subpaths
- Modify: `pnpm-workspace.yaml` only if package-glob adjustments are needed
- Modify: `package.json`
- Modify: `src/plugin-sdk/entrypoints.ts`
- Modify: `scripts/lib/plugin-sdk-entrypoints.json`
- Test: `src/plugins/contracts/plugin-sdk-workspace-package.contract.test.ts`
**Approach:**
- Add a new workspace package named `@openclaw/plugin-sdk`.
- Start with the first-wave SDK subpaths only, not the entire 315-file tree.
- If directly moving a first-wave entrypoint would create an oversized diff, the
first PR may introduce that subpath in `packages/plugin-sdk/src` as a thin
package wrapper first and then flip the source of truth to the package in a
follow-up PR for that subpath cluster.
- Reuse the existing entrypoint inventory machinery so the first-wave package
surface is declared in one canonical place.
- Keep the root package exports alive for legacy users while the workspace
package becomes the new opt-in contract.
**Patterns to follow:**
- `packages/memory-host-sdk/package.json`
- `packages/plugin-package-contract/package.json`
- `src/plugin-sdk/entrypoints.ts`
**Test scenarios:**
- Happy path: the workspace package exports every first-wave subpath listed in
the plan and no required first-wave export is missing.
- Edge case: package export metadata remains stable when the first-wave entry
list is re-generated or compared against the canonical inventory.
- Integration: root package legacy SDK exports remain present after introducing
the new workspace package.
**Verification:**
- The repo contains a valid `@openclaw/plugin-sdk` workspace package with a
stable first-wave export map and no legacy export regression in root
`package.json`.
- [ ] **Unit 2: Add an opt-in TS boundary mode for package-enforced extensions**
**Goal:** Define the TS configuration mode that opted-in extensions will use,
while leaving the existing extension TS behavior unchanged for everyone else.
**Requirements:** R4, R6, R7, R8, R9
**Dependencies:** Unit 1
**Files:**
- Create: `extensions/tsconfig.package-boundary.base.json`
- Create: `tsconfig.boundary-optin.json`
- Modify: `extensions/xai/tsconfig.json`
- Modify: `extensions/openai/tsconfig.json`
- Modify: `extensions/anthropic/tsconfig.json`
- Modify: `extensions/mistral/tsconfig.json`
- Modify: `extensions/groq/tsconfig.json`
- Modify: `extensions/together/tsconfig.json`
- Modify: `extensions/perplexity/tsconfig.json`
- Modify: `extensions/tavily/tsconfig.json`
- Modify: `extensions/exa/tsconfig.json`
- Modify: `extensions/firecrawl/tsconfig.json`
- Test: `src/plugins/contracts/extension-package-project-boundaries.test.ts`
- Test: `test/extension-package-tsc-boundary.test.ts`
**Approach:**
- Leave `extensions/tsconfig.base.json` in place for legacy extensions.
- Add a new opt-in base config that:
- sets `rootDir: "."`
- references `packages/plugin-sdk`
- enables `composite`
- disables project-reference source redirect when needed
- Add a dedicated solution config for the first-wave typecheck graph instead of
reshaping the root repo TS project in the same PR.
**Execution note:** Start with a failing package-local canary typecheck for one
opted-in extension before applying the pattern to all 10.
**Patterns to follow:**
- Existing package-local extension `tsconfig.json` pattern from the prior
boundary work
- Workspace package pattern from `packages/memory-host-sdk`
**Test scenarios:**
- Happy path: each opted-in extension typechecks successfully through the
package-boundary TS config.
- Error path: a canary relative import from `../../src/cli/acp-cli.ts` fails
with `TS6059` for an opted-in extension.
- Integration: non-opted-in extensions remain untouched and do not need to
participate in the new solution config.
**Verification:**
- There is a dedicated typecheck graph for the 10 opted-in extensions, and bad
relative imports from one of them fail through normal `tsc`.
- [ ] **Unit 3: Migrate the first-wave extensions onto `@openclaw/plugin-sdk`**
**Goal:** Change the first-wave extensions to consume the real SDK package
through dependency metadata, project references, and package-name imports.
**Requirements:** R5, R6, R7, R9
**Dependencies:** Unit 2
**Files:**
- Modify: `extensions/anthropic/package.json`
- Modify: `extensions/exa/package.json`
- Modify: `extensions/firecrawl/package.json`
- Modify: `extensions/groq/package.json`
- Modify: `extensions/mistral/package.json`
- Modify: `extensions/openai/package.json`
- Modify: `extensions/perplexity/package.json`
- Modify: `extensions/tavily/package.json`
- Modify: `extensions/together/package.json`
- Modify: `extensions/xai/package.json`
- Modify: production and test imports under each of the 10 extension roots that
currently reference `openclaw/plugin-sdk/*`
**Approach:**
- Add `@openclaw/plugin-sdk: workspace:*` to the first-wave extension
`devDependencies`.
- Replace `openclaw/plugin-sdk/*` imports in those packages with
`@openclaw/plugin-sdk/*`.
- Keep local extension-internal imports on local barrels such as `./api.ts` and
`./runtime-api.ts`.
- Do not change non-opted-in extensions in this PR.
**Patterns to follow:**
- Existing extension-local import barrels (`api.ts`, `runtime-api.ts`)
- Package dependency shape used by other `@openclaw/*` workspace packages
**Test scenarios:**
- Happy path: each migrated extension still registers/loads through its existing
plugin tests after the import rewrite.
- Edge case: test-only SDK imports in the opted-in extension set still resolve
correctly through the new package.
- Integration: migrated extensions do not require root `openclaw/plugin-sdk/*`
aliases for typechecking.
**Verification:**
- The first-wave extensions build and test against `@openclaw/plugin-sdk`
without needing the legacy root SDK alias path.
- [ ] **Unit 4: Preserve legacy compatibility while the migration is partial**
**Goal:** Keep the rest of the repo working while the SDK exists in both legacy
and new-package forms during migration.
**Requirements:** R4, R8, R9
**Dependencies:** Units 1-3
**Files:**
- Modify: `src/plugin-sdk/*.ts` for first-wave compatibility shims as needed
- Modify: `package.json`
- Modify: build or export plumbing that assembles SDK artifacts
- Test: `src/plugins/contracts/plugin-sdk-runtime-api-guardrails.test.ts`
- Test: `src/plugins/contracts/plugin-sdk-index.bundle.test.ts`
**Approach:**
- Keep root `openclaw/plugin-sdk/*` as the compatibility surface for legacy
extensions and for external consumers that are not moving yet.
- Use either generated shims or root-export proxy wiring for the first-wave
subpaths that have moved into `packages/plugin-sdk`.
- Do not attempt to retire the root SDK surface in this phase.
**Patterns to follow:**
- Existing root SDK export generation via `src/plugin-sdk/entrypoints.ts`
- Existing package export compatibility in root `package.json`
**Test scenarios:**
- Happy path: a legacy root SDK import still resolves for a non-opted-in
extension after the new package exists.
- Edge case: a first-wave subpath works through both the legacy root surface and
the new package surface during the migration window.
- Integration: plugin-sdk index/bundle contract tests continue to see a coherent
public surface.
**Verification:**
- The repo supports both legacy and opt-in SDK consumption modes without
breaking unchanged extensions.
- [ ] **Unit 5: Add scoped enforcement and document the migration contract**
**Goal:** Land CI and contributor guidance that enforce the new behavior for the
first wave without pretending the entire extension tree is migrated.
**Requirements:** R5, R6, R8, R9
**Dependencies:** Units 1-4
**Files:**
- Modify: `package.json`
- Modify: CI workflow files that should run the opt-in boundary typecheck
- Modify: `AGENTS.md`
- Modify: `docs/plugins/sdk-overview.md`
- Modify: `docs/plugins/sdk-entrypoints.md`
- Modify: `docs/plans/2026-04-05-001-refactor-extension-package-resolution-boundary-plan.md`
**Approach:**
- Add an explicit first-wave gate, such as a dedicated `tsc -b` solution run for
`packages/plugin-sdk` plus the 10 opted-in extensions.
- Document that the repo now supports both legacy and opt-in extension modes,
and that new extension boundary work should prefer the new package route.
- Record the next-wave migration rule so later PRs can add more extensions
without re-litigating the architecture.
**Patterns to follow:**
- Existing contract tests under `src/plugins/contracts/`
- Existing docs updates that explain staged migrations
**Test scenarios:**
- Happy path: the new first-wave typecheck gate passes for the workspace package
and the opted-in extensions.
- Error path: introducing a new illegal relative import in an opted-in
extension fails the scoped typecheck gate.
- Integration: CI does not require non-opted-in extensions to satisfy the new
package-boundary mode yet.
**Verification:**
- The first-wave enforcement path is documented, tested, and runnable without
forcing the entire extension tree to migrate.
## System-Wide Impact
- **Interaction graph:** this work touches the SDK source-of-truth, root package
exports, extension package metadata, TS graph layout, and CI verification.
- **Error propagation:** the main intended failure mode becomes compile-time TS
errors (`TS6059`) in opted-in extensions instead of custom script-only
failures.
- **State lifecycle risks:** dual-surface migration introduces drift risk between
root compatibility exports and the new workspace package.
- **API surface parity:** first-wave subpaths must remain semantically identical
through both `openclaw/plugin-sdk/*` and `@openclaw/plugin-sdk/*` during the
transition.
- **Integration coverage:** unit tests are not enough; scoped package-graph
typechecks are required to prove the boundary.
- **Unchanged invariants:** non-opted-in extensions keep their current behavior
in PR 1. This plan does not claim repo-wide import-boundary enforcement.
## Risks & Dependencies
| Risk | Mitigation |
| ------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------- |
| The first-wave package still resolves back into raw source and `rootDir` does not actually fail closed | Make the first implementation step a package-reference canary on one opted-in extension before widening to the full set |
| Moving too much SDK source at once recreates the original merge-conflict problem | Move only the first-wave subpaths in the first PR and keep root compatibility bridges |
| Legacy and new SDK surfaces drift semantically | Keep a single entrypoint inventory, add compatibility contract tests, and make dual-surface parity explicit |
| Root repo build/test paths accidentally start depending on the new package in uncontrolled ways | Use a dedicated opt-in solution config and keep root-wide TS topology changes out of the first PR |
## Phased Delivery
### Phase 1
- Introduce `@openclaw/plugin-sdk`
- Define the first-wave subpath surface
- Prove one opted-in extension can fail closed through `rootDir`
### Phase 2
- Opt in the 10 first-wave extensions
- Keep root compatibility alive for everyone else
### Phase 3
- Add more extensions in later PRs
- Move more SDK subpaths into the workspace package
- Retire root compatibility only after the legacy extension set is gone
## Documentation / Operational Notes
- The first PR should explicitly describe itself as a dual-mode migration, not a
repo-wide enforcement completion.
- The migration guide should make it easy for later PRs to add more extensions
by following the same package/dependency/reference pattern.
## Sources & References
- Prior plan: `docs/plans/2026-04-05-001-refactor-extension-package-resolution-boundary-plan.md`
- Workspace config: `pnpm-workspace.yaml`
- Existing SDK entrypoint inventory: `src/plugin-sdk/entrypoints.ts`
- Existing root SDK exports: `package.json`
- Existing workspace package patterns:
- `packages/memory-host-sdk/package.json`
- `packages/plugin-package-contract/package.json`
+8 -5
View File
@@ -610,9 +610,10 @@ conversation, and it runs after core approval handling finishes.
Provider plugins now have two layers:
- manifest metadata: `providerAuthEnvVars` for cheap provider env-auth lookup
before runtime load, `channelEnvVars` for cheap channel env/setup lookup
before runtime load, plus `providerAuthChoices` for cheap onboarding/auth-choice
labels and CLI flag metadata before runtime load
before runtime load, `providerAuthAliases` for provider variants that share
auth, `channelEnvVars` for cheap channel env/setup lookup before runtime
load, plus `providerAuthChoices` for cheap onboarding/auth-choice labels and
CLI flag metadata before runtime load
- config-time hooks: `catalog` / legacy `discovery` plus `applyConfigDefaults`
- runtime hooks: `normalizeModelId`, `normalizeTransport`,
`normalizeConfig`,
@@ -640,8 +641,10 @@ needing a whole custom inference transport.
Use manifest `providerAuthEnvVars` when the provider has env-based credentials
that generic auth/status/model-picker paths should see without loading plugin
runtime. Use manifest `providerAuthChoices` when onboarding/auth-choice CLI
surfaces should know the provider's choice id, group labels, and simple
runtime. Use manifest `providerAuthAliases` when one provider id should reuse
another provider id's env vars, auth profiles, config-backed auth, and API-key
onboarding choice. Use manifest `providerAuthChoices` when onboarding/auth-choice
CLI surfaces should know the provider's choice id, group labels, and simple
one-flag auth wiring without loading provider runtime. Keep provider runtime
`envVars` for operator-facing hints such as onboarding labels or OAuth
client-id/client-secret setup vars.
+7
View File
@@ -93,6 +93,9 @@ Those belong in your plugin code and `package.json`.
"providerAuthEnvVars": {
"openrouter": ["OPENROUTER_API_KEY"]
},
"providerAuthAliases": {
"openrouter-coding": "openrouter"
},
"channelEnvVars": {
"openrouter-chatops": ["OPENROUTER_CHATOPS_TOKEN"]
},
@@ -145,6 +148,7 @@ Those belong in your plugin code and `package.json`.
| `modelSupport` | No | `object` | Manifest-owned shorthand model-family metadata used to auto-load the plugin before runtime. |
| `cliBackends` | No | `string[]` | CLI inference backend ids owned by this plugin. Used for startup auto-activation from explicit config refs. |
| `providerAuthEnvVars` | No | `Record<string, string[]>` | Cheap provider-auth env metadata that OpenClaw can inspect without loading plugin code. |
| `providerAuthAliases` | No | `Record<string, string>` | Provider ids that should reuse another provider id for auth lookup, for example a coding provider that shares the base provider API key and auth profiles. |
| `channelEnvVars` | No | `Record<string, string[]>` | Cheap channel env metadata that OpenClaw can inspect without loading plugin code. Use this for env-driven channel setup or auth surfaces that generic startup/config helpers should see. |
| `providerAuthChoices` | No | `object[]` | Cheap auth-choice metadata for onboarding pickers, preferred-provider resolution, and simple CLI flag wiring. |
| `contracts` | No | `object` | Static bundled capability snapshot for speech, realtime transcription, realtime voice, media-understanding, image-generation, music-generation, video-generation, web-fetch, web search, and tool ownership. |
@@ -440,6 +444,9 @@ See [Configuration reference](/gateway/configuration) for the full `plugins.*` s
- `providerAuthEnvVars` is the cheap metadata path for auth probes, env-marker
validation, and similar provider-auth surfaces that should not boot plugin
runtime just to inspect env names.
- `providerAuthAliases` lets provider variants reuse another provider's auth
env vars, auth profiles, config-backed auth, and API-key onboarding choice
without hardcoding that relationship in core.
- `channelEnvVars` is the cheap metadata path for shell-env fallback, setup
prompts, and similar channel surfaces that should not boot plugin runtime
just to inspect env names.
+4 -1
View File
@@ -245,6 +245,7 @@ Current bundled provider examples:
| `plugin-sdk/allow-from` | Allowlist formatting | `formatAllowFromLowercase` |
| `plugin-sdk/allowlist-resolution` | Allowlist input mapping | `mapAllowlistResolutionInputs` |
| `plugin-sdk/command-auth` | Command gating and command-surface helpers | `resolveControlCommandGate`, sender-authorization helpers, command registry helpers |
| `plugin-sdk/command-status` | Command status/help renderers | `buildCommandsMessage`, `buildCommandsMessagePaginated`, `buildHelpMessage` |
| `plugin-sdk/secret-input` | Secret input parsing | Secret input helpers |
| `plugin-sdk/webhook-ingress` | Webhook request helpers | Webhook target utilities |
| `plugin-sdk/webhook-request-guards` | Webhook body guard helpers | Request body read/limit helpers |
@@ -262,6 +263,7 @@ Current bundled provider examples:
| `plugin-sdk/request-url` | Request URL helpers | Extract string URLs from request-like inputs |
| `plugin-sdk/run-command` | Timed command helpers | Timed command runner with normalized stdout/stderr |
| `plugin-sdk/param-readers` | Param readers | Common tool/CLI param readers |
| `plugin-sdk/tool-payload` | Tool payload extraction | Extract normalized payloads from tool result objects |
| `plugin-sdk/tool-send` | Tool send extraction | Extract canonical send target fields from tool args |
| `plugin-sdk/temp-path` | Temp path helpers | Shared temp-download path helpers |
| `plugin-sdk/logging-core` | Logging helpers | Subsystem logger and redaction helpers |
@@ -279,7 +281,8 @@ Current bundled provider examples:
| `plugin-sdk/provider-onboard` | Provider onboarding patches | Onboarding config helpers |
| `plugin-sdk/provider-http` | Provider HTTP helpers | Generic provider HTTP/endpoint capability helpers |
| `plugin-sdk/provider-web-fetch` | Provider web-fetch helpers | Web-fetch provider registration/cache helpers |
| `plugin-sdk/provider-web-search-contract` | Provider web-search contract helpers | Narrow web-search config/credential contract helpers such as `enablePluginInConfig`, `resolveProviderWebSearchPluginConfig`, and scoped credential setters/getters |
| `plugin-sdk/provider-web-search-config-contract` | Provider web-search config helpers | Narrow web-search config/credential helpers for providers that do not need plugin-enable wiring |
| `plugin-sdk/provider-web-search-contract` | Provider web-search contract helpers | Narrow web-search config/credential contract helpers such as `createWebSearchProviderContractFields`, `enablePluginInConfig`, `resolveProviderWebSearchPluginConfig`, and scoped credential setters/getters |
| `plugin-sdk/provider-web-search` | Provider web-search helpers | Web-search provider registration/cache/runtime helpers |
| `plugin-sdk/provider-tools` | Provider tool/schema compat helpers | `ProviderToolCompatFamily`, `buildProviderToolCompatFamilyHooks`, Gemini schema cleanup + diagnostics, and xAI compat helpers such as `resolveXaiModelCompatPatch` / `applyXaiModelCompat` |
| `plugin-sdk/provider-usage` | Provider usage helpers | `fetchClaudeUsage`, `fetchGeminiUsage`, `fetchGithubCopilotUsage`, and other provider usage helpers |
+11 -8
View File
@@ -135,7 +135,8 @@ explicitly promotes one as public.
| `plugin-sdk/provider-http` | Generic provider HTTP/endpoint capability helpers |
| `plugin-sdk/provider-web-fetch-contract` | Narrow web-fetch config/selection contract helpers such as `enablePluginInConfig` and `WebFetchProviderPlugin` |
| `plugin-sdk/provider-web-fetch` | Web-fetch provider registration/cache helpers |
| `plugin-sdk/provider-web-search-contract` | Narrow web-search config/credential contract helpers such as `enablePluginInConfig`, `resolveProviderWebSearchPluginConfig`, and scoped credential setters/getters |
| `plugin-sdk/provider-web-search-config-contract` | Narrow web-search config/credential helpers for providers that do not need plugin-enable wiring |
| `plugin-sdk/provider-web-search-contract` | Narrow web-search config/credential contract helpers such as `createWebSearchProviderContractFields`, `enablePluginInConfig`, `resolveProviderWebSearchPluginConfig`, and scoped credential setters/getters |
| `plugin-sdk/provider-web-search` | Web-search provider registration/cache/runtime helpers |
| `plugin-sdk/provider-tools` | `ProviderToolCompatFamily`, `buildProviderToolCompatFamilyHooks`, Gemini schema cleanup + diagnostics, and xAI compat helpers such as `resolveXaiModelCompatPatch` / `applyXaiModelCompat` |
| `plugin-sdk/provider-usage` | `fetchClaudeUsage` and similar |
@@ -148,6 +149,7 @@ explicitly promotes one as public.
| Subpath | Key exports |
| --- | --- |
| `plugin-sdk/command-auth` | `resolveControlCommandGate`, command registry helpers, sender-authorization helpers |
| `plugin-sdk/command-status` | Command/help message builders such as `buildCommandsMessagePaginated` and `buildHelpMessage` |
| `plugin-sdk/approval-auth-runtime` | Approver resolution and same-chat action-auth helpers |
| `plugin-sdk/approval-client-runtime` | Native exec approval profile/filter helpers |
| `plugin-sdk/approval-delivery-runtime` | Native approval capability/delivery adapters |
@@ -200,6 +202,7 @@ explicitly promotes one as public.
| `plugin-sdk/request-url` | Extract string URLs from fetch/request-like inputs |
| `plugin-sdk/run-command` | Timed command runner with normalized stdout/stderr results |
| `plugin-sdk/param-readers` | Common tool/CLI param readers |
| `plugin-sdk/tool-payload` | Extract normalized payloads from tool result objects |
| `plugin-sdk/tool-send` | Extract canonical send target fields from tool args |
| `plugin-sdk/temp-path` | Shared temp-download path helpers |
| `plugin-sdk/logging-core` | Subsystem logger and redaction helpers |
@@ -387,13 +390,13 @@ AI CLI backend such as `codex-cli`.
### Exclusive slots
| Method | What it registers |
| ------------------------------------------ | ------------------------------------- |
| `api.registerContextEngine(id, factory)` | Context engine (one active at a time) |
| `api.registerMemoryCapability(capability)` | Unified memory capability |
| `api.registerMemoryPromptSection(builder)` | Memory prompt section builder |
| `api.registerMemoryFlushPlan(resolver)` | Memory flush plan resolver |
| `api.registerMemoryRuntime(runtime)` | Memory runtime adapter |
| Method | What it registers |
| ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `api.registerContextEngine(id, factory)` | Context engine (one active at a time). The `assemble()` callback receives `availableTools` and `citationsMode` so the engine can tailor prompt additions. |
| `api.registerMemoryCapability(capability)` | Unified memory capability |
| `api.registerMemoryPromptSection(builder)` | Memory prompt section builder |
| `api.registerMemoryFlushPlan(resolver)` | Memory flush plan resolver |
| `api.registerMemoryRuntime(runtime)` | Memory runtime adapter |
### Memory embedding adapters
+8 -4
View File
@@ -58,6 +58,9 @@ API key auth, and dynamic model resolution.
"providerAuthEnvVars": {
"acme-ai": ["ACME_AI_API_KEY"]
},
"providerAuthAliases": {
"acme-ai-coding": "acme-ai"
},
"providerAuthChoices": [
{
"provider": "acme-ai",
@@ -80,9 +83,10 @@ API key auth, and dynamic model resolution.
</CodeGroup>
The manifest declares `providerAuthEnvVars` so OpenClaw can detect
credentials without loading your plugin runtime. `modelSupport` is optional
and lets OpenClaw auto-load your provider plugin from shorthand model ids
like `acme-large` before runtime hooks exist. If you publish the
credentials without loading your plugin runtime. Add `providerAuthAliases`
when a provider variant should reuse another provider id's auth. `modelSupport`
is optional and lets OpenClaw auto-load your provider plugin from shorthand
model ids like `acme-large` before runtime hooks exist. If you publish the
provider on ClawHub, those `openclaw.compat` and `openclaw.build` fields
are required in `package.json`.
@@ -707,7 +711,7 @@ Do not use the legacy skill-only publish alias here; plugin packages should use
```
<bundled-plugin-root>/acme-ai/
├── package.json # openclaw.providers metadata
├── openclaw.plugin.json # Manifest with providerAuthEnvVars
├── openclaw.plugin.json # Manifest with provider auth metadata
├── index.ts # definePluginEntry + registerProvider
└── src/
├── provider.test.ts # Tests
+3
View File
@@ -98,6 +98,9 @@ Gemini CLI JSON usage notes:
| Video understanding | Yes |
| Web search (Grounding) | Yes |
| Thinking/reasoning | Yes (Gemini 3.1+) |
| Gemma 4 models | Yes |
Gemma 4 models (for example `gemma-4-26b-a4b-it`) support thinking mode. OpenClaw rewrites `thinkingBudget` to a supported Google `thinkingLevel` for Gemma 4. Setting thinking to `off` preserves thinking disabled instead of mapping to `MINIMAL`.
## Direct Gemini cache reuse
+6 -6
View File
@@ -23,7 +23,7 @@ backend, not a dedicated OpenClaw provider plugin.
Example:
```bash
inferrs serve gg-hf-gg/gemma-4-E2B-it \
inferrs serve google/gemma-4-E2B-it \
--host 127.0.0.1 \
--port 8080 \
--device metal
@@ -46,9 +46,9 @@ This example uses Gemma 4 on a local `inferrs` server.
{
agents: {
defaults: {
model: { primary: "inferrs/gg-hf-gg/gemma-4-E2B-it" },
model: { primary: "inferrs/google/gemma-4-E2B-it" },
models: {
"inferrs/gg-hf-gg/gemma-4-E2B-it": {
"inferrs/google/gemma-4-E2B-it": {
alias: "Gemma 4 (inferrs)",
},
},
@@ -63,7 +63,7 @@ This example uses Gemma 4 on a local `inferrs` server.
api: "openai-completions",
models: [
{
id: "gg-hf-gg/gemma-4-E2B-it",
id: "google/gemma-4-E2B-it",
name: "Gemma 4 E2B (inferrs)",
reasoning: false,
input: ["text"],
@@ -132,10 +132,10 @@ Once configured, test both layers:
```bash
curl http://127.0.0.1:8080/v1/chat/completions \
-H 'content-type: application/json' \
-d '{"model":"gg-hf-gg/gemma-4-E2B-it","messages":[{"role":"user","content":"What is 2 + 2?"}],"stream":false}'
-d '{"model":"google/gemma-4-E2B-it","messages":[{"role":"user","content":"What is 2 + 2?"}],"stream":false}'
openclaw infer model run \
--model inferrs/gg-hf-gg/gemma-4-E2B-it \
--model inferrs/google/gemma-4-E2B-it \
--prompt "What is 2 + 2? Reply with one short sentence." \
--json
```
+2 -1
View File
@@ -119,7 +119,8 @@ openclaw models set ollama/gemma4
When you set `OLLAMA_API_KEY` (or an auth profile) and **do not** define `models.providers.ollama`, OpenClaw discovers models from the local Ollama instance at `http://127.0.0.1:11434`:
- Queries `/api/tags`
- Uses best-effort `/api/show` lookups to read `contextWindow` when available
- Uses best-effort `/api/show` lookups to read `contextWindow` and detect capabilities (including vision) when available
- Models with a `vision` capability reported by `/api/show` are marked as image-capable (`input: ["text", "image"]`), so OpenClaw auto-injects images into the prompt for those models
- Marks `reasoning` with a model-name heuristic (`r1`, `reasoning`, `think`)
- Sets `maxTokens` to the default Ollama max-token cap used by OpenClaw
- Sets all costs to `0`
+3 -1
View File
@@ -88,7 +88,9 @@ requiring the built-in `qwen` provider id specifically.
## Built-in catalog
OpenClaw currently ships this bundled Qwen catalog:
OpenClaw currently ships this bundled Qwen catalog. The configured catalog is
endpoint-aware: Coding Plan configs omit models that are only known to work on
the Standard endpoint.
| Model ref | Input | Context | Notes |
| --------------------------- | ----------- | --------- | -------------------------------------------------- |
+11 -5
View File
@@ -17,16 +17,20 @@ The desired end state is a generic QA harness that loads powerful scenario defin
## Current State
Primary source of truth now lives in `qa/scenarios.md`.
Primary source of truth now lives in `qa/scenarios/index.md` plus one file per
scenario under `qa/scenarios/*.md`.
Implemented:
- `qa/scenarios.md`
- canonical QA pack
- `qa/scenarios/index.md`
- canonical QA pack metadata
- operator identity
- kickoff mission
- `qa/scenarios/*.md`
- one markdown file per scenario
- scenario metadata
- handler bindings
- scenario-specific execution config
- `extensions/qa-lab/src/scenario-catalog.ts`
- markdown pack parser + zod validation
- `extensions/qa-lab/src/qa-agent-bootstrap.ts`
@@ -103,7 +107,8 @@ These categories matter because they drive DSL requirements. A flat list of prom
### Single source of truth
Use `qa/scenarios.md` as the authored source of truth.
Use `qa/scenarios/index.md` plus `qa/scenarios/*.md` as the authored source of
truth.
The pack should stay:
@@ -357,7 +362,8 @@ Generated compatibility:
Done.
- added `qa/scenarios.md`
- added `qa/scenarios/index.md`
- split scenarios into `qa/scenarios/*.md`
- added parser for named markdown YAML pack content
- validated with zod
- switched consumers to the parsed pack
+95 -57
View File
@@ -39,7 +39,10 @@ They run immediately, are stripped before the model sees the message, and the re
mcp: false,
plugins: false,
debug: false,
restart: false,
restart: true,
ownerAllowFrom: ["discord:123456789012345678"],
ownerDisplay: "raw",
ownerDisplaySecret: "${OWNER_ID_HASH_SECRET}",
allowFrom: {
"*": ["user1"],
discord: ["user:123"],
@@ -64,6 +67,10 @@ They run immediately, are stripped before the model sees the message, and the re
- `commands.mcp` (default `false`) enables `/mcp` (reads/writes OpenClaw-managed MCP config under `mcp.servers`).
- `commands.plugins` (default `false`) enables `/plugins` (plugin discovery/status plus install + enable/disable controls).
- `commands.debug` (default `false`) enables `/debug` (runtime-only overrides).
- `commands.restart` (default `true`) enables `/restart` plus gateway restart tool actions.
- `commands.ownerAllowFrom` (optional) sets the explicit owner allowlist for owner-only command/tool surfaces. This is separate from `commands.allowFrom`.
- `commands.ownerDisplay` controls how owner ids appear in the system prompt: `raw` or `hash`.
- `commands.ownerDisplaySecret` optionally sets the HMAC secret used when `commands.ownerDisplay="hash"`.
- `commands.allowFrom` (optional) sets a per-provider allowlist for command authorization. When configured, it is the
only authorization source for commands and directives (channel allowlists/pairing and `commands.useAccessGroups`
are ignored). Use `"*"` for a global default; provider-specific keys override it.
@@ -71,65 +78,94 @@ They run immediately, are stripped before the model sees the message, and the re
## Command list
Text + native (when enabled):
Current source-of-truth:
- `/help`
- `/commands`
- `/tools [compact|verbose]` (show what the current agent can use right now; `verbose` adds descriptions)
- `/skill <name> [input]` (run a skill by name)
- `/status` (show current status; includes provider usage/quota for the current model provider when available)
- `/tasks` (list background tasks for the current session; shows active and recent task details with agent-local fallback counts)
- `/allowlist` (list/add/remove allowlist entries)
- `/approve <id> <decision>` (resolve exec approval prompts; use the pending approval message for the available decisions)
- `/context [list|detail|json]` (explain “context”; `detail` shows per-file + per-tool + per-skill + system prompt size)
- `/btw <question>` (ask an ephemeral side question about the current session without changing future session context; see [/tools/btw](/tools/btw))
- `/export-session [path]` (alias: `/export`) (export current session to HTML with full system prompt)
- `/whoami` (show your sender id; alias: `/id`)
- `/session idle <duration|off>` (manage inactivity auto-unfocus for focused thread bindings)
- `/session max-age <duration|off>` (manage hard max-age auto-unfocus for focused thread bindings)
- `/subagents list|kill|log|info|send|steer|spawn` (inspect, control, or spawn sub-agent runs for the current session)
- `/acp spawn|cancel|steer|close|status|set-mode|set|cwd|permissions|timeout|model|reset-options|doctor|install|sessions` (inspect and control ACP runtime sessions)
- `/agents` (list thread-bound agents for this session)
- `/focus <target>` (Discord: bind this thread, or a new thread, to a session/subagent target)
- `/unfocus` (Discord: remove the current thread binding)
- `/kill <id|#|all>` (immediately abort one or all running sub-agents for this session; no confirmation message)
- `/steer <id|#> <message>` (steer a running sub-agent immediately: in-run when possible, otherwise abort current work and restart on the steer message)
- `/tell <id|#> <message>` (alias for `/steer`)
- `/config show|get|set|unset` (persist config to disk, owner-only; requires `commands.config: true`)
- `/mcp show|get|set|unset` (manage OpenClaw MCP server config, owner-only; requires `commands.mcp: true`)
- `/plugins list|show|get|install|enable|disable` (inspect discovered plugins, install new ones, and toggle enablement; owner-only for writes; requires `commands.plugins: true`)
- `/plugin` is an alias for `/plugins`.
- `/plugin install <spec>` accepts the same plugin specs as `openclaw plugins install`: local path/archive, npm package, or `clawhub:<pkg>`.
- Enable/disable writes still reply with a restart hint. On a watched foreground gateway, OpenClaw may perform that restart automatically right after the write.
- `/debug show|set|unset|reset` (runtime overrides, owner-only; requires `commands.debug: true`)
- `/usage off|tokens|full|cost` (per-response usage footer or local cost summary)
- `/tts off|always|inbound|tagged|status|provider|limit|summary|audio` (control TTS; see [/tts](/tools/tts))
- Discord: native command is `/voice` (Discord reserves `/tts`); text `/tts` still works.
- `/stop`
- `/restart`
- `/dock-telegram` (alias: `/dock_telegram`) (switch replies to Telegram)
- `/dock-discord` (alias: `/dock_discord`) (switch replies to Discord)
- `/dock-slack` (alias: `/dock_slack`) (switch replies to Slack)
- `/activation mention|always` (groups only)
- `/send on|off|inherit` (owner-only)
- `/reset` or `/new [model]` (optional model hint; remainder is passed through)
- `/think <off|minimal|low|medium|high|xhigh>` (dynamic choices by model/provider; aliases: `/thinking`, `/t`)
- `/fast status|on|off` (omitting the arg shows the current effective fast-mode state)
- `/verbose on|full|off` (alias: `/v`)
- `/reasoning on|off|stream` (alias: `/reason`; when on, sends a separate message prefixed `Reasoning:`; `stream` = Telegram draft only)
- `/elevated on|off|ask|full` (alias: `/elev`; `full` skips exec approvals)
- `/exec host=<auto|sandbox|gateway|node> security=<deny|allowlist|full> ask=<off|on-miss|always> node=<id>` (send `/exec` to show current)
- `/model <name>` (alias: `/models`; or `/<alias>` from `agents.defaults.models.*.alias`)
- `/queue <mode>` (plus options like `debounce:2s cap:25 drop:summarize`; send `/queue` to see current settings)
- `/bash <command>` (host-only; alias for `! <command>`; requires `commands.bash: true` + `tools.elevated` allowlists)
- `/dreaming [on|off|status|help]` (toggle global dreaming or show status; see [Dreaming](/concepts/dreaming))
- core built-ins come from `src/auto-reply/commands-registry.shared.ts`
- generated dock commands come from `src/auto-reply/commands-registry.data.ts`
- plugin commands come from plugin `registerCommand()` calls
- actual availability on your gateway still depends on config flags, channel surface, and installed/enabled plugins
Text-only:
### Core built-in commands
- `/compact [instructions]` (see [/concepts/compaction](/concepts/compaction))
- `! <command>` (host-only; one at a time; use `!poll` + `!stop` for long-running jobs)
- `!poll` (check output / status; accepts optional `sessionId`; `/bash poll` also works)
- `!stop` (stop the running bash job; accepts optional `sessionId`; `/bash stop` also works)
Built-in commands available today:
- `/new [model]` starts a new session; `/reset` is the reset alias.
- `/compact [instructions]` compacts the session context. See [/concepts/compaction](/concepts/compaction).
- `/stop` aborts the current run.
- `/session idle <duration|off>` and `/session max-age <duration|off>` manage thread-binding expiry.
- `/think <off|minimal|low|medium|high|xhigh>` sets the thinking level. Aliases: `/thinking`, `/t`.
- `/verbose on|off|full` toggles verbose output. Alias: `/v`.
- `/fast [status|on|off]` shows or sets fast mode.
- `/reasoning [on|off|stream]` toggles reasoning visibility. Alias: `/reason`.
- `/elevated [on|off|ask|full]` toggles elevated mode. Alias: `/elev`.
- `/exec host=<auto|sandbox|gateway|node> security=<deny|allowlist|full> ask=<off|on-miss|always> node=<id>` shows or sets exec defaults.
- `/model [name|#|status]` shows or sets the model.
- `/models [provider] [page] [limit=<n>|size=<n>|all]` lists providers or models for a provider.
- `/queue <mode>` manages queue behavior (`steer`, `interrupt`, `followup`, `collect`, `steer-backlog`) plus options like `debounce:2s cap:25 drop:summarize`.
- `/help` shows the short help summary.
- `/commands` shows the generated command catalog.
- `/tools [compact|verbose]` shows what the current agent can use right now.
- `/status` shows runtime status, including provider usage/quota when available.
- `/tasks` lists active/recent background tasks for the current session.
- `/context [list|detail|json]` explains how context is assembled.
- `/export-session [path]` exports the current session to HTML. Alias: `/export`.
- `/whoami` shows your sender id. Alias: `/id`.
- `/skill <name> [input]` runs a skill by name.
- `/allowlist [list|add|remove] ...` manages allowlist entries. Text-only.
- `/approve <id> <decision>` resolves exec approval prompts.
- `/btw <question>` asks a side question without changing future session context. See [/tools/btw](/tools/btw).
- `/subagents list|kill|log|info|send|steer|spawn` manages sub-agent runs for the current session.
- `/acp spawn|cancel|steer|close|sessions|status|set-mode|set|cwd|permissions|timeout|model|reset-options|doctor|install|help` manages ACP sessions and runtime options.
- `/focus <target>` binds the current Discord thread or Telegram topic/conversation to a session target.
- `/unfocus` removes the current binding.
- `/agents` lists thread-bound agents for the current session.
- `/kill <id|#|all>` aborts one or all running sub-agents.
- `/steer <id|#> <message>` sends steering to a running sub-agent. Alias: `/tell`.
- `/config show|get|set|unset` reads or writes `openclaw.json`. Owner-only. Requires `commands.config: true`.
- `/mcp show|get|set|unset` reads or writes OpenClaw-managed MCP server config under `mcp.servers`. Owner-only. Requires `commands.mcp: true`.
- `/plugins list|inspect|show|get|install|enable|disable` inspects or mutates plugin state. `/plugin` is an alias. Owner-only for writes. Requires `commands.plugins: true`.
- `/debug show|set|unset|reset` manages runtime-only config overrides. Owner-only. Requires `commands.debug: true`.
- `/usage off|tokens|full|cost` controls the per-response usage footer or prints a local cost summary.
- `/tts on|off|status|provider|limit|summary|audio|help` controls TTS. See [/tools/tts](/tools/tts).
- `/restart` restarts OpenClaw when enabled. Default: enabled; set `commands.restart: false` to disable it.
- `/activation mention|always` sets group activation mode.
- `/send on|off|inherit` sets send policy. Owner-only.
- `/bash <command>` runs a host shell command. Text-only. Alias: `! <command>`. Requires `commands.bash: true` plus `tools.elevated` allowlists.
- `!poll [sessionId]` checks a background bash job.
- `!stop [sessionId]` stops a background bash job.
### Generated dock commands
Dock commands are generated from channel plugins with native-command support. Current bundled set:
- `/dock-discord` (alias: `/dock_discord`)
- `/dock-mattermost` (alias: `/dock_mattermost`)
- `/dock-slack` (alias: `/dock_slack`)
- `/dock-telegram` (alias: `/dock_telegram`)
### Bundled plugin commands
Bundled plugins can add more slash commands. Current bundled commands in this repo:
- `/dreaming [on|off|status|help]` toggles memory dreaming. See [Dreaming](/concepts/dreaming).
- `/pair [qr|status|pending|approve|cleanup|notify]` manages device pairing/setup flow. See [Pairing](/channels/pairing).
- `/phone status|arm <camera|screen|writes|all> [duration]|disarm` temporarily arms high-risk phone node commands.
- `/voice status|list [limit]|set <voiceId|name>` manages Talk voice config. On Discord, the native command name is `/talkvoice`.
- `/card ...` sends LINE rich card presets. See [LINE](/channels/line).
- QQBot-only commands:
- `/bot-ping`
- `/bot-version`
- `/bot-help`
- `/bot-upgrade`
- `/bot-logs`
### Dynamic skill commands
User-invocable skills are also exposed as slash commands:
- `/skill <name> [input]` always works as the generic entrypoint.
- skills may also appear as direct commands like `/prose` when the skill/plugin registers them.
- native skill-command registration is controlled by `commands.nativeSkills` and `channels.<provider>.commands.nativeSkills`.
Notes:
@@ -140,6 +176,8 @@ Notes:
- In multi-account channels, config-targeted `/allowlist --account <id>` and `/config set channels.<provider>.accounts.<id>...` also honor the target account's `configWrites`.
- `/usage` controls the per-response usage footer; `/usage cost` prints a local cost summary from OpenClaw session logs.
- `/restart` is enabled by default; set `commands.restart: false` to disable it.
- `/plugins install <spec>` accepts the same plugin specs as `openclaw plugins install`: local path/archive, npm package, or `clawhub:<pkg>`.
- `/plugins enable|disable` updates plugin config and may prompt for a restart.
- Discord-only native command: `/vc join|leave|status` controls voice channels (requires `channels.discord.voice` and native commands; not available as text).
- Discord thread-binding commands (`/focus`, `/unfocus`, `/agents`, `/session idle`, `/session max-age`) require effective thread bindings to be enabled (`session.threadBindings.enabled` and/or `channels.discord.threadBindings.enabled`).
- ACP command reference and runtime behavior: [ACP Agents](/tools/acp-agents).
+5 -5
View File
@@ -59,7 +59,7 @@ so that provider must also be authenticated if you enable summaries.
## Is it enabled by default?
No. AutoTTS is **off** by default. Enable it in config with
`messages.tts.auto` or per session with `/tts always` (alias: `/tts on`).
`messages.tts.auto` or locally with `/tts on`.
When `messages.tts.provider` is unset, OpenClaw picks the first configured
speech provider in registry auto-select order.
@@ -411,9 +411,7 @@ Discord note: `/tts` is a built-in Discord command, so OpenClaw registers
```
/tts off
/tts always
/tts inbound
/tts tagged
/tts on
/tts status
/tts provider openai
/tts limit 2000
@@ -425,7 +423,9 @@ Notes:
- Commands require an authorized sender (allowlist/owner rules still apply).
- `commands.text` or native command registration must be enabled.
- `off|always|inbound|tagged` are persession toggles (`/tts on` is an alias for `/tts always`).
- Config `messages.tts.auto` accepts `off|always|inbound|tagged`.
- `/tts on` writes the local TTS preference to `always`; `/tts off` writes it to `off`.
- Use config when you want `inbound` or `tagged` defaults.
- `limit` and `summary` are stored in local prefs, not the main config.
- `/tts audio` generates a one-off audio reply (does not toggle TTS on).
- `/tts status` includes fallback visibility for the latest attempt:
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@openclaw/acpx",
"version": "2026.4.8",
"version": "2026.4.9",
"description": "OpenClaw ACP runtime backend",
"type": "module",
"dependencies": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@openclaw/alibaba-provider",
"version": "2026.4.8",
"version": "2026.4.9",
"private": true,
"description": "OpenClaw Alibaba Model Studio video provider plugin",
"type": "module",
@@ -1,71 +1,27 @@
import { afterEach, describe, expect, it, vi } from "vitest";
import { buildAlibabaVideoGenerationProvider } from "./video-generation-provider.js";
import { beforeAll, describe, expect, it } from "vitest";
import {
expectDashscopeVideoTaskPoll,
expectSuccessfulDashscopeVideoResult,
mockSuccessfulDashscopeVideoTask,
} from "../../test/helpers/media-generation/dashscope-video-provider.js";
import {
getProviderHttpMocks,
installProviderHttpMockCleanup,
} from "../../test/helpers/media-generation/provider-http-mocks.js";
const {
resolveApiKeyForProviderMock,
postJsonRequestMock,
fetchWithTimeoutMock,
assertOkOrThrowHttpErrorMock,
resolveProviderHttpRequestConfigMock,
} = vi.hoisted(() => ({
resolveApiKeyForProviderMock: vi.fn(async () => ({ apiKey: "alibaba-key" })),
postJsonRequestMock: vi.fn(),
fetchWithTimeoutMock: vi.fn(),
assertOkOrThrowHttpErrorMock: vi.fn(async () => {}),
resolveProviderHttpRequestConfigMock: vi.fn((params) => ({
baseUrl: params.baseUrl ?? params.defaultBaseUrl,
allowPrivateNetwork: false,
headers: new Headers(params.defaultHeaders),
dispatcherPolicy: undefined,
})),
}));
const { postJsonRequestMock, fetchWithTimeoutMock } = getProviderHttpMocks();
vi.mock("openclaw/plugin-sdk/provider-auth-runtime", () => ({
resolveApiKeyForProvider: resolveApiKeyForProviderMock,
}));
let buildAlibabaVideoGenerationProvider: typeof import("./video-generation-provider.js").buildAlibabaVideoGenerationProvider;
vi.mock("openclaw/plugin-sdk/provider-http", () => ({
assertOkOrThrowHttpError: assertOkOrThrowHttpErrorMock,
fetchWithTimeout: fetchWithTimeoutMock,
postJsonRequest: postJsonRequestMock,
resolveProviderHttpRequestConfig: resolveProviderHttpRequestConfigMock,
}));
beforeAll(async () => {
({ buildAlibabaVideoGenerationProvider } = await import("./video-generation-provider.js"));
});
installProviderHttpMockCleanup();
describe("alibaba video generation provider", () => {
afterEach(() => {
resolveApiKeyForProviderMock.mockClear();
postJsonRequestMock.mockReset();
fetchWithTimeoutMock.mockReset();
assertOkOrThrowHttpErrorMock.mockClear();
resolveProviderHttpRequestConfigMock.mockClear();
});
it("submits async Wan generation, polls task status, and downloads the resulting video", async () => {
postJsonRequestMock.mockResolvedValue({
response: {
json: async () => ({
request_id: "req-1",
output: {
task_id: "task-1",
},
}),
},
release: vi.fn(async () => {}),
});
fetchWithTimeoutMock
.mockResolvedValueOnce({
json: async () => ({
output: {
task_status: "SUCCEEDED",
results: [{ video_url: "https://example.com/out.mp4" }],
},
}),
headers: new Headers(),
})
.mockResolvedValueOnce({
arrayBuffer: async () => Buffer.from("mp4-bytes"),
headers: new Headers({ "content-type": "video/mp4" }),
});
mockSuccessfulDashscopeVideoTask({ postJsonRequestMock, fetchWithTimeoutMock });
const provider = buildAlibabaVideoGenerationProvider();
const result = await provider.generateVideo({
@@ -96,22 +52,8 @@ describe("alibaba video generation provider", () => {
}),
}),
);
expect(fetchWithTimeoutMock).toHaveBeenNthCalledWith(
1,
"https://dashscope-intl.aliyuncs.com/api/v1/tasks/task-1",
expect.objectContaining({ method: "GET" }),
120000,
fetch,
);
expect(result.videos).toHaveLength(1);
expect(result.videos[0]?.mimeType).toBe("video/mp4");
expect(result.metadata).toEqual(
expect.objectContaining({
requestId: "req-1",
taskId: "task-1",
taskStatus: "SUCCEEDED",
}),
);
expectDashscopeVideoTaskPoll(fetchWithTimeoutMock);
expectSuccessfulDashscopeVideoResult(result);
});
it("fails fast when reference inputs are local buffers instead of remote URLs", async () => {
+14 -103
View File
@@ -1,29 +1,21 @@
import { isProviderApiKeyConfigured } from "openclaw/plugin-sdk/provider-auth";
import { resolveApiKeyForProvider } from "openclaw/plugin-sdk/provider-auth-runtime";
import { resolveProviderHttpRequestConfig } from "openclaw/plugin-sdk/provider-http";
import {
assertOkOrThrowHttpError,
postJsonRequest,
resolveProviderHttpRequestConfig,
} from "openclaw/plugin-sdk/provider-http";
import {
DEFAULT_VIDEO_GENERATION_DURATION_SECONDS,
DASHSCOPE_WAN_VIDEO_CAPABILITIES,
DASHSCOPE_WAN_VIDEO_MODELS,
DEFAULT_DASHSCOPE_WAN_VIDEO_MODEL,
DEFAULT_VIDEO_GENERATION_TIMEOUT_MS,
DEFAULT_VIDEO_RESOLUTION_TO_SIZE,
buildDashscopeVideoGenerationInput,
buildDashscopeVideoGenerationParameters,
downloadDashscopeGeneratedVideos,
extractDashscopeVideoUrls,
pollDashscopeVideoTaskUntilComplete,
runDashscopeVideoGenerationTask,
} from "openclaw/plugin-sdk/video-generation";
import type {
DashscopeVideoGenerationResponse,
VideoGenerationProvider,
VideoGenerationRequest,
VideoGenerationResult,
} from "openclaw/plugin-sdk/video-generation";
const DEFAULT_ALIBABA_VIDEO_BASE_URL = "https://dashscope-intl.aliyuncs.com";
const DEFAULT_ALIBABA_VIDEO_MODEL = "wan2.6-t2v";
const DEFAULT_ALIBABA_VIDEO_MODEL = DEFAULT_DASHSCOPE_WAN_VIDEO_MODEL;
function resolveAlibabaVideoBaseUrl(req: VideoGenerationRequest): string {
return req.cfg?.models?.providers?.alibaba?.baseUrl?.trim() || DEFAULT_ALIBABA_VIDEO_BASE_URL;
@@ -38,45 +30,13 @@ export function buildAlibabaVideoGenerationProvider(): VideoGenerationProvider {
id: "alibaba",
label: "Alibaba Model Studio",
defaultModel: DEFAULT_ALIBABA_VIDEO_MODEL,
models: ["wan2.6-t2v", "wan2.6-i2v", "wan2.6-r2v", "wan2.6-r2v-flash", "wan2.7-r2v"],
models: [...DASHSCOPE_WAN_VIDEO_MODELS],
isConfigured: ({ agentDir }) =>
isProviderApiKeyConfigured({
provider: "alibaba",
agentDir,
}),
capabilities: {
generate: {
maxVideos: 1,
maxDurationSeconds: 10,
supportsSize: true,
supportsAspectRatio: true,
supportsResolution: true,
supportsAudio: true,
supportsWatermark: true,
},
imageToVideo: {
enabled: true,
maxVideos: 1,
maxInputImages: 1,
maxDurationSeconds: 10,
supportsSize: true,
supportsAspectRatio: true,
supportsResolution: true,
supportsAudio: true,
supportsWatermark: true,
},
videoToVideo: {
enabled: true,
maxVideos: 1,
maxInputVideos: 4,
maxDurationSeconds: 10,
supportsSize: true,
supportsAspectRatio: true,
supportsResolution: true,
supportsAudio: true,
supportsWatermark: true,
},
},
capabilities: DASHSCOPE_WAN_VIDEO_CAPABILITIES,
async generateVideo(req): Promise<VideoGenerationResult> {
const fetchFn = fetch;
const auth = await resolveApiKeyForProvider({
@@ -105,68 +65,19 @@ export function buildAlibabaVideoGenerationProvider(): VideoGenerationProvider {
});
const model = req.model?.trim() || DEFAULT_ALIBABA_VIDEO_MODEL;
const { response, release } = await postJsonRequest({
return await runDashscopeVideoGenerationTask({
providerLabel: "Alibaba Wan",
model,
req,
url: `${resolveDashscopeAigcApiBaseUrl(baseUrl)}/api/v1/services/aigc/video-generation/video-synthesis`,
headers,
body: {
model,
input: buildDashscopeVideoGenerationInput({
providerLabel: "Alibaba Wan",
req,
}),
parameters: buildDashscopeVideoGenerationParameters(
{
...req,
durationSeconds: req.durationSeconds ?? DEFAULT_VIDEO_GENERATION_DURATION_SECONDS,
},
DEFAULT_VIDEO_RESOLUTION_TO_SIZE,
),
},
baseUrl: resolveDashscopeAigcApiBaseUrl(baseUrl),
timeoutMs: req.timeoutMs,
fetchFn,
allowPrivateNetwork,
dispatcherPolicy,
defaultTimeoutMs: DEFAULT_VIDEO_GENERATION_TIMEOUT_MS,
});
try {
await assertOkOrThrowHttpError(response, "Alibaba Wan video generation failed");
const submitted = (await response.json()) as DashscopeVideoGenerationResponse;
const taskId = submitted.output?.task_id?.trim();
if (!taskId) {
throw new Error("Alibaba Wan video generation response missing task_id");
}
const completed = await pollDashscopeVideoTaskUntilComplete({
providerLabel: "Alibaba Wan",
taskId,
headers,
timeoutMs: req.timeoutMs,
fetchFn,
baseUrl: resolveDashscopeAigcApiBaseUrl(baseUrl),
defaultTimeoutMs: DEFAULT_VIDEO_GENERATION_TIMEOUT_MS,
});
const urls = extractDashscopeVideoUrls(completed);
if (urls.length === 0) {
throw new Error("Alibaba Wan video generation completed without output video URLs");
}
const videos = await downloadDashscopeGeneratedVideos({
providerLabel: "Alibaba Wan",
urls,
timeoutMs: req.timeoutMs,
fetchFn,
defaultTimeoutMs: DEFAULT_VIDEO_GENERATION_TIMEOUT_MS,
});
return {
videos,
model,
metadata: {
requestId: submitted.request_id,
taskId,
taskStatus: completed.output?.task_status,
},
};
} finally {
await release();
}
},
};
}
@@ -1,6 +1,6 @@
{
"name": "@openclaw/amazon-bedrock-mantle-provider",
"version": "2026.4.8",
"version": "2026.4.9",
"private": true,
"description": "OpenClaw Amazon Bedrock Mantle (OpenAI-compatible) provider plugin",
"type": "module",
+2 -7
View File
@@ -1,6 +1,6 @@
{
"name": "@openclaw/amazon-bedrock-provider",
"version": "2026.4.8",
"version": "2026.4.9",
"private": true,
"description": "OpenClaw Amazon Bedrock provider plugin",
"type": "module",
@@ -16,11 +16,6 @@
},
"extensions": [
"./index.ts"
],
"releaseChecks": {
"rootDependencyMirrorAllowlist": [
"@aws-sdk/client-bedrock"
]
}
]
}
}
@@ -2,6 +2,7 @@
"id": "anthropic-vertex",
"enabledByDefault": true,
"providers": ["anthropic-vertex"],
"providerDiscoveryEntry": "./provider-discovery.ts",
"configSchema": {
"type": "object",
"additionalProperties": false,
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@openclaw/anthropic-vertex-provider",
"version": "2026.4.8",
"version": "2026.4.9",
"private": true,
"description": "OpenClaw Anthropic Vertex provider plugin",
"type": "module",
@@ -0,0 +1,10 @@
import { describe, expect, it } from "vitest";
describe("anthropic-vertex provider discovery entry", () => {
it("imports without loading the full plugin entry", async () => {
const module = await import("./provider-discovery.js");
expect(module.default.id).toBe("anthropic-vertex");
expect(module.default.catalog.order).toBe("simple");
});
});
@@ -0,0 +1,215 @@
import { readFileSync } from "node:fs";
import { homedir, platform } from "node:os";
import { join } from "node:path";
import type { ProviderCatalogContext } from "openclaw/plugin-sdk/provider-catalog-shared";
import type {
ModelDefinitionConfig,
ModelProviderConfig,
} from "openclaw/plugin-sdk/provider-model-shared";
const PROVIDER_ID = "anthropic-vertex";
const ANTHROPIC_VERTEX_DEFAULT_REGION = "global";
const ANTHROPIC_VERTEX_REGION_RE = /^[a-z0-9-]+$/;
const ANTHROPIC_VERTEX_DEFAULT_CONTEXT_WINDOW = 1_000_000;
const GCP_VERTEX_CREDENTIALS_MARKER = "gcp-vertex-credentials";
const GCLOUD_DEFAULT_ADC_PATH = join(
homedir(),
".config",
"gcloud",
"application_default_credentials.json",
);
type AnthropicVertexProviderPlugin = {
id: string;
label: string;
docsPath: string;
auth: [];
catalog: {
order: "simple";
run: (ctx: ProviderCatalogContext) => ReturnType<typeof runAnthropicVertexCatalog>;
};
resolveConfigApiKey: (params: { env: NodeJS.ProcessEnv }) => string | undefined;
};
type AdcProjectFile = {
project_id?: unknown;
quota_project_id?: unknown;
};
function normalizeOptionalString(value: unknown): string | undefined {
return typeof value === "string" && value.trim() ? value.trim() : undefined;
}
function normalizeLowercaseStringOrEmpty(value: unknown): string {
return normalizeOptionalString(value)?.toLowerCase() ?? "";
}
function resolveAnthropicVertexRegion(env: NodeJS.ProcessEnv = process.env): string {
const region =
normalizeOptionalString(env.GOOGLE_CLOUD_LOCATION) ||
normalizeOptionalString(env.CLOUD_ML_REGION);
return region && ANTHROPIC_VERTEX_REGION_RE.test(region)
? region
: ANTHROPIC_VERTEX_DEFAULT_REGION;
}
function hasAnthropicVertexMetadataServerAdc(env: NodeJS.ProcessEnv = process.env): boolean {
const explicitMetadataOptIn = normalizeOptionalString(env.ANTHROPIC_VERTEX_USE_GCP_METADATA);
return (
explicitMetadataOptIn === "1" ||
normalizeLowercaseStringOrEmpty(explicitMetadataOptIn) === "true"
);
}
function resolveAnthropicVertexDefaultAdcPath(env: NodeJS.ProcessEnv = process.env): string {
return platform() === "win32"
? join(
env.APPDATA ?? join(homedir(), "AppData", "Roaming"),
"gcloud",
"application_default_credentials.json",
)
: GCLOUD_DEFAULT_ADC_PATH;
}
function resolveAnthropicVertexAdcCredentialsPathCandidate(
env: NodeJS.ProcessEnv = process.env,
): string | undefined {
const explicit = normalizeOptionalString(env.GOOGLE_APPLICATION_CREDENTIALS);
if (explicit) {
return explicit;
}
if (env !== process.env) {
return undefined;
}
return resolveAnthropicVertexDefaultAdcPath(env);
}
function readAnthropicVertexAdc(env: NodeJS.ProcessEnv = process.env): AdcProjectFile | null {
const credentialsPath = resolveAnthropicVertexAdcCredentialsPathCandidate(env);
if (!credentialsPath) {
return null;
}
try {
return JSON.parse(readFileSync(credentialsPath, "utf8")) as AdcProjectFile;
} catch {
return null;
}
}
function hasAnthropicVertexAvailableAuth(env: NodeJS.ProcessEnv = process.env): boolean {
return hasAnthropicVertexMetadataServerAdc(env) || readAnthropicVertexAdc(env) !== null;
}
function resolveAnthropicVertexConfigApiKey(
env: NodeJS.ProcessEnv = process.env,
): string | undefined {
return hasAnthropicVertexAvailableAuth(env) ? GCP_VERTEX_CREDENTIALS_MARKER : undefined;
}
function buildAnthropicVertexModel(params: {
id: string;
name: string;
reasoning: boolean;
input: ModelDefinitionConfig["input"];
cost: ModelDefinitionConfig["cost"];
maxTokens: number;
}): ModelDefinitionConfig {
return {
id: params.id,
name: params.name,
reasoning: params.reasoning,
input: params.input,
cost: params.cost,
contextWindow: ANTHROPIC_VERTEX_DEFAULT_CONTEXT_WINDOW,
maxTokens: params.maxTokens,
};
}
function buildAnthropicVertexProvider(params?: { env?: NodeJS.ProcessEnv }): ModelProviderConfig {
const region = resolveAnthropicVertexRegion(params?.env);
const baseUrl =
normalizeLowercaseStringOrEmpty(region) === "global"
? "https://aiplatform.googleapis.com"
: `https://${region}-aiplatform.googleapis.com`;
return {
baseUrl,
api: "anthropic-messages",
apiKey: GCP_VERTEX_CREDENTIALS_MARKER,
models: [
buildAnthropicVertexModel({
id: "claude-opus-4-6",
name: "Claude Opus 4.6",
reasoning: true,
input: ["text", "image"],
cost: { input: 5, output: 25, cacheRead: 0.5, cacheWrite: 6.25 },
maxTokens: 128000,
}),
buildAnthropicVertexModel({
id: "claude-sonnet-4-6",
name: "Claude Sonnet 4.6",
reasoning: true,
input: ["text", "image"],
cost: { input: 3, output: 15, cacheRead: 0.3, cacheWrite: 3.75 },
maxTokens: 128000,
}),
],
};
}
function mergeImplicitAnthropicVertexProvider(params: {
existing?: ModelProviderConfig;
implicit: ModelProviderConfig;
}) {
const { existing, implicit } = params;
if (!existing) {
return implicit;
}
return {
...implicit,
...existing,
models:
Array.isArray(existing.models) && existing.models.length > 0
? existing.models
: implicit.models,
};
}
function resolveImplicitAnthropicVertexProvider(params?: { env?: NodeJS.ProcessEnv }) {
const env = params?.env ?? process.env;
if (!hasAnthropicVertexAvailableAuth(env)) {
return null;
}
return buildAnthropicVertexProvider({ env });
}
async function runAnthropicVertexCatalog(ctx: ProviderCatalogContext) {
const implicit = resolveImplicitAnthropicVertexProvider({
env: ctx.env,
});
if (!implicit) {
return null;
}
return {
provider: mergeImplicitAnthropicVertexProvider({
existing: ctx.config.models?.providers?.[PROVIDER_ID],
implicit,
}),
};
}
export const anthropicVertexProviderDiscovery: AnthropicVertexProviderPlugin = {
id: PROVIDER_ID,
label: "Anthropic Vertex",
docsPath: "/providers/models",
auth: [],
catalog: {
order: "simple",
run: runAnthropicVertexCatalog,
},
resolveConfigApiKey: ({ env }) => resolveAnthropicVertexConfigApiKey(env),
};
export default anthropicVertexProviderDiscovery;
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@openclaw/anthropic-provider",
"version": "2026.4.8",
"version": "2026.4.9",
"private": true,
"description": "OpenClaw Anthropic provider plugin",
"type": "module",
@@ -0,0 +1,62 @@
import type { ModelDefinitionConfig } from "openclaw/plugin-sdk/provider-model-types";
import { describe, expect, it } from "vitest";
import { applyConfigDefaults, normalizeConfig } from "./provider-policy-api.js";
function createModel(id: string, name: string): ModelDefinitionConfig {
return {
id,
name,
reasoning: false,
input: ["text"],
cost: {
input: 0,
output: 0,
cacheRead: 0,
cacheWrite: 0,
},
contextWindow: 128_000,
maxTokens: 8_192,
};
}
describe("anthropic provider policy public artifact", () => {
it("normalizes Anthropic provider config", () => {
expect(
normalizeConfig({
provider: "anthropic",
providerConfig: {
baseUrl: "https://api.anthropic.com",
models: [createModel("claude-sonnet-4-6", "Claude Sonnet 4.6")],
},
}),
).toMatchObject({
api: "anthropic-messages",
baseUrl: "https://api.anthropic.com",
});
});
it("applies Anthropic API-key defaults without loading the full provider plugin", () => {
const nextConfig = applyConfigDefaults({
config: {
auth: {
profiles: {
"anthropic:default": {
provider: "anthropic",
mode: "api_key",
},
},
order: { anthropic: ["anthropic:default"] },
},
agents: {
defaults: {},
},
},
env: {},
});
expect(nextConfig.agents?.defaults?.contextPruning).toMatchObject({
mode: "cache-ttl",
ttl: "1h",
});
});
});
+2 -4
View File
@@ -1,12 +1,10 @@
import type { ModelProviderConfig } from "openclaw/plugin-sdk/provider-model-types";
import {
applyAnthropicConfigDefaults,
normalizeAnthropicProviderConfig,
} from "./config-defaults.js";
export function normalizeConfig(params: {
provider: string;
providerConfig: Parameters<typeof normalizeAnthropicProviderConfig>[0];
}) {
export function normalizeConfig(params: { provider: string; providerConfig: ModelProviderConfig }) {
return normalizeAnthropicProviderConfig(params.providerConfig);
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@openclaw/arcee-provider",
"version": "2026.4.8",
"version": "2026.4.9",
"private": true,
"description": "OpenClaw Arcee provider plugin",
"type": "module",
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@openclaw/bluebubbles",
"version": "2026.4.8",
"version": "2026.4.9",
"description": "OpenClaw BlueBubbles channel plugin",
"type": "module",
"devDependencies": {
@@ -8,7 +8,7 @@
"openclaw": "workspace:*"
},
"peerDependencies": {
"openclaw": ">=2026.4.8"
"openclaw": ">=2026.4.9"
},
"peerDependenciesMeta": {
"openclaw": {
@@ -40,13 +40,13 @@
"install": {
"npmSpec": "@openclaw/bluebubbles",
"defaultChoice": "npm",
"minHostVersion": ">=2026.4.8"
"minHostVersion": ">=2026.4.9"
},
"compat": {
"pluginApi": ">=2026.4.8"
"pluginApi": ">=2026.4.9"
},
"build": {
"openclawVersion": "2026.4.8"
"openclawVersion": "2026.4.9"
},
"release": {
"publishToClawHub": true,
@@ -0,0 +1,107 @@
import { isBlockedHostnameOrIp } from "openclaw/plugin-sdk/ssrf-runtime";
import { normalizeBlueBubblesServerUrl } from "./types.js";
function asRecord(value: unknown): Record<string, unknown> | null {
return value && typeof value === "object" && !Array.isArray(value)
? (value as Record<string, unknown>)
: null;
}
export function normalizeBlueBubblesPrivateNetworkAliases<T extends object | undefined>(
config: T,
): T {
const record = asRecord(config);
if (!record) {
return config;
}
const network = asRecord(record.network);
const canonicalValue =
typeof network?.dangerouslyAllowPrivateNetwork === "boolean"
? network.dangerouslyAllowPrivateNetwork
: typeof network?.allowPrivateNetwork === "boolean"
? network.allowPrivateNetwork
: typeof record.dangerouslyAllowPrivateNetwork === "boolean"
? record.dangerouslyAllowPrivateNetwork
: typeof record.allowPrivateNetwork === "boolean"
? record.allowPrivateNetwork
: undefined;
if (canonicalValue === undefined) {
return config;
}
const {
allowPrivateNetwork: _legacyFlatAllow,
dangerouslyAllowPrivateNetwork: _legacyFlatDanger,
...rest
} = record;
const {
allowPrivateNetwork: _legacyNetworkAllow,
dangerouslyAllowPrivateNetwork: _legacyNetworkDanger,
...restNetwork
} = network ?? {};
return {
...rest,
network: {
...restNetwork,
dangerouslyAllowPrivateNetwork: canonicalValue,
},
} as T;
}
export function normalizeBlueBubblesAccountsMap<T extends object | undefined>(
accounts: Record<string, T> | undefined,
): Record<string, T> | undefined {
if (!accounts) {
return undefined;
}
return Object.fromEntries(
Object.entries(accounts).map(([accountKey, accountConfig]) => [
accountKey,
normalizeBlueBubblesPrivateNetworkAliases(accountConfig),
]),
);
}
export function resolveBlueBubblesPrivateNetworkConfigValue(
config: object | null | undefined,
): boolean | undefined {
const record = asRecord(config);
if (!record) {
return undefined;
}
const network = asRecord(record.network);
if (typeof network?.dangerouslyAllowPrivateNetwork === "boolean") {
return network.dangerouslyAllowPrivateNetwork;
}
if (typeof network?.allowPrivateNetwork === "boolean") {
return network.allowPrivateNetwork;
}
if (typeof record.dangerouslyAllowPrivateNetwork === "boolean") {
return record.dangerouslyAllowPrivateNetwork;
}
if (typeof record.allowPrivateNetwork === "boolean") {
return record.allowPrivateNetwork;
}
return undefined;
}
export function resolveBlueBubblesEffectiveAllowPrivateNetworkFromConfig(params: {
baseUrl?: string;
config?: object | null;
}): boolean {
const configuredValue = resolveBlueBubblesPrivateNetworkConfigValue(params.config);
if (configuredValue !== undefined) {
return configuredValue;
}
if (!params.baseUrl) {
return false;
}
try {
const hostname = new URL(normalizeBlueBubblesServerUrl(params.baseUrl)).hostname.trim();
return Boolean(hostname) && isBlockedHostnameOrIp(hostname);
} catch {
return false;
}
}
+10 -97
View File
@@ -4,9 +4,14 @@ import {
resolveMergedAccountConfig,
} from "openclaw/plugin-sdk/account-resolution";
import { resolveChannelStreamingChunkMode } from "openclaw/plugin-sdk/channel-streaming";
import type { OpenClawConfig } from "openclaw/plugin-sdk/core";
import { isBlockedHostnameOrIp } from "openclaw/plugin-sdk/ssrf-runtime";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
import { normalizeOptionalString } from "openclaw/plugin-sdk/text-runtime";
import {
normalizeBlueBubblesAccountsMap,
normalizeBlueBubblesPrivateNetworkAliases,
resolveBlueBubblesEffectiveAllowPrivateNetworkFromConfig,
resolveBlueBubblesPrivateNetworkConfigValue as resolveBlueBubblesPrivateNetworkConfigValueFromRecord,
} from "./accounts-normalization.js";
import { hasConfiguredSecretInput, normalizeSecretInputString } from "./secret-input.js";
import { normalizeBlueBubblesServerUrl, type BlueBubblesAccountConfig } from "./types.js";
@@ -25,76 +30,13 @@ const {
} = createAccountListHelpers("bluebubbles");
export { listBlueBubblesAccountIds, resolveDefaultBlueBubblesAccountId };
function asRecord(value: unknown): Record<string, unknown> | null {
return value && typeof value === "object" && !Array.isArray(value)
? (value as Record<string, unknown>)
: null;
}
function normalizeBlueBubblesPrivateNetworkAliases(
config: Record<string, unknown> | undefined,
): Record<string, unknown> | undefined {
const record = asRecord(config);
if (!record) {
return config;
}
const network = asRecord(record.network);
const canonicalValue =
typeof network?.dangerouslyAllowPrivateNetwork === "boolean"
? network.dangerouslyAllowPrivateNetwork
: typeof network?.allowPrivateNetwork === "boolean"
? network.allowPrivateNetwork
: typeof record.dangerouslyAllowPrivateNetwork === "boolean"
? record.dangerouslyAllowPrivateNetwork
: typeof record.allowPrivateNetwork === "boolean"
? record.allowPrivateNetwork
: undefined;
if (canonicalValue === undefined) {
return config;
}
const {
allowPrivateNetwork: _legacyFlatAllow,
dangerouslyAllowPrivateNetwork: _legacyFlatDanger,
...rest
} = record;
const {
allowPrivateNetwork: _legacyNetworkAllow,
dangerouslyAllowPrivateNetwork: _legacyNetworkDanger,
...restNetwork
} = network ?? {};
return {
...rest,
network: {
...restNetwork,
dangerouslyAllowPrivateNetwork: canonicalValue,
},
};
}
function normalizeBlueBubblesAccountsMap(
accounts: Record<string, Partial<BlueBubblesAccountConfig>> | undefined,
): Record<string, Partial<BlueBubblesAccountConfig>> | undefined {
if (!accounts) {
return undefined;
}
return Object.fromEntries(
Object.entries(accounts).map(([accountKey, accountConfig]) => [
accountKey,
normalizeBlueBubblesPrivateNetworkAliases(accountConfig) as Partial<BlueBubblesAccountConfig>,
]),
);
}
function mergeBlueBubblesAccountConfig(
cfg: OpenClawConfig,
accountId: string,
): BlueBubblesAccountConfig {
const channelConfig = normalizeBlueBubblesPrivateNetworkAliases(
cfg.channels?.bluebubbles as BlueBubblesAccountConfig | undefined,
) as BlueBubblesAccountConfig | undefined;
);
const accounts = normalizeBlueBubblesAccountsMap(
cfg.channels?.bluebubbles?.accounts as
| Record<string, Partial<BlueBubblesAccountConfig>>
@@ -141,43 +83,14 @@ export function resolveBlueBubblesAccount(params: {
export function resolveBlueBubblesPrivateNetworkConfigValue(
config: BlueBubblesAccountConfig | null | undefined,
): boolean | undefined {
const record = asRecord(config);
if (!record) {
return undefined;
}
const network = asRecord(record.network);
if (typeof network?.dangerouslyAllowPrivateNetwork === "boolean") {
return network.dangerouslyAllowPrivateNetwork;
}
if (typeof network?.allowPrivateNetwork === "boolean") {
return network.allowPrivateNetwork;
}
if (typeof record.dangerouslyAllowPrivateNetwork === "boolean") {
return record.dangerouslyAllowPrivateNetwork;
}
if (typeof record.allowPrivateNetwork === "boolean") {
return record.allowPrivateNetwork;
}
return undefined;
return resolveBlueBubblesPrivateNetworkConfigValueFromRecord(config);
}
export function resolveBlueBubblesEffectiveAllowPrivateNetwork(params: {
baseUrl?: string;
config?: BlueBubblesAccountConfig | null;
}): boolean {
const configuredValue = resolveBlueBubblesPrivateNetworkConfigValue(params.config);
if (configuredValue !== undefined) {
return configuredValue;
}
if (!params.baseUrl) {
return false;
}
try {
const hostname = new URL(normalizeBlueBubblesServerUrl(params.baseUrl)).hostname.trim();
return Boolean(hostname) && isBlockedHostnameOrIp(hostname);
} catch {
return false;
}
return resolveBlueBubblesEffectiveAllowPrivateNetworkFromConfig(params);
}
export function listEnabledBlueBubblesAccounts(cfg: OpenClawConfig): ResolvedBlueBubblesAccount[] {
+1 -1
View File
@@ -1,4 +1,4 @@
import type { ChannelPlugin } from "openclaw/plugin-sdk/core";
import type { ChannelPlugin } from "openclaw/plugin-sdk/channel-core";
import { type ResolvedBlueBubblesAccount } from "./accounts.js";
import {
bluebubblesCapabilities,
+1 -1
View File
@@ -1,5 +1,5 @@
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
import type { OpenClawConfig } from "openclaw/plugin-sdk/core";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
type BlueBubblesConfigPatch = {
serverUrl?: string;
@@ -1,4 +1,4 @@
import type { ChannelConfigUiHint } from "openclaw/plugin-sdk/core";
import type { ChannelConfigUiHint } from "openclaw/plugin-sdk/channel-core";
export const bluebubblesChannelConfigUiHints = {
"": {
+1 -1
View File
@@ -1,4 +1,4 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/core";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
import type { ResolvedBlueBubblesAccount } from "./accounts.js";
import { getBlueBubblesRuntime } from "./runtime.js";
export {
@@ -33,7 +33,7 @@ export const secretTargetRegistryEntries = [
export function collectRuntimeConfigAssignments(params: {
config: { channels?: Record<string, unknown> };
defaults: SecretDefaults | undefined;
defaults?: SecretDefaults;
context: ResolverContext;
}): void {
const resolved = getChannelSurface(params.config, "bluebubbles");
+7 -107
View File
@@ -1,7 +1,12 @@
import { isBlockedHostnameOrIp } from "openclaw/plugin-sdk/ssrf-runtime";
import type { Mock } from "vitest";
import { afterEach, beforeEach, vi } from "vitest";
import { _setFetchGuardForTesting, normalizeBlueBubblesServerUrl } from "./types.js";
import {
normalizeBlueBubblesAccountsMap,
normalizeBlueBubblesPrivateNetworkAliases,
resolveBlueBubblesEffectiveAllowPrivateNetworkFromConfig,
resolveBlueBubblesPrivateNetworkConfigValue as resolveBlueBubblesPrivateNetworkConfigValueFromConfig,
} from "./accounts-normalization.js";
import { _setFetchGuardForTesting } from "./types.js";
export const BLUE_BUBBLES_PRIVATE_API_STATUS = {
enabled: true,
@@ -28,69 +33,6 @@ export function mockBlueBubblesPrivateApiStatusOnce(
mock.mockReturnValueOnce(value);
}
function asRecord(value: unknown): Record<string, unknown> | null {
return value && typeof value === "object" && !Array.isArray(value)
? (value as Record<string, unknown>)
: null;
}
function normalizeBlueBubblesPrivateNetworkAliases(
config: Record<string, unknown> | undefined,
): Record<string, unknown> | undefined {
const record = asRecord(config);
if (!record) {
return config;
}
const network = asRecord(record.network);
const canonicalValue =
typeof network?.dangerouslyAllowPrivateNetwork === "boolean"
? network.dangerouslyAllowPrivateNetwork
: typeof network?.allowPrivateNetwork === "boolean"
? network.allowPrivateNetwork
: typeof record.dangerouslyAllowPrivateNetwork === "boolean"
? record.dangerouslyAllowPrivateNetwork
: typeof record.allowPrivateNetwork === "boolean"
? record.allowPrivateNetwork
: undefined;
if (canonicalValue === undefined) {
return config;
}
const {
allowPrivateNetwork: _legacyFlatAllow,
dangerouslyAllowPrivateNetwork: _legacyFlatDanger,
...rest
} = record;
const {
allowPrivateNetwork: _legacyNetworkAllow,
dangerouslyAllowPrivateNetwork: _legacyNetworkDanger,
...restNetwork
} = network ?? {};
return {
...rest,
network: {
...restNetwork,
dangerouslyAllowPrivateNetwork: canonicalValue,
},
};
}
function normalizeBlueBubblesAccountsMap(
accounts: Record<string, Record<string, unknown> | undefined> | undefined,
): Record<string, Record<string, unknown> | undefined> | undefined {
if (!accounts) {
return undefined;
}
return Object.fromEntries(
Object.entries(accounts).map(([accountKey, accountConfig]) => [
accountKey,
normalizeBlueBubblesPrivateNetworkAliases(accountConfig),
]),
);
}
export function resolveBlueBubblesAccountFromConfig(params: {
cfg?: { channels?: { bluebubbles?: Record<string, unknown> } };
accountId?: string;
@@ -127,48 +69,6 @@ export function resolveBlueBubblesAccountFromConfig(params: {
};
}
function resolveBlueBubblesPrivateNetworkConfigValueFromConfig(
config: Record<string, unknown> | undefined,
): boolean | undefined {
const record = asRecord(config);
if (!record) {
return undefined;
}
const network = asRecord(record.network);
if (typeof network?.dangerouslyAllowPrivateNetwork === "boolean") {
return network.dangerouslyAllowPrivateNetwork;
}
if (typeof network?.allowPrivateNetwork === "boolean") {
return network.allowPrivateNetwork;
}
if (typeof record.dangerouslyAllowPrivateNetwork === "boolean") {
return record.dangerouslyAllowPrivateNetwork;
}
if (typeof record.allowPrivateNetwork === "boolean") {
return record.allowPrivateNetwork;
}
return undefined;
}
function resolveBlueBubblesEffectiveAllowPrivateNetworkFromConfig(params: {
baseUrl?: string;
config?: Record<string, unknown>;
}) {
const configuredValue = resolveBlueBubblesPrivateNetworkConfigValueFromConfig(params.config);
if (configuredValue !== undefined) {
return configuredValue;
}
if (!params.baseUrl) {
return false;
}
try {
const hostname = new URL(normalizeBlueBubblesServerUrl(params.baseUrl)).hostname.trim();
return Boolean(hostname) && isBlockedHostnameOrIp(hostname);
} catch {
return false;
}
}
export function createBlueBubblesAccountsMockModule() {
return {
resolveBlueBubblesAccount: vi.fn(resolveBlueBubblesAccountFromConfig),
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@openclaw/brave-plugin",
"version": "2026.4.8",
"version": "2026.4.9",
"private": true,
"description": "OpenClaw Brave plugin",
"type": "module",
+10 -23
View File
@@ -1,21 +1,11 @@
import {
resolveProviderWebSearchPluginConfig,
setProviderWebSearchPluginConfigValue,
createWebSearchProviderContractFields,
type WebSearchProviderPlugin,
} from "openclaw/plugin-sdk/provider-web-search-contract";
function getTopLevelCredentialValue(searchConfig?: Record<string, unknown>): unknown {
return searchConfig?.apiKey;
}
function setTopLevelCredentialValue(
searchConfigTarget: Record<string, unknown>,
value: unknown,
): void {
searchConfigTarget.apiKey = value;
}
} from "openclaw/plugin-sdk/provider-web-search-config-contract";
export function createBraveWebSearchProvider(): WebSearchProviderPlugin {
const credentialPath = "plugins.entries.brave.config.webSearch.apiKey";
return {
id: "brave",
label: "Brave Search",
@@ -27,15 +17,12 @@ export function createBraveWebSearchProvider(): WebSearchProviderPlugin {
signupUrl: "https://brave.com/search/api/",
docsUrl: "https://docs.openclaw.ai/brave-search",
autoDetectOrder: 10,
credentialPath: "plugins.entries.brave.config.webSearch.apiKey",
inactiveSecretPaths: ["plugins.entries.brave.config.webSearch.apiKey"],
getCredentialValue: getTopLevelCredentialValue,
setCredentialValue: setTopLevelCredentialValue,
getConfiguredCredentialValue: (config) =>
resolveProviderWebSearchPluginConfig(config, "brave")?.apiKey,
setConfiguredCredentialValue: (configTarget, value) => {
setProviderWebSearchPluginConfigValue(configTarget, "brave", "apiKey", value);
},
credentialPath,
...createWebSearchProviderContractFields({
credentialPath,
searchCredential: { type: "top-level" },
configuredCredential: { pluginId: "brave" },
}),
createTool: () => null,
};
}
+1 -1
View File
@@ -1,4 +1,4 @@
import { definePluginEntry } from "openclaw/plugin-sdk/core";
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
export default definePluginEntry({
id: "browser",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@openclaw/browser-plugin",
"version": "2026.4.8",
"version": "2026.4.9",
"private": true,
"description": "OpenClaw browser tool plugin",
"type": "module",
@@ -18,14 +18,18 @@ import {
const connectOverCdpSpy = vi.spyOn(chromium, "connectOverCDP");
const getChromeWebSocketUrlSpy = vi.spyOn(chromeModule, "getChromeWebSocketUrl");
type MockRoute = { continue: () => Promise<void>; abort: () => Promise<void> };
type MockRequest = {
isNavigationRequest: () => boolean;
frame: () => object;
resourceType?: () => string;
url: () => string;
};
type MockRouteHandler = (route: MockRoute, request: MockRequest) => Promise<void>;
function installBrowserMocks() {
const pageOn = vi.fn();
let routeHandler:
| ((
route: { continue: () => Promise<void>; abort: () => Promise<void> },
request: unknown,
) => Promise<void>)
| null = null;
let routeHandler: MockRouteHandler | null = null;
const pageGoto = vi.fn<
(...args: unknown[]) => Promise<null | { request: () => Record<string, unknown> }>
>(async () => null);
@@ -110,6 +114,61 @@ function installBrowserMocks() {
};
}
function createMockRoute(route?: Partial<MockRoute>): MockRoute {
return {
continue: vi.fn(async () => {}),
abort: vi.fn(async () => {}),
...route,
};
}
async function dispatchMockNavigation(params: {
getRouteHandler: () => MockRouteHandler | null;
mainFrame: object;
url: string;
isNavigationRequest?: boolean;
resourceType?: string;
route?: Partial<MockRoute>;
}) {
const handler = params.getRouteHandler();
if (!handler) {
throw new Error("missing route handler");
}
const { resourceType } = params;
await handler(createMockRoute(params.route), {
isNavigationRequest: () => params.isNavigationRequest ?? true,
frame: () => params.mainFrame,
...(resourceType ? { resourceType: () => resourceType } : {}),
url: () => params.url,
});
}
function mockBlockedRedirectNavigation(params: {
pageGoto: ReturnType<typeof installBrowserMocks>["pageGoto"];
getRouteHandler: () => MockRouteHandler | null;
mainFrame: object;
startUrl?: string;
hopUrl?: string;
hopIsNavigationRequest?: boolean;
hopResourceType?: string;
}) {
params.pageGoto.mockImplementationOnce(async () => {
await dispatchMockNavigation({
getRouteHandler: params.getRouteHandler,
mainFrame: params.mainFrame,
url: params.startUrl ?? "https://93.184.216.34/start",
});
await dispatchMockNavigation({
getRouteHandler: params.getRouteHandler,
mainFrame: params.mainFrame,
url: params.hopUrl ?? "http://127.0.0.1:18080/internal-hop",
isNavigationRequest: params.hopIsNavigationRequest,
resourceType: params.hopResourceType,
});
throw new Error("Navigation aborted");
});
}
afterEach(async () => {
connectOverCdpSpy.mockClear();
getChromeWebSocketUrlSpy.mockClear();
@@ -144,29 +203,7 @@ describe("pw-session createPageViaPlaywright navigation guard", () => {
it("blocks private intermediate redirect hops", async () => {
const { pageGoto, pageClose, getRouteHandler, mainFrame } = installBrowserMocks();
pageGoto.mockImplementationOnce(async () => {
const handler = getRouteHandler();
if (!handler) {
throw new Error("missing route handler");
}
await handler(
{ continue: vi.fn(async () => {}), abort: vi.fn(async () => {}) },
{
isNavigationRequest: () => true,
frame: () => mainFrame,
url: () => "https://93.184.216.34/start",
},
);
await handler(
{ continue: vi.fn(async () => {}), abort: vi.fn(async () => {}) },
{
isNavigationRequest: () => true,
frame: () => mainFrame,
url: () => "http://127.0.0.1:18080/internal-hop",
},
);
throw new Error("Navigation aborted");
});
mockBlockedRedirectNavigation({ pageGoto, getRouteHandler, mainFrame });
await expect(
createPageViaPlaywright({
@@ -181,29 +218,12 @@ describe("pw-session createPageViaPlaywright navigation guard", () => {
it("blocks private redirect hops even when Playwright marks hop as non-navigation", async () => {
const { pageGoto, pageClose, getRouteHandler, mainFrame } = installBrowserMocks();
pageGoto.mockImplementationOnce(async () => {
const handler = getRouteHandler();
if (!handler) {
throw new Error("missing route handler");
}
await handler(
{ continue: vi.fn(async () => {}), abort: vi.fn(async () => {}) },
{
isNavigationRequest: () => true,
frame: () => mainFrame,
url: () => "https://93.184.216.34/start",
},
);
await handler(
{ continue: vi.fn(async () => {}), abort: vi.fn(async () => {}) },
{
isNavigationRequest: () => false,
frame: () => mainFrame,
resourceType: () => "document",
url: () => "http://127.0.0.1:18080/internal-hop",
},
);
throw new Error("Navigation aborted");
mockBlockedRedirectNavigation({
pageGoto,
getRouteHandler,
mainFrame,
hopIsNavigationRequest: false,
hopResourceType: "document",
});
await expect(
@@ -235,23 +255,16 @@ describe("pw-session createPageViaPlaywright navigation guard", () => {
it("does not quarantine a tab when route.continue fails", async () => {
const { pageGoto, pageClose, getRouteHandler, mainFrame } = installBrowserMocks();
pageGoto.mockImplementationOnce(async () => {
const handler = getRouteHandler();
if (!handler) {
throw new Error("missing route handler");
}
await handler(
{
await dispatchMockNavigation({
getRouteHandler,
mainFrame,
url: "https://example.com",
route: {
continue: vi.fn(async () => {
throw new Error("page.goto: Frame has been detached");
}),
abort: vi.fn(async () => {}),
},
{
isNavigationRequest: () => true,
frame: () => mainFrame,
url: () => "https://example.com",
},
);
});
throw new Error("page.goto: Frame has been detached");
});
@@ -267,28 +280,11 @@ describe("pw-session createPageViaPlaywright navigation guard", () => {
it("propagates unsupported redirect protocols as navigation errors", async () => {
const { pageGoto, pageClose, getRouteHandler, mainFrame } = installBrowserMocks();
pageGoto.mockImplementationOnce(async () => {
const handler = getRouteHandler();
if (!handler) {
throw new Error("missing route handler");
}
await handler(
{ continue: vi.fn(async () => {}), abort: vi.fn(async () => {}) },
{
isNavigationRequest: () => true,
frame: () => mainFrame,
url: () => "https://93.184.216.34/start",
},
);
await handler(
{ continue: vi.fn(async () => {}), abort: vi.fn(async () => {}) },
{
isNavigationRequest: () => true,
frame: () => mainFrame,
url: () => "file:///etc/passwd",
},
);
throw new Error("Navigation aborted");
mockBlockedRedirectNavigation({
pageGoto,
getRouteHandler,
mainFrame,
hopUrl: "file:///etc/passwd",
});
await expect(
@@ -313,29 +309,7 @@ describe("pw-session createPageViaPlaywright navigation guard", () => {
throw new Error("getaddrinfo EAI_AGAIN internal-hop");
}
});
pageGoto.mockImplementationOnce(async () => {
const handler = getRouteHandler();
if (!handler) {
throw new Error("missing route handler");
}
await handler(
{ continue: vi.fn(async () => {}), abort: vi.fn(async () => {}) },
{
isNavigationRequest: () => true,
frame: () => mainFrame,
url: () => "https://93.184.216.34/start",
},
);
await handler(
{ continue: vi.fn(async () => {}), abort: vi.fn(async () => {}) },
{
isNavigationRequest: () => true,
frame: () => mainFrame,
url: () => "http://127.0.0.1:18080/internal-hop",
},
);
throw new Error("Navigation aborted");
});
mockBlockedRedirectNavigation({ pageGoto, getRouteHandler, mainFrame });
try {
const created = await createPageViaPlaywright({
@@ -362,18 +336,11 @@ describe("pw-session createPageViaPlaywright navigation guard", () => {
new Error("getaddrinfo EAI_AGAIN postcheck.example"),
);
pageGoto.mockImplementationOnce(async () => {
const handler = getRouteHandler();
if (!handler) {
throw new Error("missing route handler");
}
await handler(
{ continue: vi.fn(async () => {}), abort: vi.fn(async () => {}) },
{
isNavigationRequest: () => true,
frame: () => mainFrame,
url: () => "https://93.184.216.34/start",
},
);
await dispatchMockNavigation({
getRouteHandler,
mainFrame,
url: "https://93.184.216.34/start",
});
return {
request: () => ({
url: () => "https://93.184.216.34/final",
@@ -405,29 +372,7 @@ describe("pw-session createPageViaPlaywright navigation guard", () => {
it("keeps blocked tab quarantined if close fails", async () => {
const { pageGoto, pageClose, getRouteHandler, mainFrame } = installBrowserMocks();
pageClose.mockRejectedValueOnce(new Error("close failed"));
pageGoto.mockImplementationOnce(async () => {
const handler = getRouteHandler();
if (!handler) {
throw new Error("missing route handler");
}
await handler(
{ continue: vi.fn(async () => {}), abort: vi.fn(async () => {}) },
{
isNavigationRequest: () => true,
frame: () => mainFrame,
url: () => "https://93.184.216.34/start",
},
);
await handler(
{ continue: vi.fn(async () => {}), abort: vi.fn(async () => {}) },
{
isNavigationRequest: () => true,
frame: () => mainFrame,
url: () => "http://127.0.0.1:18080/internal-hop",
},
);
throw new Error("Navigation aborted");
});
mockBlockedRedirectNavigation({ pageGoto, getRouteHandler, mainFrame });
await expect(
createPageViaPlaywright({
@@ -455,29 +400,7 @@ describe("pw-session createPageViaPlaywright navigation guard", () => {
it("preserves blocked-target quarantine across forced reconnects", async () => {
const { pageGoto, pageClose, getRouteHandler, mainFrame } = installBrowserMocks();
pageClose.mockRejectedValueOnce(new Error("close failed"));
pageGoto.mockImplementationOnce(async () => {
const handler = getRouteHandler();
if (!handler) {
throw new Error("missing route handler");
}
await handler(
{ continue: vi.fn(async () => {}), abort: vi.fn(async () => {}) },
{
isNavigationRequest: () => true,
frame: () => mainFrame,
url: () => "https://93.184.216.34/start",
},
);
await handler(
{ continue: vi.fn(async () => {}), abort: vi.fn(async () => {}) },
{
isNavigationRequest: () => true,
frame: () => mainFrame,
url: () => "http://127.0.0.1:18080/internal-hop",
},
);
throw new Error("Navigation aborted");
});
mockBlockedRedirectNavigation({ pageGoto, getRouteHandler, mainFrame });
await expect(
createPageViaPlaywright({
@@ -503,29 +426,7 @@ describe("pw-session createPageViaPlaywright navigation guard", () => {
const { pageGoto, pageClose, getBrowserDisconnectedHandler, getRouteHandler, mainFrame } =
installBrowserMocks();
pageClose.mockRejectedValueOnce(new Error("close failed"));
pageGoto.mockImplementationOnce(async () => {
const handler = getRouteHandler();
if (!handler) {
throw new Error("missing route handler");
}
await handler(
{ continue: vi.fn(async () => {}), abort: vi.fn(async () => {}) },
{
isNavigationRequest: () => true,
frame: () => mainFrame,
url: () => "https://93.184.216.34/start",
},
);
await handler(
{ continue: vi.fn(async () => {}), abort: vi.fn(async () => {}) },
{
isNavigationRequest: () => true,
frame: () => mainFrame,
url: () => "http://127.0.0.1:18080/internal-hop",
},
);
throw new Error("Navigation aborted");
});
mockBlockedRedirectNavigation({ pageGoto, getRouteHandler, mainFrame });
await expect(
createPageViaPlaywright({
@@ -549,29 +450,7 @@ describe("pw-session createPageViaPlaywright navigation guard", () => {
it("keeps blocked tabs inaccessible when target lookup fails", async () => {
const { pageGoto, pageClose, sessionSend, getRouteHandler, mainFrame } = installBrowserMocks();
pageClose.mockRejectedValueOnce(new Error("close failed"));
pageGoto.mockImplementationOnce(async () => {
const handler = getRouteHandler();
if (!handler) {
throw new Error("missing route handler");
}
await handler(
{ continue: vi.fn(async () => {}), abort: vi.fn(async () => {}) },
{
isNavigationRequest: () => true,
frame: () => mainFrame,
url: () => "https://93.184.216.34/start",
},
);
await handler(
{ continue: vi.fn(async () => {}), abort: vi.fn(async () => {}) },
{
isNavigationRequest: () => true,
frame: () => mainFrame,
url: () => "http://127.0.0.1:18080/internal-hop",
},
);
throw new Error("Navigation aborted");
});
mockBlockedRedirectNavigation({ pageGoto, getRouteHandler, mainFrame });
await expect(
createPageViaPlaywright({
@@ -591,29 +470,7 @@ describe("pw-session createPageViaPlaywright navigation guard", () => {
it("does not fall back to another tab when explicit target lookup misses", async () => {
const { pageGoto, pageClose, sessionSend, getRouteHandler, mainFrame } = installBrowserMocks();
pageClose.mockRejectedValueOnce(new Error("close failed"));
pageGoto.mockImplementationOnce(async () => {
const handler = getRouteHandler();
if (!handler) {
throw new Error("missing route handler");
}
await handler(
{ continue: vi.fn(async () => {}), abort: vi.fn(async () => {}) },
{
isNavigationRequest: () => true,
frame: () => mainFrame,
url: () => "https://93.184.216.34/start",
},
);
await handler(
{ continue: vi.fn(async () => {}), abort: vi.fn(async () => {}) },
{
isNavigationRequest: () => true,
frame: () => mainFrame,
url: () => "http://127.0.0.1:18080/internal-hop",
},
);
throw new Error("Navigation aborted");
});
mockBlockedRedirectNavigation({ pageGoto, getRouteHandler, mainFrame });
await expect(
createPageViaPlaywright({
@@ -667,18 +524,11 @@ describe("pw-session createPageViaPlaywright navigation guard", () => {
});
pageGoto.mockImplementationOnce(async () => {
const handler = getRouteHandler();
if (!handler) {
throw new Error("missing route handler");
}
await handler(
{ continue: vi.fn(async () => {}), abort: vi.fn(async () => {}) },
{
isNavigationRequest: () => true,
frame: () => mainFrame,
url: () => "http://127.0.0.1:18080/internal-hop",
},
);
await dispatchMockNavigation({
getRouteHandler,
mainFrame,
url: "http://127.0.0.1:18080/internal-hop",
});
throw new Error("Navigation aborted");
});
@@ -716,18 +566,11 @@ describe("pw-session createPageViaPlaywright navigation guard", () => {
});
first.pageGoto.mockImplementationOnce(async () => {
const handler = first.getRouteHandler();
if (!handler) {
throw new Error("missing route handler");
}
await handler(
{ continue: vi.fn(async () => {}), abort: vi.fn(async () => {}) },
{
isNavigationRequest: () => true,
frame: () => first.mainFrame,
url: () => "http://127.0.0.1:18080/internal-hop",
},
);
await dispatchMockNavigation({
getRouteHandler: first.getRouteHandler,
mainFrame: first.mainFrame,
url: "http://127.0.0.1:18080/internal-hop",
});
throw new Error("Navigation aborted");
});
@@ -52,8 +52,13 @@ describe("pw-tools-core browser SSRF guards", () => {
});
it("re-checks click-triggered navigations with the session safety helper", async () => {
pageState.page = { url: vi.fn(() => "https://example.com") };
pageState.locator = { click: vi.fn(async () => {}) };
let currentUrl = "https://example.com";
pageState.page = { url: vi.fn(() => currentUrl) };
pageState.locator = {
click: vi.fn(async () => {
currentUrl = "https://target.example";
}),
};
await interactions.clickViaPlaywright({
cdpUrl: "http://127.0.0.1:18792",
@@ -86,8 +91,13 @@ describe("pw-tools-core browser SSRF guards", () => {
});
it("re-checks batched click-triggered navigations with the session safety helper", async () => {
pageState.page = { url: vi.fn(() => "https://example.com") };
pageState.locator = { click: vi.fn(async () => {}) };
let currentUrl = "https://example.com";
pageState.page = { url: vi.fn(() => currentUrl) };
pageState.locator = {
click: vi.fn(async () => {
currentUrl = "https://target.example";
}),
};
await interactions.batchViaPlaywright({
cdpUrl: "http://127.0.0.1:18792",
@@ -65,7 +65,7 @@ describe("pw-tools-core", () => {
throw new Error(errorMessage);
});
setPwToolsCoreCurrentRefLocator({ click });
setPwToolsCoreCurrentPage({});
setPwToolsCoreCurrentPage({ url: vi.fn(() => "https://example.com") });
await expect(
mod.clickViaPlaywright({
@@ -82,7 +82,7 @@ describe("pw-tools-core", () => {
);
});
setPwToolsCoreCurrentRefLocator({ click });
setPwToolsCoreCurrentPage({});
setPwToolsCoreCurrentPage({ url: vi.fn(() => "https://example.com") });
await expect(
mod.clickViaPlaywright({
@@ -1,6 +1,9 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
let page: { evaluate: ReturnType<typeof vi.fn> } | null = null;
let page: {
evaluate: ReturnType<typeof vi.fn>;
url: ReturnType<typeof vi.fn>;
} | null = null;
const getPageForTargetId = vi.fn(async () => {
if (!page) {
@@ -9,6 +12,7 @@ const getPageForTargetId = vi.fn(async () => {
return page;
});
const ensurePageState = vi.fn(() => {});
const assertPageNavigationCompletedSafely = vi.fn(async () => {});
const forceDisconnectPlaywrightForTarget = vi.fn(async () => {});
const refLocator = vi.fn(() => {
throw new Error("test: refLocator should not be called");
@@ -19,6 +23,7 @@ const closePageViaPlaywright = vi.fn(async () => {});
const resizeViewportViaPlaywright = vi.fn(async () => {});
vi.mock("./pw-session.js", () => ({
assertPageNavigationCompletedSafely,
ensurePageState,
forceDisconnectPlaywrightForTarget,
getPageForTargetId,
@@ -38,6 +43,7 @@ describe("batchViaPlaywright", () => {
vi.clearAllMocks();
page = {
evaluate: vi.fn(async () => "ok"),
url: vi.fn(() => "about:blank"),
};
});
@@ -1,6 +1,6 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
let page: { evaluate: ReturnType<typeof vi.fn> } | null = null;
let page: { evaluate: ReturnType<typeof vi.fn>; url: ReturnType<typeof vi.fn> } | null = null;
let locator: { evaluate: ReturnType<typeof vi.fn> } | null = null;
const forceDisconnectPlaywrightForTarget = vi.fn(async () => {});
@@ -11,6 +11,7 @@ const getPageForTargetId = vi.fn(async () => {
return page;
});
const ensurePageState = vi.fn(() => {});
const assertPageNavigationCompletedSafely = vi.fn(async () => {});
const restoreRoleRefsForTarget = vi.fn(() => {});
const refLocator = vi.fn(() => {
if (!locator) {
@@ -21,6 +22,7 @@ const refLocator = vi.fn(() => {
vi.mock("./pw-session.js", () => {
return {
assertPageNavigationCompletedSafely,
ensurePageState,
forceDisconnectPlaywrightForTarget,
getPageForTargetId,
@@ -64,6 +66,7 @@ describe("evaluateViaPlaywright (abort)", () => {
}
return pendingPromise;
}),
url: vi.fn(() => "https://example.com/current"),
};
locator = {
evaluate: vi.fn(() => {
@@ -0,0 +1,582 @@
import { describe, expect, it, vi } from "vitest";
import {
getPwToolsCoreSessionMocks,
installPwToolsCoreTestHooks,
setPwToolsCoreCurrentPage,
setPwToolsCoreCurrentRefLocator,
} from "./pw-tools-core.test-harness.js";
installPwToolsCoreTestHooks();
const mod = await import("./pw-tools-core.js");
describe("pw-tools-core interaction navigation guard", () => {
it("waits for the grace window before completing a successful non-navigating click", async () => {
vi.useFakeTimers();
try {
const listeners = new Set<() => void>();
const click = vi.fn(async () => {});
const page = {
on: vi.fn((event: string, listener: () => void) => {
if (event === "framenavigated") {
listeners.add(listener);
}
}),
off: vi.fn((event: string, listener: () => void) => {
if (event === "framenavigated") {
listeners.delete(listener);
}
}),
url: vi.fn(() => "http://127.0.0.1:9222/json/version"),
};
setPwToolsCoreCurrentRefLocator({ click });
setPwToolsCoreCurrentPage(page);
const completion = vi.fn();
const task = mod
.clickViaPlaywright({
cdpUrl: "http://127.0.0.1:18792",
targetId: "T1",
ref: "1",
ssrfPolicy: { allowPrivateNetwork: false },
})
.then(completion);
await vi.advanceTimersByTimeAsync(0);
expect(completion).not.toHaveBeenCalled();
expect(listeners.size).toBe(1);
expect(
getPwToolsCoreSessionMocks().assertPageNavigationCompletedSafely,
).not.toHaveBeenCalled();
await vi.advanceTimersByTimeAsync(250);
await task;
expect(completion).toHaveBeenCalledTimes(1);
expect(listeners.size).toBe(0);
} finally {
vi.useRealTimers();
}
});
it("runs the post-click navigation guard when navigation starts shortly after the click resolves", async () => {
vi.useFakeTimers();
try {
const listeners = new Set<() => void>();
let currentUrl = "http://127.0.0.1:9222/json/version";
const click = vi.fn(async () => {
setTimeout(() => {
currentUrl = "http://127.0.0.1:9222/json/list";
for (const listener of listeners) {
listener();
}
}, 10);
});
const page = {
on: vi.fn((event: string, listener: () => void) => {
if (event === "framenavigated") {
listeners.add(listener);
}
}),
off: vi.fn((event: string, listener: () => void) => {
if (event === "framenavigated") {
listeners.delete(listener);
}
}),
url: vi.fn(() => currentUrl),
};
setPwToolsCoreCurrentRefLocator({ click });
setPwToolsCoreCurrentPage(page);
const completion = vi.fn();
const task = mod
.clickViaPlaywright({
cdpUrl: "http://127.0.0.1:18792",
targetId: "T1",
ref: "1",
ssrfPolicy: { allowPrivateNetwork: false },
})
.then(completion);
await vi.advanceTimersByTimeAsync(0);
expect(completion).not.toHaveBeenCalled();
expect(
getPwToolsCoreSessionMocks().assertPageNavigationCompletedSafely,
).not.toHaveBeenCalled();
await vi.advanceTimersByTimeAsync(10);
await task;
expect(completion).toHaveBeenCalledTimes(1);
expect(getPwToolsCoreSessionMocks().assertPageNavigationCompletedSafely).toHaveBeenCalledWith(
{
cdpUrl: "http://127.0.0.1:18792",
page,
response: null,
ssrfPolicy: { allowPrivateNetwork: false },
targetId: "T1",
},
);
} finally {
vi.useRealTimers();
}
});
it("ignores subframe framenavigated events before the main frame navigates", async () => {
vi.useFakeTimers();
try {
const listeners = new Set<(frame: object) => void>();
const mainFrame = {};
const subframe = {};
let currentUrl = "http://127.0.0.1:9222/json/version";
const click = vi.fn(async () => {
setTimeout(() => {
for (const listener of listeners) {
listener(subframe);
}
}, 10);
setTimeout(() => {
currentUrl = "http://127.0.0.1:9222/json/list";
for (const listener of listeners) {
listener(mainFrame);
}
}, 20);
});
const page = {
mainFrame: vi.fn(() => mainFrame),
on: vi.fn((event: string, listener: (frame: object) => void) => {
if (event === "framenavigated") {
listeners.add(listener);
}
}),
off: vi.fn((event: string, listener: (frame: object) => void) => {
if (event === "framenavigated") {
listeners.delete(listener);
}
}),
url: vi.fn(() => currentUrl),
};
setPwToolsCoreCurrentRefLocator({ click });
setPwToolsCoreCurrentPage(page);
const task = mod.clickViaPlaywright({
cdpUrl: "http://127.0.0.1:18792",
targetId: "T1",
ref: "1",
ssrfPolicy: { allowPrivateNetwork: false },
});
await vi.advanceTimersByTimeAsync(10);
expect(listeners.size).toBe(1);
expect(
getPwToolsCoreSessionMocks().assertPageNavigationCompletedSafely,
).not.toHaveBeenCalled();
await vi.advanceTimersByTimeAsync(10);
await task;
expect(getPwToolsCoreSessionMocks().assertPageNavigationCompletedSafely).toHaveBeenCalledWith(
{
cdpUrl: "http://127.0.0.1:18792",
page,
response: null,
ssrfPolicy: { allowPrivateNetwork: false },
targetId: "T1",
},
);
} finally {
vi.useRealTimers();
}
});
it("deduplicates delayed navigation guards across repeated successful interactions", async () => {
vi.useFakeTimers();
try {
const listeners = new Set<() => void>();
let currentUrl = "http://127.0.0.1:9222/json/version";
const click = vi.fn(async () => {});
const page = {
on: vi.fn((event: string, listener: () => void) => {
if (event === "framenavigated") {
listeners.add(listener);
}
}),
off: vi.fn((event: string, listener: () => void) => {
if (event === "framenavigated") {
listeners.delete(listener);
}
}),
url: vi.fn(() => currentUrl),
};
setPwToolsCoreCurrentRefLocator({ click });
setPwToolsCoreCurrentPage(page);
const first = mod.clickViaPlaywright({
cdpUrl: "http://127.0.0.1:18792",
targetId: "T1",
ref: "1",
ssrfPolicy: { allowPrivateNetwork: false },
});
await vi.advanceTimersByTimeAsync(0);
expect(listeners.size).toBe(1);
const second = mod.clickViaPlaywright({
cdpUrl: "http://127.0.0.1:18792",
targetId: "T1",
ref: "1",
ssrfPolicy: { allowPrivateNetwork: false },
});
await vi.advanceTimersByTimeAsync(0);
expect(listeners.size).toBe(1);
currentUrl = "http://127.0.0.1:9222/json/list";
for (const listener of Array.from(listeners)) {
listener();
}
await vi.advanceTimersByTimeAsync(0);
await Promise.all([first, second]);
expect(
getPwToolsCoreSessionMocks().assertPageNavigationCompletedSafely,
).toHaveBeenCalledTimes(1);
expect(listeners.size).toBe(0);
} finally {
vi.useRealTimers();
}
});
it("propagates blocked delayed navigation instead of reporting click success", async () => {
vi.useFakeTimers();
try {
const listeners = new Set<() => void>();
let currentUrl = "http://127.0.0.1:9222/json/version";
const click = vi.fn(async () => {
setTimeout(() => {
currentUrl = "http://127.0.0.1:9222/private-target";
for (const listener of listeners) {
listener();
}
}, 10);
});
const page = {
on: vi.fn((event: string, listener: () => void) => {
if (event === "framenavigated") {
listeners.add(listener);
}
}),
off: vi.fn((event: string, listener: () => void) => {
if (event === "framenavigated") {
listeners.delete(listener);
}
}),
url: vi.fn(() => currentUrl),
};
setPwToolsCoreCurrentRefLocator({ click });
setPwToolsCoreCurrentPage(page);
const blocked = new Error("blocked delayed interaction navigation");
getPwToolsCoreSessionMocks().assertPageNavigationCompletedSafely.mockRejectedValueOnce(
blocked,
);
const task = mod.clickViaPlaywright({
cdpUrl: "http://127.0.0.1:18792",
targetId: "T1",
ref: "1",
ssrfPolicy: { allowPrivateNetwork: false },
});
const rejection = expect(task).rejects.toThrow("blocked delayed interaction navigation");
await vi.advanceTimersByTimeAsync(10);
await rejection;
expect(listeners.size).toBe(0);
} finally {
vi.useRealTimers();
}
});
it("runs the post-click navigation guard with the resolved SSRF policy", async () => {
const click = vi.fn(async () => {});
const page = {
url: vi
.fn()
.mockReturnValueOnce("http://127.0.0.1:9222/json/version")
.mockReturnValue("http://127.0.0.1:9222/json/list"),
};
setPwToolsCoreCurrentRefLocator({ click });
setPwToolsCoreCurrentPage(page);
const blocked = new Error("blocked interaction navigation");
getPwToolsCoreSessionMocks().assertPageNavigationCompletedSafely.mockRejectedValueOnce(blocked);
await expect(
mod.clickViaPlaywright({
cdpUrl: "http://127.0.0.1:18792",
targetId: "T1",
ref: "1",
ssrfPolicy: { allowPrivateNetwork: false },
}),
).rejects.toThrow("blocked interaction navigation");
expect(getPwToolsCoreSessionMocks().assertPageNavigationCompletedSafely).toHaveBeenCalledWith({
cdpUrl: "http://127.0.0.1:18792",
page,
response: null,
ssrfPolicy: { allowPrivateNetwork: false },
targetId: "T1",
});
});
it("skips interaction navigation guards when no explicit SSRF policy is provided", async () => {
vi.useFakeTimers();
try {
const listeners = new Set<(frame: object) => void>();
const mainFrame = {};
let currentUrl = "http://127.0.0.1:9222/json/version";
const click = vi.fn(async () => {
currentUrl = "http://127.0.0.1:9222/json/list";
for (const listener of listeners) {
listener(mainFrame);
}
});
const page = {
mainFrame: vi.fn(() => mainFrame),
on: vi.fn((event: string, listener: (frame: object) => void) => {
if (event === "framenavigated") {
listeners.add(listener);
}
}),
off: vi.fn((event: string, listener: (frame: object) => void) => {
if (event === "framenavigated") {
listeners.delete(listener);
}
}),
url: vi.fn(() => currentUrl),
};
setPwToolsCoreCurrentRefLocator({ click });
setPwToolsCoreCurrentPage(page);
await mod.clickViaPlaywright({
cdpUrl: "http://127.0.0.1:18792",
targetId: "T1",
ref: "1",
});
await vi.runAllTimersAsync();
expect(page.on).not.toHaveBeenCalled();
expect(page.off).not.toHaveBeenCalled();
expect(
getPwToolsCoreSessionMocks().assertPageNavigationCompletedSafely,
).not.toHaveBeenCalled();
} finally {
vi.useRealTimers();
}
});
it("runs the post-evaluate navigation guard after page evaluation", async () => {
const page = {
evaluate: vi.fn(async () => "ok"),
url: vi
.fn()
.mockReturnValueOnce("http://127.0.0.1:9222/json/version")
.mockReturnValue("http://127.0.0.1:9222/json/list"),
};
setPwToolsCoreCurrentPage(page);
const result = await mod.evaluateViaPlaywright({
cdpUrl: "http://127.0.0.1:18792",
targetId: "T1",
fn: "() => location.href = 'http://127.0.0.1:9222/json/version'",
ssrfPolicy: { allowPrivateNetwork: false },
});
expect(result).toBe("ok");
expect(getPwToolsCoreSessionMocks().assertPageNavigationCompletedSafely).toHaveBeenCalledWith({
cdpUrl: "http://127.0.0.1:18792",
page,
response: null,
ssrfPolicy: { allowPrivateNetwork: false },
targetId: "T1",
});
});
it("does not run the post-click navigation guard when the url is unchanged", async () => {
const click = vi.fn(async () => {});
const page = { url: vi.fn(() => "http://127.0.0.1:9222/json/version") };
setPwToolsCoreCurrentRefLocator({ click });
setPwToolsCoreCurrentPage(page);
await mod.clickViaPlaywright({
cdpUrl: "http://127.0.0.1:18792",
targetId: "T1",
ref: "1",
ssrfPolicy: { allowPrivateNetwork: false },
});
expect(getPwToolsCoreSessionMocks().assertPageNavigationCompletedSafely).not.toHaveBeenCalled();
});
it("does not run the navigation guard when only the URL hash changes (same-document navigation)", async () => {
const click = vi.fn(async () => {});
const page = {
url: vi
.fn()
.mockReturnValueOnce("https://example.com/page")
.mockReturnValue("https://example.com/page#section"),
};
setPwToolsCoreCurrentRefLocator({ click });
setPwToolsCoreCurrentPage(page);
await mod.clickViaPlaywright({
cdpUrl: "http://127.0.0.1:18792",
targetId: "T1",
ref: "1",
ssrfPolicy: { allowPrivateNetwork: false },
});
expect(getPwToolsCoreSessionMocks().assertPageNavigationCompletedSafely).not.toHaveBeenCalled();
});
it("runs the navigation guard when a same-URL reload fires framenavigated during a click", async () => {
// A page reload (form submit, location.reload()) keeps the URL identical but
// fires framenavigated. Prior to the isHashOnlyNavigation fix, didCrossDocumentUrlChange
// would treat currentUrl === previousUrl as "no navigation" and skip the SSRF guard.
const listeners = new Set<() => void>();
const sameUrl = "http://192.168.1.1/admin";
const click = vi.fn(async () => {
// Simulate reload: URL stays the same but framenavigated fires during the click
for (const listener of listeners) {
listener();
}
});
const page = {
on: vi.fn((event: string, listener: () => void) => {
if (event === "framenavigated") {
listeners.add(listener);
}
}),
off: vi.fn((event: string, listener: () => void) => {
if (event === "framenavigated") {
listeners.delete(listener);
}
}),
url: vi.fn(() => sameUrl),
};
setPwToolsCoreCurrentRefLocator({ click });
setPwToolsCoreCurrentPage(page);
await mod.clickViaPlaywright({
cdpUrl: "http://127.0.0.1:18792",
targetId: "T1",
ref: "1",
ssrfPolicy: { allowPrivateNetwork: false },
});
expect(getPwToolsCoreSessionMocks().assertPageNavigationCompletedSafely).toHaveBeenCalledWith({
cdpUrl: "http://127.0.0.1:18792",
page,
response: null,
ssrfPolicy: { allowPrivateNetwork: false },
targetId: "T1",
});
});
it("does not run the post-evaluate navigation guard when the url is unchanged", async () => {
const page = {
evaluate: vi.fn(async () => "ok"),
url: vi.fn(() => "http://127.0.0.1:9222/json/version"),
};
setPwToolsCoreCurrentPage(page);
const result = await mod.evaluateViaPlaywright({
cdpUrl: "http://127.0.0.1:18792",
targetId: "T1",
fn: "() => 1",
ssrfPolicy: { allowPrivateNetwork: false },
});
expect(result).toBe("ok");
expect(getPwToolsCoreSessionMocks().assertPageNavigationCompletedSafely).not.toHaveBeenCalled();
});
it("propagates the SSRF policy through batch interaction actions", async () => {
const click = vi.fn(async () => {});
const page = {
url: vi.fn().mockReturnValueOnce("about:blank").mockReturnValue("https://example.com/after"),
};
setPwToolsCoreCurrentRefLocator({ click });
setPwToolsCoreCurrentPage(page);
await mod.batchViaPlaywright({
cdpUrl: "http://127.0.0.1:18792",
targetId: "T1",
ssrfPolicy: { allowPrivateNetwork: false },
actions: [{ kind: "click", ref: "1" }],
});
expect(getPwToolsCoreSessionMocks().assertPageNavigationCompletedSafely).toHaveBeenCalledWith({
cdpUrl: "http://127.0.0.1:18792",
page,
response: null,
ssrfPolicy: { allowPrivateNetwork: false },
targetId: "T1",
});
});
it("runs the post-evaluate navigation guard when evaluate rejects after triggering navigation", async () => {
vi.useFakeTimers();
try {
const listeners = new Set<() => void>();
let currentUrl = "http://127.0.0.1:9222/json/version";
const page = {
evaluate: vi.fn(async () => {
setTimeout(() => {
currentUrl = "http://127.0.0.1:9222/json/list";
for (const listener of listeners) {
listener();
}
}, 0);
throw new Error("evaluate failed after scheduling navigation");
}),
on: vi.fn((event: string, listener: () => void) => {
if (event === "framenavigated") {
listeners.add(listener);
}
}),
off: vi.fn((event: string, listener: () => void) => {
if (event === "framenavigated") {
listeners.delete(listener);
}
}),
url: vi.fn(() => currentUrl),
};
setPwToolsCoreCurrentPage(page);
const blocked = new Error("blocked interaction navigation");
getPwToolsCoreSessionMocks().assertPageNavigationCompletedSafely.mockRejectedValueOnce(
blocked,
);
const task = mod.evaluateViaPlaywright({
cdpUrl: "http://127.0.0.1:18792",
targetId: "T1",
fn: "() => location.href = 'http://127.0.0.1:9222/json/list'",
ssrfPolicy: { allowPrivateNetwork: false },
});
const expectation = expect(task).rejects.toThrow("blocked interaction navigation");
await vi.runAllTimersAsync();
await expectation;
expect(getPwToolsCoreSessionMocks().assertPageNavigationCompletedSafely).toHaveBeenCalledWith(
{
cdpUrl: "http://127.0.0.1:18792",
page,
response: null,
ssrfPolicy: { allowPrivateNetwork: false },
targetId: "T1",
},
);
} finally {
vi.useRealTimers();
}
});
});
@@ -1,4 +1,5 @@
import { normalizeOptionalString } from "openclaw/plugin-sdk/text-runtime";
import type { Frame, Page } from "playwright-core";
import { formatErrorMessage } from "../infra/errors.js";
import type { SsrFPolicy } from "../infra/net/ssrf.js";
import type { BrowserActRequest, BrowserFormField } from "./client-actions-core.js";
@@ -28,6 +29,15 @@ type TargetOpts = {
const MAX_CLICK_DELAY_MS = 5_000;
const MAX_WAIT_TIME_MS = 30_000;
const MAX_BATCH_ACTIONS = 100;
const INTERACTION_NAVIGATION_GRACE_MS = 250;
type NavigationObservablePage = Pick<Page, "url"> & {
mainFrame?: () => Frame;
on?: (event: "framenavigated", listener: (frame: Frame) => void) => unknown;
off?: (event: "framenavigated", listener: (frame: Frame) => void) => unknown;
};
const pendingInteractionNavigationGuardCleanup = new WeakMap<Page, () => void>();
function resolveBoundedDelayMs(value: number | undefined, label: string, maxMs: number): number {
const normalized = Math.floor(value ?? 0);
@@ -51,6 +61,264 @@ function resolveInteractionTimeoutMs(timeoutMs?: number): number {
return Math.max(500, Math.min(60_000, Math.floor(timeoutMs ?? 8000)));
}
// Returns true only when the URL change indicates a cross-document navigation
// (i.e., a real network fetch occurred). Same-document hash-only mutations —
// anchor clicks and history.pushState/replaceState that change only the
// fragment — do not cause a network request and must not trigger SSRF checks.
function didCrossDocumentUrlChange(page: { url(): string }, previousUrl: string): boolean {
const currentUrl = page.url();
if (currentUrl === previousUrl) {
return false;
}
try {
const prev = new URL(previousUrl);
const curr = new URL(currentUrl);
if (
prev.origin === curr.origin &&
prev.pathname === curr.pathname &&
prev.search === curr.search
) {
// Only the fragment changed — same-document navigation, no fetch.
return false;
}
} catch {
// Non-parseable URL; fall through to string comparison.
}
return true;
}
// Returns true when a framenavigated event represents only a hash-only
// same-document mutation (no network request). Used in event-driven checks
// where the event itself is the navigation signal — unlike URL polling, we
// cannot use identical URLs as a "no navigation" sentinel because same-URL
// reloads and form submits also fire framenavigated with an unchanged URL.
function isHashOnlyNavigation(currentUrl: string, previousUrl: string): boolean {
if (currentUrl === previousUrl) {
// Exact same URL + framenavigated firing = reload or form submit, not a
// fragment hop. Must run SSRF checks.
return false;
}
try {
const prev = new URL(previousUrl);
const curr = new URL(currentUrl);
return (
prev.origin === curr.origin && prev.pathname === curr.pathname && prev.search === curr.search
);
} catch {
return false;
}
}
function isMainFrameNavigation(page: NavigationObservablePage, frame: Frame): boolean {
if (typeof page.mainFrame !== "function") {
return true;
}
return frame === page.mainFrame();
}
function observeDelayedInteractionNavigation(
page: NavigationObservablePage,
previousUrl: string,
): Promise<boolean> {
if (didCrossDocumentUrlChange(page, previousUrl)) {
return Promise.resolve(true);
}
if (typeof page.on !== "function" || typeof page.off !== "function") {
return Promise.resolve(false);
}
return new Promise<boolean>((resolve) => {
const onFrameNavigated = (frame: Frame) => {
if (!isMainFrameNavigation(page, frame)) {
return;
}
// Use isHashOnlyNavigation rather than !didCrossDocumentUrlChange: the
// event firing is itself the navigation signal, so a same-URL reload must
// not be treated as "no navigation" the way URL polling would.
if (isHashOnlyNavigation(page.url(), previousUrl)) {
return;
}
cleanup();
resolve(true);
};
const timeout = setTimeout(() => {
cleanup();
resolve(didCrossDocumentUrlChange(page, previousUrl));
}, INTERACTION_NAVIGATION_GRACE_MS);
const cleanup = () => {
clearTimeout(timeout);
// Call off directly on page (not via a cached reference) to preserve
// Playwright's EventEmitter `this` binding.
page.off!("framenavigated", onFrameNavigated);
};
// Call on directly on page (not via a cached reference) to preserve
// Playwright's EventEmitter `this` binding.
page.on!("framenavigated", onFrameNavigated);
});
}
function scheduleDelayedInteractionNavigationGuard(opts: {
cdpUrl: string;
page: Page;
previousUrl: string;
ssrfPolicy?: SsrFPolicy;
targetId?: string;
}): Promise<void> {
if (!opts.ssrfPolicy) {
return Promise.resolve();
}
const page = opts.page as unknown as NavigationObservablePage;
if (didCrossDocumentUrlChange(page, opts.previousUrl)) {
return assertPageNavigationCompletedSafely({
cdpUrl: opts.cdpUrl,
page: opts.page,
response: null,
ssrfPolicy: opts.ssrfPolicy,
targetId: opts.targetId,
});
}
if (typeof page.on !== "function" || typeof page.off !== "function") {
return Promise.resolve();
}
pendingInteractionNavigationGuardCleanup.get(opts.page)?.();
return new Promise<void>((resolve, reject) => {
const settle = (err?: unknown) => {
cleanup();
if (err) {
reject(err);
return;
}
resolve();
};
const onFrameNavigated = (frame: Frame) => {
if (!isMainFrameNavigation(page, frame)) {
return;
}
// Use isHashOnlyNavigation rather than !didCrossDocumentUrlChange: the
// event firing is itself the navigation signal, so a same-URL reload must
// not be treated as "no navigation" the way URL polling would.
if (isHashOnlyNavigation(page.url(), opts.previousUrl)) {
return;
}
cleanup();
void assertPageNavigationCompletedSafely({
cdpUrl: opts.cdpUrl,
page: opts.page,
response: null,
ssrfPolicy: opts.ssrfPolicy,
targetId: opts.targetId,
}).then(() => settle(), settle);
};
const timeout = setTimeout(() => {
settle();
}, INTERACTION_NAVIGATION_GRACE_MS);
const cleanup = () => {
clearTimeout(timeout);
page.off!("framenavigated", onFrameNavigated);
if (pendingInteractionNavigationGuardCleanup.get(opts.page) === settle) {
pendingInteractionNavigationGuardCleanup.delete(opts.page);
}
};
pendingInteractionNavigationGuardCleanup.set(opts.page, settle);
page.on!("framenavigated", onFrameNavigated);
});
}
async function assertInteractionNavigationCompletedSafely<T>(opts: {
action: () => Promise<T>;
cdpUrl: string;
page: Page;
previousUrl: string;
ssrfPolicy?: SsrFPolicy;
targetId?: string;
}): Promise<T> {
if (!opts.ssrfPolicy) {
return await opts.action();
}
// Phase 1: keep a framenavigated listener alive for the entire duration of the
// action so navigations triggered mid-click or mid-evaluate are not missed.
// Using a fixed pre-action timer would expire before the action finishes for
// slow interactions, silently bypassing the SSRF guard.
const navPage = opts.page as unknown as NavigationObservablePage;
let navigatedDuringAction = false;
const onFrameNavigated = (frame: Frame) => {
if (!isMainFrameNavigation(navPage, frame)) {
return;
}
// Use isHashOnlyNavigation rather than didCrossDocumentUrlChange: the event
// firing is the navigation signal, so a same-URL reload must not be skipped
// the way it would be by URL-equality polling.
if (!isHashOnlyNavigation(opts.page.url(), opts.previousUrl)) {
navigatedDuringAction = true;
}
};
if (typeof navPage.on === "function") {
navPage.on("framenavigated", onFrameNavigated);
}
let result: T | undefined;
let actionError: unknown = null;
try {
result = await opts.action();
} catch (err) {
actionError = err;
} finally {
if (typeof navPage.off === "function") {
navPage.off("framenavigated", onFrameNavigated);
}
}
const navigationObserved =
navigatedDuringAction || didCrossDocumentUrlChange(opts.page, opts.previousUrl);
if (navigationObserved) {
await assertPageNavigationCompletedSafely({
cdpUrl: opts.cdpUrl,
page: opts.page,
response: null,
ssrfPolicy: opts.ssrfPolicy,
targetId: opts.targetId,
});
} else if (actionError) {
// Preserve the action-error path semantics: if a rejected click/evaluate still
// triggers a delayed navigation, the SSRF block must win over the original
// action error instead of surfacing a stale interaction failure.
const delayedNavigationObserved = await observeDelayedInteractionNavigation(
opts.page,
opts.previousUrl,
);
if (delayedNavigationObserved) {
await assertPageNavigationCompletedSafely({
cdpUrl: opts.cdpUrl,
page: opts.page,
response: null,
ssrfPolicy: opts.ssrfPolicy,
targetId: opts.targetId,
});
}
} else {
// Successful interactions still need a short grace window: a click can resolve
// before the navigation event fires, and a blocked late hop must be observable
// to the current caller instead of only quarantining the page in the background.
await scheduleDelayedInteractionNavigationGuard({
cdpUrl: opts.cdpUrl,
page: opts.page,
previousUrl: opts.previousUrl,
ssrfPolicy: opts.ssrfPolicy,
targetId: opts.targetId,
});
}
if (actionError) {
throw actionError;
}
return result as T;
}
async function awaitEvalWithAbort<T>(
evalPromise: Promise<T>,
abortPromise?: Promise<never>,
@@ -118,28 +386,32 @@ export async function clickViaPlaywright(opts: {
? refLocator(page, requireRef(resolved.ref))
: page.locator(resolved.selector!);
const timeout = resolveInteractionTimeoutMs(opts.timeoutMs);
const previousUrl = page.url();
try {
const delayMs = resolveBoundedDelayMs(opts.delayMs, "click delayMs", MAX_CLICK_DELAY_MS);
if (delayMs > 0) {
await locator.hover({ timeout });
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
if (opts.doubleClick) {
await locator.dblclick({
timeout,
button: opts.button,
modifiers: opts.modifiers,
});
} else {
await locator.click({
timeout,
button: opts.button,
modifiers: opts.modifiers,
});
}
await assertPostInteractionNavigationSafe({
await assertInteractionNavigationCompletedSafely({
action: async () => {
const delayMs = resolveBoundedDelayMs(opts.delayMs, "click delayMs", MAX_CLICK_DELAY_MS);
if (delayMs > 0) {
await locator.hover({ timeout });
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
if (opts.doubleClick) {
await locator.dblclick({
timeout,
button: opts.button,
modifiers: opts.modifiers,
});
return;
}
await locator.click({
timeout,
button: opts.button,
modifiers: opts.modifiers,
});
},
cdpUrl: opts.cdpUrl,
page,
previousUrl,
ssrfPolicy: opts.ssrfPolicy,
targetId: opts.targetId,
});
@@ -332,6 +604,7 @@ export async function fillFormViaPlaywright(opts: {
export async function evaluateViaPlaywright(opts: {
cdpUrl: string;
targetId?: string;
ssrfPolicy?: SsrFPolicy;
fn: string;
ref?: string;
timeoutMs?: number;
@@ -393,6 +666,7 @@ export async function evaluateViaPlaywright(opts: {
try {
if (opts.ref) {
const locator = refLocator(page, opts.ref);
const previousUrl = page.url();
// eslint-disable-next-line @typescript-eslint/no-implied-eval -- required for browser-context eval
const elementEvaluator = new Function(
"el",
@@ -421,9 +695,18 @@ export async function evaluateViaPlaywright(opts: {
fnBody: fnText,
timeoutMs: evaluateTimeout,
});
return await awaitEvalWithAbort(evalPromise, abortPromise);
const result = await assertInteractionNavigationCompletedSafely({
action: () => awaitEvalWithAbort(evalPromise, abortPromise),
cdpUrl: opts.cdpUrl,
page,
previousUrl,
ssrfPolicy: opts.ssrfPolicy,
targetId: opts.targetId,
});
return result;
}
const previousUrl = page.url();
// eslint-disable-next-line @typescript-eslint/no-implied-eval -- required for browser-context eval
const browserEvaluator = new Function(
"args",
@@ -451,7 +734,15 @@ export async function evaluateViaPlaywright(opts: {
fnBody: fnText,
timeoutMs: evaluateTimeout,
});
return await awaitEvalWithAbort(evalPromise, abortPromise);
const result = await assertInteractionNavigationCompletedSafely({
action: () => awaitEvalWithAbort(evalPromise, abortPromise),
cdpUrl: opts.cdpUrl,
page,
previousUrl,
ssrfPolicy: opts.ssrfPolicy,
targetId: opts.targetId,
});
return result;
} finally {
if (signal && abortListener) {
signal.removeEventListener("abort", abortListener);
@@ -880,6 +1171,7 @@ async function executeSingleAction(
await evaluateViaPlaywright({
cdpUrl,
targetId: effectiveTargetId,
ssrfPolicy,
fn: action.fn,
ref: action.ref,
timeoutMs: action.timeoutMs,
@@ -895,10 +1187,10 @@ async function executeSingleAction(
await batchViaPlaywright({
cdpUrl,
targetId: effectiveTargetId,
ssrfPolicy,
actions: action.actions,
stopOnError: action.stopOnError,
evaluateEnabled,
ssrfPolicy,
depth: depth + 1,
});
break;
@@ -100,8 +100,8 @@ export function registerBrowserAgentActHookRoutes(
await pw.clickViaPlaywright({
cdpUrl,
targetId: tab.targetId,
ref,
ssrfPolicy: ctx.state().resolved.ssrfPolicy,
ref,
});
}
}
@@ -539,8 +539,8 @@ export function registerBrowserAgentActRoutes(
const clickRequest: Parameters<typeof pw.clickViaPlaywright>[0] = {
cdpUrl,
targetId: tab.targetId,
ssrfPolicy: ctx.state().resolved.ssrfPolicy,
doubleClick,
ssrfPolicy,
};
if (ref) {
clickRequest.ref = ref;
@@ -1047,6 +1047,7 @@ export function registerBrowserAgentActRoutes(
const evalRequest: Parameters<typeof pw.evaluateViaPlaywright>[0] = {
cdpUrl,
targetId: tab.targetId,
ssrfPolicy: ctx.state().resolved.ssrfPolicy,
fn,
ref,
signal: req.signal,
@@ -1106,10 +1107,10 @@ export function registerBrowserAgentActRoutes(
const result = await pw.batchViaPlaywright({
cdpUrl,
targetId: tab.targetId,
ssrfPolicy: ctx.state().resolved.ssrfPolicy,
actions,
stopOnError,
evaluateEnabled,
ssrfPolicy,
});
return res.json({ ok: true, targetId: tab.targetId, results: result.results });
}
@@ -1,59 +1,12 @@
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
type RemoteProfileTestDeps = {
chromeModule: typeof import("./chrome.js");
InvalidBrowserNavigationUrlError: typeof import("./navigation-guard.js").InvalidBrowserNavigationUrlError;
pwAiModule: typeof import("./pw-ai-module.js");
closePlaywrightBrowserConnection: typeof import("./pw-session.js").closePlaywrightBrowserConnection;
createBrowserRouteContext: typeof import("./server-context.js").createBrowserRouteContext;
createJsonListFetchMock: typeof import("./server-context.remote-tab-ops.harness.js").createJsonListFetchMock;
createRemoteRouteHarness: typeof import("./server-context.remote-tab-ops.harness.js").createRemoteRouteHarness;
createSequentialPageLister: typeof import("./server-context.remote-tab-ops.harness.js").createSequentialPageLister;
makeState: typeof import("./server-context.remote-tab-ops.harness.js").makeState;
originalFetch: typeof import("./server-context.remote-tab-ops.harness.js").originalFetch;
};
async function loadRemoteProfileTestDeps(): Promise<RemoteProfileTestDeps> {
vi.resetModules();
await import("./server-context.chrome-test-harness.js");
const chromeModule = await import("./chrome.js");
const { InvalidBrowserNavigationUrlError } = await import("./navigation-guard.js");
const pwAiModule = await import("./pw-ai-module.js");
const { closePlaywrightBrowserConnection } = await import("./pw-session.js");
const { createBrowserRouteContext } = await import("./server-context.js");
const {
createJsonListFetchMock,
createRemoteRouteHarness,
createSequentialPageLister,
makeState,
originalFetch,
} = await import("./server-context.remote-tab-ops.harness.js");
return {
chromeModule,
InvalidBrowserNavigationUrlError,
pwAiModule,
closePlaywrightBrowserConnection,
createBrowserRouteContext,
createJsonListFetchMock,
createRemoteRouteHarness,
createSequentialPageLister,
makeState,
originalFetch,
};
}
import { describe, expect, it, vi } from "vitest";
import {
installRemoteProfileTestLifecycle,
loadRemoteProfileTestDeps,
type RemoteProfileTestDeps,
} from "./server-context.remote-profile-tab-ops.test-helpers.js";
const deps: RemoteProfileTestDeps = await loadRemoteProfileTestDeps();
beforeEach(() => {
vi.clearAllMocks();
globalThis.fetch = deps.originalFetch;
});
afterEach(async () => {
await deps.closePlaywrightBrowserConnection().catch(() => {});
globalThis.fetch = deps.originalFetch;
vi.restoreAllMocks();
});
installRemoteProfileTestLifecycle(deps);
describe("browser remote profile fallback and attachOnly behavior", () => {
it("uses profile-level attachOnly when global attachOnly is false", async () => {
@@ -1,59 +1,12 @@
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
type RemoteProfileTestDeps = {
chromeModule: typeof import("./chrome.js");
InvalidBrowserNavigationUrlError: typeof import("./navigation-guard.js").InvalidBrowserNavigationUrlError;
pwAiModule: typeof import("./pw-ai-module.js");
closePlaywrightBrowserConnection: typeof import("./pw-session.js").closePlaywrightBrowserConnection;
createBrowserRouteContext: typeof import("./server-context.js").createBrowserRouteContext;
createJsonListFetchMock: typeof import("./server-context.remote-tab-ops.harness.js").createJsonListFetchMock;
createRemoteRouteHarness: typeof import("./server-context.remote-tab-ops.harness.js").createRemoteRouteHarness;
createSequentialPageLister: typeof import("./server-context.remote-tab-ops.harness.js").createSequentialPageLister;
makeState: typeof import("./server-context.remote-tab-ops.harness.js").makeState;
originalFetch: typeof import("./server-context.remote-tab-ops.harness.js").originalFetch;
};
async function loadRemoteProfileTestDeps(): Promise<RemoteProfileTestDeps> {
vi.resetModules();
await import("./server-context.chrome-test-harness.js");
const chromeModule = await import("./chrome.js");
const { InvalidBrowserNavigationUrlError } = await import("./navigation-guard.js");
const pwAiModule = await import("./pw-ai-module.js");
const { closePlaywrightBrowserConnection } = await import("./pw-session.js");
const { createBrowserRouteContext } = await import("./server-context.js");
const {
createJsonListFetchMock,
createRemoteRouteHarness,
createSequentialPageLister,
makeState,
originalFetch,
} = await import("./server-context.remote-tab-ops.harness.js");
return {
chromeModule,
InvalidBrowserNavigationUrlError,
pwAiModule,
closePlaywrightBrowserConnection,
createBrowserRouteContext,
createJsonListFetchMock,
createRemoteRouteHarness,
createSequentialPageLister,
makeState,
originalFetch,
};
}
import { describe, expect, it, vi } from "vitest";
import {
installRemoteProfileTestLifecycle,
loadRemoteProfileTestDeps,
type RemoteProfileTestDeps,
} from "./server-context.remote-profile-tab-ops.test-helpers.js";
const deps: RemoteProfileTestDeps = await loadRemoteProfileTestDeps();
beforeEach(() => {
vi.clearAllMocks();
globalThis.fetch = deps.originalFetch;
});
afterEach(async () => {
await deps.closePlaywrightBrowserConnection().catch(() => {});
globalThis.fetch = deps.originalFetch;
vi.restoreAllMocks();
});
installRemoteProfileTestLifecycle(deps);
describe("browser remote profile tab ops via Playwright", () => {
it("uses Playwright tab operations when available", async () => {
@@ -0,0 +1,56 @@
import { afterEach, beforeEach, vi } from "vitest";
export type RemoteProfileTestDeps = {
chromeModule: typeof import("./chrome.js");
InvalidBrowserNavigationUrlError: typeof import("./navigation-guard.js").InvalidBrowserNavigationUrlError;
pwAiModule: typeof import("./pw-ai-module.js");
closePlaywrightBrowserConnection: typeof import("./pw-session.js").closePlaywrightBrowserConnection;
createBrowserRouteContext: typeof import("./server-context.js").createBrowserRouteContext;
createJsonListFetchMock: typeof import("./server-context.remote-tab-ops.harness.js").createJsonListFetchMock;
createRemoteRouteHarness: typeof import("./server-context.remote-tab-ops.harness.js").createRemoteRouteHarness;
createSequentialPageLister: typeof import("./server-context.remote-tab-ops.harness.js").createSequentialPageLister;
makeState: typeof import("./server-context.remote-tab-ops.harness.js").makeState;
originalFetch: typeof import("./server-context.remote-tab-ops.harness.js").originalFetch;
};
export async function loadRemoteProfileTestDeps(): Promise<RemoteProfileTestDeps> {
vi.resetModules();
await import("./server-context.chrome-test-harness.js");
const chromeModule = await import("./chrome.js");
const { InvalidBrowserNavigationUrlError } = await import("./navigation-guard.js");
const pwAiModule = await import("./pw-ai-module.js");
const { closePlaywrightBrowserConnection } = await import("./pw-session.js");
const { createBrowserRouteContext } = await import("./server-context.js");
const {
createJsonListFetchMock,
createRemoteRouteHarness,
createSequentialPageLister,
makeState,
originalFetch,
} = await import("./server-context.remote-tab-ops.harness.js");
return {
chromeModule,
InvalidBrowserNavigationUrlError,
pwAiModule,
closePlaywrightBrowserConnection,
createBrowserRouteContext,
createJsonListFetchMock,
createRemoteRouteHarness,
createSequentialPageLister,
makeState,
originalFetch,
};
}
export function installRemoteProfileTestLifecycle(deps: RemoteProfileTestDeps): void {
beforeEach(() => {
vi.clearAllMocks();
globalThis.fetch = deps.originalFetch;
});
afterEach(async () => {
await deps.closePlaywrightBrowserConnection().catch(() => {});
globalThis.fetch = deps.originalFetch;
vi.restoreAllMocks();
});
}
@@ -0,0 +1,63 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
import { createBrowserPluginService } from "./plugin-service.js";
const SERVICE_CONTEXT = {
config: {},
stateDir: "/tmp/openclaw-state",
logger: console,
};
type StartLazyPluginServiceModuleParams = {
validateOverrideSpecifier?: (specifier: string) => string;
};
type StartLazyPluginServiceModuleParamsWithValidator = {
validateOverrideSpecifier: (specifier: string) => string;
};
const runtimeMocks = vi.hoisted(() => ({
startLazyPluginServiceModule: vi.fn(async (_params: StartLazyPluginServiceModuleParams) => null),
}));
vi.mock("openclaw/plugin-sdk/browser-node-runtime", () => ({
startLazyPluginServiceModule: runtimeMocks.startLazyPluginServiceModule,
}));
describe("createBrowserPluginService", () => {
beforeEach(() => {
runtimeMocks.startLazyPluginServiceModule.mockClear();
});
function getStartParams(): StartLazyPluginServiceModuleParamsWithValidator {
const params = runtimeMocks.startLazyPluginServiceModule.mock.calls[0]?.[0];
if (!params?.validateOverrideSpecifier) {
throw new Error("expected browser plugin service to pass validateOverrideSpecifier");
}
return { validateOverrideSpecifier: params.validateOverrideSpecifier };
}
it("passes a browser override validator to the lazy service loader", async () => {
const service = createBrowserPluginService();
await service.start(SERVICE_CONTEXT);
const params = getStartParams();
expect(params.validateOverrideSpecifier(" ./server.js ")).toBe("./server.js");
});
it("rejects unsafe browser override specifiers", async () => {
const service = createBrowserPluginService();
await service.start(SERVICE_CONTEXT);
const params = getStartParams();
expect(() => params.validateOverrideSpecifier("data:text/javascript,boom")).toThrow(
"Refusing unsafe browser control override specifier",
);
expect(() => params.validateOverrideSpecifier("HTTPS://example.invalid/mod.mjs")).toThrow(
"Refusing unsafe browser control override specifier",
);
expect(() => params.validateOverrideSpecifier("node:fs")).toThrow(
"Refusing unsafe browser control override specifier",
);
});
});
+10
View File
@@ -5,6 +5,15 @@ import {
} from "openclaw/plugin-sdk/browser-node-runtime";
type BrowserControlHandle = LazyPluginServiceHandle | null;
const UNSAFE_BROWSER_CONTROL_OVERRIDE_SPECIFIER = /^(?:data|http|https|node):/i;
function validateBrowserControlOverrideSpecifier(specifier: string): string {
const trimmed = specifier.trim();
if (UNSAFE_BROWSER_CONTROL_OVERRIDE_SPECIFIER.test(trimmed)) {
throw new Error(`Refusing unsafe browser control override specifier: ${trimmed}`);
}
return trimmed;
}
export function createBrowserPluginService(): OpenClawPluginService {
let handle: BrowserControlHandle = null;
@@ -18,6 +27,7 @@ export function createBrowserPluginService(): OpenClawPluginService {
handle = await startLazyPluginServiceModule({
skipEnvVar: "OPENCLAW_SKIP_BROWSER_CONTROL_SERVER",
overrideEnvVar: "OPENCLAW_BROWSER_CONTROL_MODULE",
validateOverrideSpecifier: validateBrowserControlOverrideSpecifier,
// Keep the default module import static so compiled builds still bundle it.
loadDefaultModule: async () => await import("./server.js"),
startExportNames: [
+12
View File
@@ -1,3 +1,5 @@
import { readFileSync } from "node:fs";
import { resolve } from "node:path";
import { describe, expect, it } from "vitest";
import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";
import plugin from "./index.js";
@@ -32,4 +34,14 @@ describe("byteplus plugin", () => {
}),
);
});
it("declares its coding provider auth alias in the manifest", () => {
const pluginJson = JSON.parse(
readFileSync(resolve(import.meta.dirname, "openclaw.plugin.json"), "utf-8"),
);
expect(pluginJson.providerAuthAliases).toEqual({
"byteplus-plan": "byteplus",
});
});
});

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