mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 14:01:24 +08:00
Compare commits
1016 Commits
cache/cont
...
qa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ec621ab58 | ||
|
|
8762df9bb4 | ||
|
|
dce0467826 | ||
|
|
258484854b | ||
|
|
4c11a520a8 | ||
|
|
3038079c2f | ||
|
|
b57372d665 | ||
|
|
1903be5401 | ||
|
|
fd968bfb2d | ||
|
|
07e7b7177f | ||
|
|
ffb5b99114 | ||
|
|
e28e83f4e4 | ||
|
|
3728cfbe29 | ||
|
|
70b8ce72df | ||
|
|
69b74476d7 | ||
|
|
23275edef1 | ||
|
|
c863ee1b86 | ||
|
|
87b8680ded | ||
|
|
2d2824874e | ||
|
|
07c2f81392 | ||
|
|
377ccbcf1d | ||
|
|
3635b2b8d6 | ||
|
|
49f52ddf36 | ||
|
|
ef5f47bd39 | ||
|
|
acd8966ff0 | ||
|
|
31d8b022eb | ||
|
|
d91d3cc0f0 | ||
|
|
c9c7271f4f | ||
|
|
b474e098d1 | ||
|
|
c2bf2cc2b7 | ||
|
|
019a25e35c | ||
|
|
eb130aa4e9 | ||
|
|
9238b98a7a | ||
|
|
2aafa8fb7d | ||
|
|
155f4300ba | ||
|
|
42bc411c46 | ||
|
|
eb0f367e00 | ||
|
|
a6894a5238 | ||
|
|
68851f2e97 | ||
|
|
20803dac14 | ||
|
|
b7a08c6bad | ||
|
|
20b08f1a85 | ||
|
|
19b7fbaa73 | ||
|
|
a65ab607c7 | ||
|
|
d655a8bc76 | ||
|
|
f842f518cd | ||
|
|
bf226be64a | ||
|
|
c9029503fd | ||
|
|
c09bf9812a | ||
|
|
005766671e | ||
|
|
cb1bf28526 | ||
|
|
2a999bf9c9 | ||
|
|
f59da4557c | ||
|
|
332afa2fda | ||
|
|
3da235bf39 | ||
|
|
61fc4a16b7 | ||
|
|
db1d62b784 | ||
|
|
a084e46536 | ||
|
|
757fe86309 | ||
|
|
657c6f6788 | ||
|
|
e5023cc141 | ||
|
|
903cb3c48c | ||
|
|
37cc06f1fd | ||
|
|
f039bbf2aa | ||
|
|
e25693315e | ||
|
|
749ed86fe3 | ||
|
|
5e0e50b12e | ||
|
|
4cfb990382 | ||
|
|
e9fa9f7822 | ||
|
|
cb31c4813b | ||
|
|
f5da2360a2 | ||
|
|
7f6e8c0645 | ||
|
|
055428019e | ||
|
|
b63557679e | ||
|
|
058fde2d88 | ||
|
|
74416c5b33 | ||
|
|
f7a32cd25e | ||
|
|
15d5878d91 | ||
|
|
50b5c483ee | ||
|
|
bf0f4d93f0 | ||
|
|
0a71ac5d3c | ||
|
|
1392a78c75 | ||
|
|
87a0390666 | ||
|
|
69be9c4a6f | ||
|
|
9af48d9c10 | ||
|
|
11e6c9de2e | ||
|
|
a746ba2dcb | ||
|
|
8d1f9ab5b8 | ||
|
|
f0c970fb43 | ||
|
|
a235f5ed64 | ||
|
|
2636cc261c | ||
|
|
8355f24652 | ||
|
|
54a360a33e | ||
|
|
cad1b89b26 | ||
|
|
740d096009 | ||
|
|
1811e54920 | ||
|
|
6596e64a68 | ||
|
|
2246e8f0a9 | ||
|
|
d23a81baa1 | ||
|
|
19ef298678 | ||
|
|
7d34c1dc4c | ||
|
|
7587e4cac3 | ||
|
|
91ddf3857a | ||
|
|
e4fe853439 | ||
|
|
dd6b160707 | ||
|
|
628fc21192 | ||
|
|
5942b1062e | ||
|
|
b4f0e5ae2c | ||
|
|
a4ada035d8 | ||
|
|
3f67a52d52 | ||
|
|
aae3ab152a | ||
|
|
db13a29bbf | ||
|
|
98d5939564 | ||
|
|
b558610ef3 | ||
|
|
823ce7957d | ||
|
|
fb580b551e | ||
|
|
22175faaec | ||
|
|
f217e6b72d | ||
|
|
b56517b0ee | ||
|
|
6ab1b43081 | ||
|
|
9860db5cea | ||
|
|
dca21563c6 | ||
|
|
f299bb812b | ||
|
|
04b64e40d4 | ||
|
|
2ba3484d10 | ||
|
|
d37e4a6c3a | ||
|
|
2781897d2c | ||
|
|
2b3e89c6d4 | ||
|
|
ccc7549afe | ||
|
|
fd71bc04ec | ||
|
|
70015be8b5 | ||
|
|
37301cbc3b | ||
|
|
b4216d197d | ||
|
|
334c4be73e | ||
|
|
9d7fe7cdd2 | ||
|
|
96aea0a6d6 | ||
|
|
8b06ca205a | ||
|
|
63cabcb524 | ||
|
|
801b5d4afa | ||
|
|
329fbc3f89 | ||
|
|
bc910942e2 | ||
|
|
eee868452f | ||
|
|
896928d8c0 | ||
|
|
6de100d4e2 | ||
|
|
8ea5b1ddc0 | ||
|
|
13b6a48991 | ||
|
|
66a0ab3752 | ||
|
|
9eb3718438 | ||
|
|
5c5c82dfaa | ||
|
|
f14f7b9fde | ||
|
|
0089eb28fa | ||
|
|
102f7f34e1 | ||
|
|
3d65b14019 | ||
|
|
adfdde5cb3 | ||
|
|
291afbbb95 | ||
|
|
de918c282c | ||
|
|
69cc35c9bd | ||
|
|
b83c5fb8e0 | ||
|
|
38e54f488a | ||
|
|
4f9804ec24 | ||
|
|
746a57a2af | ||
|
|
93f11ff9f7 | ||
|
|
73d50fba28 | ||
|
|
0fb53f1b90 | ||
|
|
dd5439dd5b | ||
|
|
4324eac5e9 | ||
|
|
849dbc58b1 | ||
|
|
4b5146921c | ||
|
|
79e8edc7bd | ||
|
|
8bc59eceb7 | ||
|
|
e419989c34 | ||
|
|
28e1142a24 | ||
|
|
68b84980cc | ||
|
|
b60eee6017 | ||
|
|
e2b841d7d0 | ||
|
|
0738ed8d19 | ||
|
|
90387d4a88 | ||
|
|
7678917c49 | ||
|
|
1ae356c40c | ||
|
|
86aa24b7a5 | ||
|
|
3b4bed7c38 | ||
|
|
59a6bf7569 | ||
|
|
136a5ad2eb | ||
|
|
4b993ba6e4 | ||
|
|
e336300e60 | ||
|
|
97a587ddca | ||
|
|
0ef29325ed | ||
|
|
420f2191f5 | ||
|
|
ba8eb4af38 | ||
|
|
976bc47458 | ||
|
|
13396fa99e | ||
|
|
2bd91a0f02 | ||
|
|
8efb0801a0 | ||
|
|
bbdc429dcb | ||
|
|
46cb292c2a | ||
|
|
33f8ca6cb0 | ||
|
|
8eb1ea5b2e | ||
|
|
c2027d9de2 | ||
|
|
4453b51e2c | ||
|
|
3f1b369f4a | ||
|
|
92aed3168a | ||
|
|
da8a4131fe | ||
|
|
ccd45bd9f0 | ||
|
|
496df07804 | ||
|
|
6d5e2c7e6b | ||
|
|
c488becf43 | ||
|
|
67d6fc8847 | ||
|
|
7c1c4daa4e | ||
|
|
7988b5962a | ||
|
|
43acbcd283 | ||
|
|
36b64969bc | ||
|
|
e0ef3855ca | ||
|
|
62dd299af1 | ||
|
|
28946635aa | ||
|
|
4650b972b9 | ||
|
|
a29755615e | ||
|
|
3b47c0af28 | ||
|
|
c3ee8c611d | ||
|
|
879d45a56c | ||
|
|
b1279b0db3 | ||
|
|
eaef4ee1b1 | ||
|
|
ca200eb480 | ||
|
|
e06e36d41a | ||
|
|
889ddb5edf | ||
|
|
df7693027c | ||
|
|
e3ac0f43df | ||
|
|
759373e887 | ||
|
|
d0d57ea435 | ||
|
|
9aec55f0a2 | ||
|
|
c329dd8250 | ||
|
|
f94645dfe5 | ||
|
|
fd222d3f07 | ||
|
|
3b109c3419 | ||
|
|
e42deea653 | ||
|
|
39d9ded2e5 | ||
|
|
6f2e804182 | ||
|
|
0c3ec064f1 | ||
|
|
852d3a742c | ||
|
|
3bf538d720 | ||
|
|
f3ce1bdb4f | ||
|
|
40f958a953 | ||
|
|
83fe8efe3d | ||
|
|
7ff90c516a | ||
|
|
0cf9c6ec95 | ||
|
|
e6f054ac76 | ||
|
|
ac5d1de13a | ||
|
|
65bb1e772b | ||
|
|
09016db731 | ||
|
|
9d45f4b4e9 | ||
|
|
72b59231a3 | ||
|
|
6d89b363a2 | ||
|
|
a10ba044bc | ||
|
|
8fd53cdf86 | ||
|
|
131a78d3f3 | ||
|
|
2b548aa2b1 | ||
|
|
4db910698a | ||
|
|
f1d8786a96 | ||
|
|
9fbbdc62c8 | ||
|
|
4154aa8b0f | ||
|
|
414e834c26 | ||
|
|
f81d55d7ea | ||
|
|
3bf1b69ece | ||
|
|
a08449b83f | ||
|
|
2a80b7f30b | ||
|
|
2ab8acb2c9 | ||
|
|
e627f53d24 | ||
|
|
ef7c84ae92 | ||
|
|
e4bd4b8b49 | ||
|
|
0817bf446f | ||
|
|
cde1e2d3a1 | ||
|
|
3f7bd3bd7b | ||
|
|
3017a71bb7 | ||
|
|
f463256660 | ||
|
|
08992e1dbc | ||
|
|
77509024b8 | ||
|
|
d98eaba4c3 | ||
|
|
17f086c021 | ||
|
|
beee44ba47 | ||
|
|
7de3a16ab4 | ||
|
|
ae460eff84 | ||
|
|
fba6e194bd | ||
|
|
c4205c7aae | ||
|
|
a7b1a3140f | ||
|
|
bcaff8c208 | ||
|
|
6067fe59d8 | ||
|
|
89535f9313 | ||
|
|
983909f826 | ||
|
|
8a6da9d488 | ||
|
|
5012b52780 | ||
|
|
db0b514e45 | ||
|
|
bc21e3c83d | ||
|
|
3470a80b36 | ||
|
|
beb3740bb7 | ||
|
|
b944da561c | ||
|
|
5633495c19 | ||
|
|
b3cfedf312 | ||
|
|
4c6b7a3a77 | ||
|
|
eb4c5890ab | ||
|
|
3b502882b9 | ||
|
|
226b12d7b5 | ||
|
|
4dbc66b1ed | ||
|
|
b9201e8333 | ||
|
|
5584af7ac3 | ||
|
|
f5cc6a101b | ||
|
|
a4fc1200de | ||
|
|
1ca1ce85ee | ||
|
|
de001d0e07 | ||
|
|
1f2e068e6b | ||
|
|
d06633c618 | ||
|
|
3dda70a578 | ||
|
|
fb8e20ddb6 | ||
|
|
9ac9edff43 | ||
|
|
cb1c2e8f86 | ||
|
|
e277c01953 | ||
|
|
9dd449045a | ||
|
|
eddb94555a | ||
|
|
3f9e93fd28 | ||
|
|
bb82fe8f19 | ||
|
|
a2e0a094c1 | ||
|
|
fa34f3a9d5 | ||
|
|
c09e128587 | ||
|
|
8262078ee5 | ||
|
|
4fe21de3ce | ||
|
|
20d14745cf | ||
|
|
ea2f56b4e8 | ||
|
|
1e7f9e8746 | ||
|
|
4be01a5cd5 | ||
|
|
772ee1f81f | ||
|
|
b7e6a3bc9e | ||
|
|
edc51b1fa4 | ||
|
|
6ce96c273f | ||
|
|
37a3b6b25f | ||
|
|
b7296fe5dd | ||
|
|
e191bf36a5 | ||
|
|
9766da7f00 | ||
|
|
e509c5c3ea | ||
|
|
93fe3c5442 | ||
|
|
e949bd7d04 | ||
|
|
a29abebee0 | ||
|
|
dbeab5e60f | ||
|
|
99ebb7a248 | ||
|
|
788cff6759 | ||
|
|
0a69b3558a | ||
|
|
e5b9e32979 | ||
|
|
fe0b209850 | ||
|
|
8dc049abc5 | ||
|
|
6b265ce415 | ||
|
|
470b4452ce | ||
|
|
5ef3bdb5f4 | ||
|
|
fb59b5c461 | ||
|
|
b575dc704c | ||
|
|
a0dbdbd8d4 | ||
|
|
571cd92b22 | ||
|
|
5a6a2bb861 | ||
|
|
5a3062ffb9 | ||
|
|
e0e6eaa03c | ||
|
|
867402449f | ||
|
|
e1ea02e556 | ||
|
|
d2ff8e28dd | ||
|
|
671c724626 | ||
|
|
cad662196f | ||
|
|
35260d3443 | ||
|
|
a1b794a12c | ||
|
|
41513eaf2b | ||
|
|
7b8c4335b3 | ||
|
|
95480863f3 | ||
|
|
d0e041ad5c | ||
|
|
2ea583496d | ||
|
|
9e596e383d | ||
|
|
f81e31b23e | ||
|
|
5f8ae068dc | ||
|
|
cad18b5ec2 | ||
|
|
dd771f1dc6 | ||
|
|
a5836343df | ||
|
|
73f0b11a88 | ||
|
|
daf4eea943 | ||
|
|
2c6c2d4907 | ||
|
|
2a0d5f9094 | ||
|
|
c5c5c77ebb | ||
|
|
8cf20a0c59 | ||
|
|
5c32dddb1c | ||
|
|
e0634aab66 | ||
|
|
dbfb0b5618 | ||
|
|
05c948e4de | ||
|
|
cebea1bf95 | ||
|
|
5fffdc478e | ||
|
|
ba09426707 | ||
|
|
728d14e918 | ||
|
|
103bebd651 | ||
|
|
890de57036 | ||
|
|
5fa60e6535 | ||
|
|
fde6e07f2a | ||
|
|
1a431a532b | ||
|
|
b2f972e364 | ||
|
|
11542e9310 | ||
|
|
f02af9bb41 | ||
|
|
9dea255ee2 | ||
|
|
756cb22f15 | ||
|
|
3e5bcc8cb2 | ||
|
|
9cc300be78 | ||
|
|
aa32f74fe6 | ||
|
|
981737035d | ||
|
|
3bc2e47966 | ||
|
|
73584b1d33 | ||
|
|
bbb73d3171 | ||
|
|
9698ba7215 | ||
|
|
91d20781ed | ||
|
|
083b882052 | ||
|
|
f9717f2eae | ||
|
|
76d1f26782 | ||
|
|
70b39f4893 | ||
|
|
60206817b3 | ||
|
|
3b80f42152 | ||
|
|
8ca5a9174a | ||
|
|
882654d9ae | ||
|
|
13f9475f6c | ||
|
|
93ab8dd531 | ||
|
|
114496871d | ||
|
|
7d22a16adb | ||
|
|
7c0752f834 | ||
|
|
f502b023d9 | ||
|
|
ebe0a27b4d | ||
|
|
3758a0ce5b | ||
|
|
68ec7c9bbf | ||
|
|
16e7e2551b | ||
|
|
79be1e126a | ||
|
|
99e45eb3ba | ||
|
|
3f1b2703b7 | ||
|
|
056c0870a9 | ||
|
|
2ecb8ca352 | ||
|
|
07c7c4b9ec | ||
|
|
11b8a025a4 | ||
|
|
33e6a7a28e | ||
|
|
a26b844b88 | ||
|
|
022618e887 | ||
|
|
0afd30d325 | ||
|
|
f8dcd3ed83 | ||
|
|
b0025b1921 | ||
|
|
0d47106b98 | ||
|
|
71ea82a4f4 | ||
|
|
2a03326925 | ||
|
|
b3faf20d91 | ||
|
|
6cff644dc9 | ||
|
|
032dbf0ec6 | ||
|
|
c63a32661a | ||
|
|
11d17b3c38 | ||
|
|
a6707c2e1f | ||
|
|
8f473023e4 | ||
|
|
ae16452a69 | ||
|
|
16346d6784 | ||
|
|
4991cd66ef | ||
|
|
7985cf5531 | ||
|
|
62babffc40 | ||
|
|
6e28bd2eb6 | ||
|
|
375bd73ce1 | ||
|
|
f2b3b3d912 | ||
|
|
6ee905c7bd | ||
|
|
b05761aae0 | ||
|
|
db2cc5c28a | ||
|
|
f16566d30e | ||
|
|
587f19967c | ||
|
|
c89d4857e4 | ||
|
|
56960e33e6 | ||
|
|
3607962a44 | ||
|
|
86c799f4e1 | ||
|
|
20f9f99db6 | ||
|
|
9b82692425 | ||
|
|
b742909dca | ||
|
|
d46eabb010 | ||
|
|
6b991b2afa | ||
|
|
b424a7a3a4 | ||
|
|
e91b52f396 | ||
|
|
363c666201 | ||
|
|
486505a54e | ||
|
|
dd030fb761 | ||
|
|
f9f9462c79 | ||
|
|
8cf6e4b5df | ||
|
|
27972489d3 | ||
|
|
cec15e08d1 | ||
|
|
8059942216 | ||
|
|
72f54059c4 | ||
|
|
1c5c15b1d4 | ||
|
|
940bf899f0 | ||
|
|
502b024523 | ||
|
|
120b1d2ed2 | ||
|
|
e5b48ea2b4 | ||
|
|
0166fd426e | ||
|
|
9da0feeecf | ||
|
|
a375635a9a | ||
|
|
fb0d60d7f3 | ||
|
|
9d684e1040 | ||
|
|
c0d509e794 | ||
|
|
ac254f50e8 | ||
|
|
83c10350c6 | ||
|
|
3f457cabf7 | ||
|
|
3100984a33 | ||
|
|
72847db28b | ||
|
|
1efce6f23c | ||
|
|
9eb8184f36 | ||
|
|
dd9c9dac53 | ||
|
|
30de4337bf | ||
|
|
efd5d5eb20 | ||
|
|
90af255a91 | ||
|
|
65fcf7e104 | ||
|
|
8f7b02e567 | ||
|
|
035a754f0f | ||
|
|
1cfc10e836 | ||
|
|
c75f82448f | ||
|
|
46cb493ac8 | ||
|
|
3ec0463da9 | ||
|
|
3dda75894b | ||
|
|
42778ccd46 | ||
|
|
9615488855 | ||
|
|
2701e75f40 | ||
|
|
561bacd06a | ||
|
|
b473816afb | ||
|
|
bc648ac8e6 | ||
|
|
1037af01ad | ||
|
|
c70b10460c | ||
|
|
f3aad63f4e | ||
|
|
3207c5326a | ||
|
|
aaa173a4a7 | ||
|
|
9ddfaff45f | ||
|
|
605f48556b | ||
|
|
c3f415ad6e | ||
|
|
f832699fd7 | ||
|
|
53c33f8207 | ||
|
|
62c54fdc16 | ||
|
|
b838ecf885 | ||
|
|
39bcf695dc | ||
|
|
00337cdde1 | ||
|
|
c29d4bbb86 | ||
|
|
91bac7cb83 | ||
|
|
6bbccb087a | ||
|
|
49bf527fd4 | ||
|
|
9b352ab5b0 | ||
|
|
b7411ad594 | ||
|
|
7b6334b0f4 | ||
|
|
bbb0b574c4 | ||
|
|
d766465e38 | ||
|
|
b9e3c1a02e | ||
|
|
7ffbbd8586 | ||
|
|
86ee50b968 | ||
|
|
3b09b58c5d | ||
|
|
e697838899 | ||
|
|
72b2e413d6 | ||
|
|
0b1c9c7057 | ||
|
|
fca889eea3 | ||
|
|
29f062770d | ||
|
|
c524d6c76c | ||
|
|
bec891b2e2 | ||
|
|
2c9723afd5 | ||
|
|
0bc9f0b5ba | ||
|
|
d204be80af | ||
|
|
a722719720 | ||
|
|
7d16359aae | ||
|
|
b22f6257f0 | ||
|
|
05da802e1c | ||
|
|
fdb1be0079 | ||
|
|
8a532dead2 | ||
|
|
2a65bfee96 | ||
|
|
53d3fbcef6 | ||
|
|
5583bda61d | ||
|
|
5da360cada | ||
|
|
aefc6fc161 | ||
|
|
36cc397548 | ||
|
|
c5b2b69f94 | ||
|
|
bc356cc8c2 | ||
|
|
c3f8427973 | ||
|
|
80720b4994 | ||
|
|
e4ea3c03cf | ||
|
|
b36a3a3295 | ||
|
|
e8f6ceedd4 | ||
|
|
251e086eac | ||
|
|
678e9e6078 | ||
|
|
20a7b1a9dc | ||
|
|
9dcef6df02 | ||
|
|
05ca581ed0 | ||
|
|
353d93613c | ||
|
|
5d0562badf | ||
|
|
cc602fe9d4 | ||
|
|
3f042ed002 | ||
|
|
87d840e9ee | ||
|
|
75fb29ffe6 | ||
|
|
d1bf2c6de1 | ||
|
|
e675634eb3 | ||
|
|
5bef64bc31 | ||
|
|
277df463d6 | ||
|
|
39d2a719c9 | ||
|
|
4e099689c0 | ||
|
|
2ab1f1c054 | ||
|
|
10e0592ed0 | ||
|
|
0a3211df2d | ||
|
|
ee742cec40 | ||
|
|
4ee648c508 | ||
|
|
e955cffd32 | ||
|
|
d166f2648e | ||
|
|
9367379771 | ||
|
|
f0d3e231ef | ||
|
|
c4a903319e | ||
|
|
360fdaa4f2 | ||
|
|
fd3b7b5ae7 | ||
|
|
792558de01 | ||
|
|
6b82140336 | ||
|
|
7cda9df4cb | ||
|
|
d58b4d7425 | ||
|
|
2c36ca562d | ||
|
|
01a24c20bf | ||
|
|
848e7abb57 | ||
|
|
28021a0325 | ||
|
|
1222961a77 | ||
|
|
7807e1ef05 | ||
|
|
5779831723 | ||
|
|
a631270f01 | ||
|
|
c441db7e13 | ||
|
|
ca2fdcc45f | ||
|
|
0089d0e2e6 | ||
|
|
a90f3ffdac | ||
|
|
93d8a8602b | ||
|
|
790a24002e | ||
|
|
f39b5e86e5 | ||
|
|
a2fa6e8b90 | ||
|
|
508ca72fc7 | ||
|
|
559e42b60c | ||
|
|
d7e288bee9 | ||
|
|
f7c5988334 | ||
|
|
0ed7662365 | ||
|
|
fce81fccd8 | ||
|
|
af4e9d19cf | ||
|
|
2d0ca75282 | ||
|
|
0182dd1694 | ||
|
|
eb932d59e0 | ||
|
|
36fe4800d2 | ||
|
|
cfcdf002c8 | ||
|
|
de63a646d6 | ||
|
|
6b7d0deaf6 | ||
|
|
d24b9088fd | ||
|
|
c06248aee7 | ||
|
|
2a5da613f4 | ||
|
|
459ede5a7e | ||
|
|
ac8d91edff | ||
|
|
29033400eb | ||
|
|
74d39e9efe | ||
|
|
c26ab4649d | ||
|
|
7c43dfe28f | ||
|
|
05baeb2ada | ||
|
|
7f5cf1a837 | ||
|
|
cd36ff7483 | ||
|
|
87f512f80d | ||
|
|
b5608397d0 | ||
|
|
323415204e | ||
|
|
6b100e4dcf | ||
|
|
9e0cf17d0c | ||
|
|
7207a36d40 | ||
|
|
1d5c57bad9 | ||
|
|
238fac6636 | ||
|
|
97a8ba89fd | ||
|
|
b601c7cb8f | ||
|
|
6a1ed07b33 | ||
|
|
b1e3e59429 | ||
|
|
44762c0c80 | ||
|
|
cca35404ea | ||
|
|
edc470f6b0 | ||
|
|
69980e8bf4 | ||
|
|
1ffbe09a6a | ||
|
|
2906cfd6d7 | ||
|
|
1d8bba7e39 | ||
|
|
3da187156f | ||
|
|
f4855baf35 | ||
|
|
4812b9d2e2 | ||
|
|
683c028553 | ||
|
|
1fcb2cfeb5 | ||
|
|
73572e04c1 | ||
|
|
a192f345d4 | ||
|
|
54cfd746de | ||
|
|
8347022b50 | ||
|
|
6615c5788b | ||
|
|
df4b5d2137 | ||
|
|
cdccbf2c1c | ||
|
|
38ed8c355a | ||
|
|
e4c3df2fb6 | ||
|
|
a50b838dc2 | ||
|
|
1a13c34f5b | ||
|
|
58a56d9a82 | ||
|
|
a746f0e8c3 | ||
|
|
7ad43f21d3 | ||
|
|
e934211170 | ||
|
|
7d7f5d85b4 | ||
|
|
49d962a82f | ||
|
|
d1a4363783 | ||
|
|
0051a86b8f | ||
|
|
b6b1d5dd6c | ||
|
|
e5d03f734a | ||
|
|
21ca006eca | ||
|
|
af7c6f4c68 | ||
|
|
216294765b | ||
|
|
111495d3ca | ||
|
|
11a87b4b7a | ||
|
|
85ade25003 | ||
|
|
daac149744 | ||
|
|
42f6de16b2 | ||
|
|
51d998d828 | ||
|
|
87b41ca693 | ||
|
|
ed866020df | ||
|
|
7d1575b5df | ||
|
|
7036e5afbf | ||
|
|
8cec7c68b9 | ||
|
|
da50b492c8 | ||
|
|
dc2575f6c4 | ||
|
|
7671f4f1e3 | ||
|
|
bc75968074 | ||
|
|
be15805a84 | ||
|
|
f9e9d4e357 | ||
|
|
12be79ac48 | ||
|
|
7286a10679 | ||
|
|
36987831ce | ||
|
|
926c107fe5 | ||
|
|
0e04ca36b9 | ||
|
|
74270762ff | ||
|
|
b02b2c3a0b | ||
|
|
4f3ad7c6fc | ||
|
|
8f85c7386b | ||
|
|
5a13756ca3 | ||
|
|
a81cf1da1f | ||
|
|
6a55556b83 | ||
|
|
edfaa01d1d | ||
|
|
470898b5e1 | ||
|
|
4c450ede65 | ||
|
|
19036ef394 | ||
|
|
cbc6a1ddb8 | ||
|
|
04b539e98c | ||
|
|
f6df3ed70c | ||
|
|
6afdf10266 | ||
|
|
b5265a07d7 | ||
|
|
b4e9802ef3 | ||
|
|
22dad753a5 | ||
|
|
1d1c52e6e6 | ||
|
|
928a5128f4 | ||
|
|
3967ffec22 | ||
|
|
9bbedf3caa | ||
|
|
2c0f096688 | ||
|
|
138ef136ee | ||
|
|
c88d6d67c8 | ||
|
|
dd2faa3764 | ||
|
|
06c6ff6670 | ||
|
|
1b2fb6b98b | ||
|
|
7a03027e7f | ||
|
|
545ecc63bd | ||
|
|
4b490d90ec | ||
|
|
74f60dfd0b | ||
|
|
f79c00b972 | ||
|
|
5d7979c5c7 | ||
|
|
c76646adb1 | ||
|
|
df09fe9adf | ||
|
|
d584ccfc77 | ||
|
|
9ea37202a8 | ||
|
|
09997f032f | ||
|
|
0a5bce21a6 | ||
|
|
cb0b15a195 | ||
|
|
9bb97b54fe | ||
|
|
83e5fe5e8b | ||
|
|
c3a2701c45 | ||
|
|
4f95822aa8 | ||
|
|
d75a8933e7 | ||
|
|
0660bef81e | ||
|
|
3e5c571e57 | ||
|
|
53e2554281 | ||
|
|
5c685eee9c | ||
|
|
644ed24ed8 | ||
|
|
65842aabad | ||
|
|
c87903a4c6 | ||
|
|
d2bace59d1 | ||
|
|
66b1520d92 | ||
|
|
32d2654340 | ||
|
|
95a6d386c0 | ||
|
|
14cfcdba1a | ||
|
|
f38a3ae996 | ||
|
|
9195cf839b | ||
|
|
1738900a9a | ||
|
|
0013568500 | ||
|
|
406a47284a | ||
|
|
7b4e20fc8c | ||
|
|
20266ff7dd | ||
|
|
226ca1f324 | ||
|
|
a9140abea6 | ||
|
|
c4597992ca | ||
|
|
1c42f0e866 | ||
|
|
ad7461b639 | ||
|
|
da3f5e9bca | ||
|
|
0609bf8581 | ||
|
|
0ab160cda9 | ||
|
|
1b4bb5be19 | ||
|
|
15bee338e9 | ||
|
|
359c6dedbe | ||
|
|
6e6b4f6004 | ||
|
|
be4eb269fc | ||
|
|
b167ad052c | ||
|
|
e34f42559f | ||
|
|
27aa659498 | ||
|
|
d5cb8cebcd | ||
|
|
667a54a4b7 | ||
|
|
381ee4d218 | ||
|
|
50a1fac1c5 | ||
|
|
c8be1ca6ae | ||
|
|
25b069a6f3 | ||
|
|
f856aaea40 | ||
|
|
26f0c7ee90 | ||
|
|
85c5d90c11 | ||
|
|
71c0c2cc06 | ||
|
|
d718d17b5b | ||
|
|
6507f54965 | ||
|
|
bcd11176ef | ||
|
|
195e380e05 | ||
|
|
cb6d0576be | ||
|
|
332caa4cb1 | ||
|
|
3d55b28853 | ||
|
|
b379dac798 | ||
|
|
1809da659e | ||
|
|
6fc69f5d33 | ||
|
|
e7e1707277 | ||
|
|
7e7460c2f9 | ||
|
|
666f1f4db0 | ||
|
|
9e4cf3996e | ||
|
|
cdb572d703 | ||
|
|
c4d2c4899d | ||
|
|
3de09fbe74 | ||
|
|
c2435306a7 | ||
|
|
e2454d4b8a | ||
|
|
dd16080af7 | ||
|
|
b32a2cadc2 | ||
|
|
e56ffd48df | ||
|
|
1c1f32e756 | ||
|
|
cfc52fcf2b | ||
|
|
c91b6bf322 | ||
|
|
3a3f88a80a | ||
|
|
fca80d2ee2 | ||
|
|
b59ce0903c | ||
|
|
3437818b91 | ||
|
|
0587fb3fc8 | ||
|
|
b54acd97b3 | ||
|
|
ede6d03850 | ||
|
|
0099c309c9 | ||
|
|
fcf1aee2b4 | ||
|
|
73115b5480 | ||
|
|
ae7942bf5e | ||
|
|
1ab37d7a12 | ||
|
|
b3186aeef9 | ||
|
|
32dd0aa7e7 | ||
|
|
fd01561327 | ||
|
|
30ba837a7b | ||
|
|
0ebc7b6077 | ||
|
|
40da986b21 | ||
|
|
224fceee1a | ||
|
|
2b538464e1 | ||
|
|
71562cc570 | ||
|
|
b390591779 | ||
|
|
6e0fe1b91e | ||
|
|
10d5b8813d | ||
|
|
e4dc03f108 | ||
|
|
41243529fb | ||
|
|
e07d8fd20b | ||
|
|
026ca40be9 | ||
|
|
18016e7546 | ||
|
|
db177ab2ac | ||
|
|
e985324d87 | ||
|
|
9802c060bf | ||
|
|
b392c78bab | ||
|
|
cff8b5bebd | ||
|
|
bc8048250e | ||
|
|
4ed17fd987 | ||
|
|
561db47566 | ||
|
|
0777ddace8 | ||
|
|
5ddc57aa22 | ||
|
|
64d9b65b56 | ||
|
|
fd75d214f2 | ||
|
|
8b5672bda4 | ||
|
|
f8c4777515 | ||
|
|
a5f66b5c48 | ||
|
|
02cc09dafe | ||
|
|
ca9d2f3b41 | ||
|
|
757a20b656 | ||
|
|
33e10c4772 | ||
|
|
230a39797a | ||
|
|
8a3d946f4a | ||
|
|
55812eaf14 | ||
|
|
9afaec1b0c | ||
|
|
53fd262173 | ||
|
|
22e6225dd0 | ||
|
|
af102907c5 | ||
|
|
39135ca3a4 | ||
|
|
64f28906de | ||
|
|
b0e1551eb8 | ||
|
|
c17985aa9f | ||
|
|
e95b723b82 | ||
|
|
c7cb43cac9 | ||
|
|
64b971b2b0 | ||
|
|
3a62b0e75b | ||
|
|
b16e70e37f | ||
|
|
5b294b7fbd | ||
|
|
943da1864a | ||
|
|
53b5b1b32d | ||
|
|
1246e2b03a | ||
|
|
0f544fa1ca | ||
|
|
39d3cad479 | ||
|
|
e277ac0838 | ||
|
|
f84486157e | ||
|
|
bc457fd1b8 | ||
|
|
fff7e610df | ||
|
|
5b144655f2 | ||
|
|
f4fa53de3f | ||
|
|
ca99ad0af8 | ||
|
|
efefa5560d | ||
|
|
9d1a58f551 | ||
|
|
ed0cbcba2f | ||
|
|
e636ba6ab0 | ||
|
|
32ba917079 | ||
|
|
f62db7950a | ||
|
|
b7ec90258b | ||
|
|
0ad75cffe3 | ||
|
|
bb1cc84d50 | ||
|
|
fb5066dfb1 | ||
|
|
6b003a7f2b | ||
|
|
406f06dcc5 | ||
|
|
8a8ea94228 | ||
|
|
bac15a7313 | ||
|
|
7cd40ad565 | ||
|
|
6964e4acf7 | ||
|
|
a82bc7d887 | ||
|
|
df48a7bfc0 | ||
|
|
eb9051cc7c | ||
|
|
585b1c9413 | ||
|
|
4c1022c73b | ||
|
|
2687a49575 | ||
|
|
eeb2888f6e | ||
|
|
d7b8faa7bf | ||
|
|
41e16a883b | ||
|
|
2416e2d51d | ||
|
|
d7ba6d3e68 | ||
|
|
33453838da | ||
|
|
0fef95b17d | ||
|
|
ff0c1b57a7 | ||
|
|
26c9a4ce63 | ||
|
|
fc79ebe098 | ||
|
|
20937422ca | ||
|
|
e750c10577 | ||
|
|
ba20e6cd98 | ||
|
|
6349e6aa3e | ||
|
|
c4bae0f7bf | ||
|
|
a23ab9b906 | ||
|
|
61f93540b2 | ||
|
|
9bfaf7b681 | ||
|
|
7e69c2f6a7 | ||
|
|
2f5509e36d | ||
|
|
f9cf868553 | ||
|
|
bc6b20e542 | ||
|
|
af94a3a89b | ||
|
|
2050ef2740 | ||
|
|
df86f4dc00 | ||
|
|
6c31b2fbc5 | ||
|
|
0737816010 | ||
|
|
e9d802c32b | ||
|
|
94b0062e90 | ||
|
|
e8ebd6ab8c | ||
|
|
750d963cb9 | ||
|
|
b1dd3ded35 | ||
|
|
f25f147fc3 | ||
|
|
098abd484d | ||
|
|
5eb32f24ea | ||
|
|
bf1b1d63bd | ||
|
|
e249a852ae | ||
|
|
a3a06524f2 | ||
|
|
3c23126980 | ||
|
|
6b3ff0dd4f | ||
|
|
7df763b04d | ||
|
|
6d33c67c01 | ||
|
|
d605cb08c5 | ||
|
|
fb1cb99c88 | ||
|
|
b5a849801c | ||
|
|
e273753d45 | ||
|
|
87885b948a | ||
|
|
761bd3bbd0 | ||
|
|
6a3a0c405f | ||
|
|
7a16e14301 | ||
|
|
9e389cff3d | ||
|
|
945b198c76 | ||
|
|
94adc24393 | ||
|
|
30479b4ee0 | ||
|
|
85c76e83b7 | ||
|
|
858bf405f4 | ||
|
|
dd31ee1139 | ||
|
|
b76ed0fadf | ||
|
|
1e6e685347 | ||
|
|
143d377c5a | ||
|
|
3713b0e506 | ||
|
|
34cd49faa6 | ||
|
|
1e90b3afcd | ||
|
|
e941d425ac | ||
|
|
fb0ff6896a | ||
|
|
b04c4e599c | ||
|
|
ac11e02518 | ||
|
|
269771a4b6 | ||
|
|
37ee19521f | ||
|
|
f8a3840a42 | ||
|
|
931ddd96f0 | ||
|
|
b8021d6709 | ||
|
|
58d2b9dd46 | ||
|
|
45675c1698 | ||
|
|
b2fb1210e1 | ||
|
|
a38cb20177 | ||
|
|
f6f7609b66 | ||
|
|
af81c437fa | ||
|
|
300fb36879 | ||
|
|
628c71103e | ||
|
|
bc16b9dccf | ||
|
|
881f7dc82f | ||
|
|
f6380ae4b7 |
@@ -30,6 +30,7 @@ Use this skill for Parallels guest workflows and smoke interpretation. Do not lo
|
||||
- Flow: fresh snapshot -> install npm package baseline -> smoke -> install current main tgz on the same guest -> smoke again.
|
||||
- Same-guest update verification should set the default model explicitly to `openai/gpt-5.4` before the agent turn and use a fresh explicit `--session-id` so old session model state does not leak into the check.
|
||||
- The aggregate npm-update wrapper must resolve the Linux VM with the same Ubuntu fallback policy as `parallels-linux-smoke.sh` before both fresh and update lanes. Treat any Ubuntu guest with major version `>= 24` as acceptable when the exact default VM is missing, preferring the closest version match. On Peter's current host today, missing `Ubuntu 24.04.3 ARM64` should fall back to `Ubuntu 25.10`.
|
||||
- On macOS same-guest update checks, restart the gateway after the npm upgrade before `gateway status` / `agent`; launchd can otherwise report a loaded service while the old process has exited and the fresh process is not RPC-ready yet.
|
||||
- On Windows same-guest update checks, restart the gateway after the npm upgrade before `gateway status` / `agent`; in-place global npm updates can otherwise leave stale hashed `dist/*` module imports alive in the running service.
|
||||
- For Windows same-guest update checks, prefer the done-file/log-drain PowerShell runner pattern over one long-lived `prlctl exec ... powershell -EncodedCommand ...` transport. The guest can finish successfully while the outer `prlctl exec` still hangs.
|
||||
- The Windows same-guest update helper should write stage markers to its log before long steps like tgz download and `npm install -g` so the outer progress monitor does not sit on `waiting for first log line` during healthy but quiet installs.
|
||||
@@ -46,6 +47,7 @@ Use this skill for Parallels guest workflows and smoke interpretation. Do not lo
|
||||
- Preferred entrypoint: `pnpm test:parallels:macos`
|
||||
- Default to the snapshot closest to `macOS 26.3.1 latest`.
|
||||
- On Peter's Tahoe VM, `fresh-latest-march-2026` can hang in `prlctl snapshot-switch`; if restore times out there, rerun with `--snapshot-hint 'macOS 26.3.1 latest'` before blaming auth or the harness.
|
||||
- `parallels-macos-smoke.sh` now retries `snapshot-switch` once after force-stopping a stuck running/suspended guest. If Tahoe still times out after that recovery path, then treat it as a real Parallels/host issue and rerun manually.
|
||||
- The macOS smoke should include a dashboard load phase after gateway health: resolve the tokenized URL with `openclaw dashboard --no-open`, verify the served HTML contains the Control UI title/root shell, then open Safari and require an established localhost TCP connection from Safari to the gateway port.
|
||||
- If a packaged install regresses with `500` on `/`, `/healthz`, or `__openclaw/control-ui-config.json` after `fresh.install-main` or `upgrade.install-main`, suspect bundled plugin runtime deps resolving from the package root `node_modules` rather than `dist/extensions/*/node_modules`. Repro quickly with a real `npm pack`/global install lane before blaming dashboard auth or Safari.
|
||||
- `prlctl exec` is fine for deterministic repo commands, but use the guest Terminal or `prlctl enter` when installer parity or shell-sensitive behavior matters.
|
||||
@@ -64,6 +66,7 @@ Use this skill for Parallels guest workflows and smoke interpretation. Do not lo
|
||||
- Use PowerShell only as the transport with `-ExecutionPolicy Bypass`, then call the `.cmd` shims from inside it.
|
||||
- Multi-word `openclaw agent --message ...` checks should call `& $openclaw ...` inside PowerShell, not `Start-Process ... -ArgumentList` against `openclaw.cmd`, or Commander can see split argv and throw `too many arguments for 'agent'`.
|
||||
- Windows installer/tgz phases now retry once after guest-ready recheck; keep new Windows smoke steps idempotent so a transport-flake retry is safe.
|
||||
- If a Windows retry sees the VM become `suspended` or `stopped`, resume/start it before the next `prlctl exec`; otherwise the second attempt just repeats the same `rc=255`.
|
||||
- Windows global `npm install -g` phases can stay quiet for a minute or more even when healthy; inspect the phase log before calling it hung, and only treat it as a regression once the retry wrapper or timeout trips.
|
||||
- Fresh Windows ref-mode onboard should use the same background PowerShell runner plus done-file/log-drain pattern as the npm-update helper, including startup materialization checks, host-side timeouts on short poll `prlctl exec` calls, and retry-on-poll-failure behavior for transient transport flakes.
|
||||
- Fresh Windows ref-mode agent verification should set `OPENAI_API_KEY` in the PowerShell environment before invoking `openclaw.cmd agent`, for the same pairing-required fallback reason as macOS.
|
||||
@@ -82,6 +85,7 @@ Use this skill for Parallels guest workflows and smoke interpretation. Do not lo
|
||||
- Fresh `main` tgz smoke still needs the latest-release installer first because the snapshot has no Node or npm before bootstrap.
|
||||
- This snapshot does not have a usable `systemd --user` session; managed daemon install is unsupported.
|
||||
- The Linux smoke now falls back to a manual `setsid openclaw gateway run --bind loopback --port 18789 --force` launch with `HOME=/root` and the provider secret exported, then verifies `gateway status --deep --require-rpc` when available.
|
||||
- The Linux manual gateway launch should wait for `gateway status --deep --require-rpc` inside the `gateway-start` phase; otherwise the first status probe can race the background bind and fail a healthy lane.
|
||||
- If Linux gateway bring-up fails, inspect `/tmp/openclaw-parallels-linux-gateway.log` in the guest phase logs first; the common failure mode is a missing provider secret in the launched gateway environment.
|
||||
|
||||
## Discord roundtrip
|
||||
|
||||
@@ -55,6 +55,8 @@ Check in this order:
|
||||
- Was it fixed before release?
|
||||
3. Exploit path
|
||||
- Does the report show a real boundary bypass, not just prompt injection, local same-user control, or helper-level semantics?
|
||||
- If data only moves between trusted workspace-memory files called out in `SECURITY.md`, do not treat "injection markers" alone as a security bug.
|
||||
- In that case, frame sanitization as optional hardening only if it preserves expected memory workflows.
|
||||
4. Functional tradeoff
|
||||
- If a hardening change would reduce intended user functionality, call that out before proposing it.
|
||||
- Prefer fixes that preserve user workflows over deny-by-default regressions unless the boundary demands it.
|
||||
@@ -104,5 +106,6 @@ gh search prs --repo openclaw/openclaw --match title,body,comments -- "<terms>"
|
||||
- “fixed on main, unreleased” is usually not a close.
|
||||
- “needs attacker-controlled trusted local state first” is usually out of scope.
|
||||
- “same-host same-user process can already read/write local state” is usually out of scope.
|
||||
- “trusted workspace memory promotes/reindexes trusted workspace memory” is usually out of scope unless it crosses a documented boundary.
|
||||
- “helper function behaves differently than documented config semantics” is usually invalid.
|
||||
- If only the severity is wrong but the bug is real, keep it open and narrow the impact in the reply.
|
||||
|
||||
2
.github/actions/setup-node-env/action.yml
vendored
2
.github/actions/setup-node-env/action.yml
vendored
@@ -14,7 +14,7 @@ inputs:
|
||||
pnpm-version:
|
||||
description: pnpm version for corepack.
|
||||
required: false
|
||||
default: "10.23.0"
|
||||
default: "10.32.1"
|
||||
install-bun:
|
||||
description: Whether to install Bun alongside Node.
|
||||
required: false
|
||||
|
||||
@@ -4,7 +4,7 @@ inputs:
|
||||
pnpm-version:
|
||||
description: pnpm version to activate via corepack.
|
||||
required: false
|
||||
default: "10.23.0"
|
||||
default: "10.32.1"
|
||||
cache-key-suffix:
|
||||
description: Suffix appended to the cache key.
|
||||
required: false
|
||||
|
||||
11
.github/labeler.yml
vendored
11
.github/labeler.yml
vendored
@@ -64,6 +64,17 @@
|
||||
- any-glob-to-any-file:
|
||||
- "extensions/qqbot/**"
|
||||
- "docs/channels/qqbot.md"
|
||||
"channel: qa-channel":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "extensions/qa-channel/**"
|
||||
- "docs/channels/qa-channel.md"
|
||||
"extensions: qa-lab":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- "extensions/qa-lab/**"
|
||||
- "docs/concepts/qa-e2e-automation.md"
|
||||
- "docs/channels/qa-channel.md"
|
||||
"channel: signal":
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
|
||||
8
.github/workflows/auto-response.yml
vendored
8
.github/workflows/auto-response.yml
vendored
@@ -407,8 +407,12 @@ jobs:
|
||||
"Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.";
|
||||
|
||||
if (pullRequest) {
|
||||
// `bad-barnacle` exempts PRs that Barnacle incorrectly marked dirty.
|
||||
if (labelSet.has(dirtyLabel) && !labelSet.has(badBarnacleLabel)) {
|
||||
if (labelSet.has(badBarnacleLabel)) {
|
||||
core.info(`Skipping PR auto-response checks for #${pullRequest.number} because ${badBarnacleLabel} is present.`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (labelSet.has(dirtyLabel)) {
|
||||
await github.rest.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
|
||||
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
@@ -545,7 +545,6 @@ jobs:
|
||||
echo "OPENCLAW_VITEST_MAX_WORKERS=2" >> "$GITHUB_ENV"
|
||||
if [ "$TASK" = "channels" ]; then
|
||||
echo "OPENCLAW_VITEST_MAX_WORKERS=1" >> "$GITHUB_ENV"
|
||||
echo "OPENCLAW_TEST_ISOLATE=1" >> "$GITHUB_ENV"
|
||||
fi
|
||||
|
||||
- name: Download dist artifact
|
||||
@@ -950,7 +949,7 @@ jobs:
|
||||
- name: Setup pnpm + cache store
|
||||
uses: ./.github/actions/setup-pnpm-store-cache
|
||||
with:
|
||||
pnpm-version: "10.23.0"
|
||||
pnpm-version: "10.32.1"
|
||||
cache-key-suffix: "node24"
|
||||
# Sticky disk mount currently retries/fails on every shard and adds ~50s
|
||||
# before install while still yielding zero pnpm store reuse.
|
||||
|
||||
2
.github/workflows/macos-release.yml
vendored
2
.github/workflows/macos-release.yml
vendored
@@ -20,7 +20,7 @@ concurrency:
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
|
||||
NODE_VERSION: "24.x"
|
||||
PNPM_VERSION: "10.23.0"
|
||||
PNPM_VERSION: "10.32.1"
|
||||
|
||||
jobs:
|
||||
validate_macos_release_request:
|
||||
|
||||
27
.github/workflows/openclaw-npm-release.yml
vendored
27
.github/workflows/openclaw-npm-release.yml
vendored
@@ -37,7 +37,7 @@ concurrency:
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
|
||||
NODE_VERSION: "24.x"
|
||||
PNPM_VERSION: "10.23.0"
|
||||
PNPM_VERSION: "10.32.1"
|
||||
|
||||
jobs:
|
||||
preflight_openclaw_npm:
|
||||
@@ -129,6 +129,31 @@ jobs:
|
||||
- name: Verify release contents
|
||||
run: pnpm release:check
|
||||
|
||||
- name: Validate live cache credentials
|
||||
if: ${{ github.ref == 'refs/heads/main' }}
|
||||
env:
|
||||
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [[ -z "${OPENAI_API_KEY}" ]]; then
|
||||
echo "Missing OPENAI_API_KEY secret for release live cache validation." >&2
|
||||
exit 1
|
||||
fi
|
||||
if [[ -z "${ANTHROPIC_API_KEY}" ]]; then
|
||||
echo "Missing ANTHROPIC_API_KEY secret for release live cache validation." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Verify live prompt cache floors
|
||||
if: ${{ github.ref == 'refs/heads/main' }}
|
||||
env:
|
||||
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||
OPENCLAW_LIVE_CACHE_TEST: "1"
|
||||
OPENCLAW_LIVE_TEST: "1"
|
||||
run: pnpm test:live:cache
|
||||
|
||||
- name: Pack prepared npm tarball
|
||||
id: packed_tarball
|
||||
env:
|
||||
|
||||
2
.github/workflows/plugin-clawhub-release.yml
vendored
2
.github/workflows/plugin-clawhub-release.yml
vendored
@@ -23,7 +23,7 @@ concurrency:
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
|
||||
NODE_VERSION: "24.x"
|
||||
PNPM_VERSION: "10.23.0"
|
||||
PNPM_VERSION: "10.32.1"
|
||||
CLAWHUB_REGISTRY: "https://clawhub.ai"
|
||||
CLAWHUB_REPOSITORY: "openclaw/clawhub"
|
||||
# Pinned to a reviewed ClawHub commit so release behavior stays reproducible.
|
||||
|
||||
2
.github/workflows/plugin-npm-release.yml
vendored
2
.github/workflows/plugin-npm-release.yml
vendored
@@ -38,7 +38,7 @@ concurrency:
|
||||
env:
|
||||
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
|
||||
NODE_VERSION: "24.x"
|
||||
PNPM_VERSION: "10.23.0"
|
||||
PNPM_VERSION: "10.32.1"
|
||||
|
||||
jobs:
|
||||
preview_plugins_npm:
|
||||
|
||||
8
.gitignore
vendored
8
.gitignore
vendored
@@ -4,7 +4,7 @@ node_modules
|
||||
docker-compose.override.yml
|
||||
docker-compose.extra.yml
|
||||
dist
|
||||
dist-runtime
|
||||
dist-runtime/
|
||||
pnpm-lock.yaml
|
||||
bun.lock
|
||||
bun.lockb
|
||||
@@ -136,6 +136,10 @@ ui/src/ui/views/__screenshots__
|
||||
ui/.vitest-attachments
|
||||
docs/superpowers
|
||||
|
||||
# Generated docs baseline artifacts (locally generated, only hashes tracked)
|
||||
docs/.generated/*.json
|
||||
docs/.generated/*.jsonl
|
||||
|
||||
# Deprecated changelog fragment workflow
|
||||
changelog/fragments/
|
||||
|
||||
@@ -143,3 +147,5 @@ changelog/fragments/
|
||||
.tmp/
|
||||
test/fixtures/openclaw-vitest-unit-report.json
|
||||
analysis/
|
||||
.artifacts/qa-e2e/
|
||||
extensions/qa-lab/web/dist/
|
||||
|
||||
25
AGENTS.md
25
AGENTS.md
@@ -55,6 +55,11 @@
|
||||
- Public docs: `docs/gateway/protocol.md`, `docs/gateway/bridge-protocol.md`, `docs/concepts/architecture.md`
|
||||
- Definition files: `src/gateway/protocol/schema.ts`, `src/gateway/protocol/schema/*.ts`, `src/gateway/protocol/index.ts`
|
||||
- Rule: protocol changes are contract changes. Prefer additive evolution; incompatible changes require explicit versioning, docs, and client/codegen follow-through.
|
||||
- Config contract boundary:
|
||||
- Canonical public config lives in exported config types, zod/schema surfaces, schema help/labels, generated config metadata, config baselines, and any user-facing gateway/config payloads. Keep those surfaces aligned.
|
||||
- When a legacy config key is retired from the public contract, remove it from every public config surface above. Keep backward compatibility only through raw-config migration/doctor seams unless explicit product policy says otherwise.
|
||||
- Do not reintroduce removed legacy aliases into public types/schema/help/baselines “for convenience”. If old configs still need to load, handle that in `legacy.migrations.*`, config ingest, or `openclaw doctor --fix`.
|
||||
- `hooks.internal.entries` is the canonical public hook config model. `hooks.internal.handlers` is compatibility-only input and must not be re-exposed in public schema/help/baseline surfaces.
|
||||
- Bundled plugin contract boundary:
|
||||
- Public docs: `docs/plugins/architecture.md`, `docs/plugins/manifest.md`, `docs/plugins/sdk-overview.md`
|
||||
- Definition files: `src/plugins/contracts/registry.ts`, `src/plugins/types.ts`, `src/plugins/public-artifacts.ts`
|
||||
@@ -125,10 +130,10 @@
|
||||
- Formatting gate: the pre-commit hook runs `pnpm format` before `pnpm check`. If you want a formatting-only preflight locally, run `pnpm format` explicitly.
|
||||
- If you need a fast commit loop, `FAST_COMMIT=1 git commit ...` skips the hook’s repo-wide `pnpm format` and `pnpm check`; use that only when you are deliberately covering the touched surface some other way.
|
||||
- Tests: `pnpm test` (vitest); coverage: `pnpm test:coverage`
|
||||
- Generated baseline artifacts live together under `docs/.generated/`.
|
||||
- Generated baseline drift detection uses SHA-256 hash files under `docs/.generated/` (`.sha256` files tracked in git; full JSON baselines are gitignored, generated locally for inspection).
|
||||
- Config schema drift uses `pnpm config:docs:gen` / `pnpm config:docs:check`.
|
||||
- Plugin SDK API drift uses `pnpm plugin-sdk:api:gen` / `pnpm plugin-sdk:api:check`.
|
||||
- If you change config schema/help or the public Plugin SDK surface, update the matching baseline artifact and keep the two drift-check flows adjacent in scripts/workflows/docs guidance rather than inventing a third pattern.
|
||||
- If you change config schema/help or the public Plugin SDK surface, run the matching gen command and commit the updated `.sha256` hash file. Keep the two drift-check flows adjacent in scripts/workflows/docs guidance rather than inventing a third pattern.
|
||||
- For narrowly scoped changes, prefer narrowly scoped tests that directly validate the touched behavior. If no meaningful scoped test exists, say so explicitly and use the next most direct validation available.
|
||||
- Verification modes for work on `main`:
|
||||
- Default mode: `main` is relatively stable. Count pre-commit hook coverage when it already verified the current tree, avoid rerunning the exact same checks just for ceremony, and prefer keeping CI/main green before landing.
|
||||
@@ -140,6 +145,14 @@
|
||||
- For narrowly scoped changes, if unrelated failures already exist on latest `origin/main`, state that clearly, report the scoped tests you ran, and ask before broadening scope into unrelated fixes or landing despite those failures.
|
||||
- Do not use scoped tests as permission to ignore plausibly related failures.
|
||||
|
||||
## Prompt Cache Stability
|
||||
|
||||
- Treat prompt-cache stability as correctness/perf-critical, not cosmetic.
|
||||
- Any code that assembles model or tool payloads from maps, sets, registries, plugin lists, MCP catalogs, filesystem reads, or network results must make ordering deterministic before building the request.
|
||||
- Do not rewrite older transcript/history bytes on every turn unless you intentionally want to invalidate the cached prefix. Legacy cleanup, pruning, normalization, and migration logic should preserve recent prompt bytes when possible.
|
||||
- If truncation or compaction is required, prefer mutating newest or tail content first so the cached prefix stays byte-identical for as long as possible.
|
||||
- For cache-sensitive changes, require a regression test that proves turn-to-turn prefix stability or deterministic request assembly; helper-local tests alone are not enough.
|
||||
|
||||
## Coding Style & Naming Conventions
|
||||
|
||||
- Language: TypeScript (ESM). Prefer strict typing; avoid `any`.
|
||||
@@ -191,10 +204,10 @@
|
||||
- Test performance guardrail: prefer narrow public SDK subpaths such as `models-provider-runtime`, `skill-commands-runtime`, and `reply-dispatch-runtime` over older broad helper barrels when both expose the needed helper.
|
||||
- Test performance guardrail: treat import-dominated test time as a boundary bug. Refactor the import surface before adding more cases to the slow file.
|
||||
- Agents MUST NOT modify baseline, inventory, ignore, snapshot, or expected-failure files to silence failing checks without explicit approval in this chat.
|
||||
- For targeted/local debugging, keep using the wrapper: `pnpm test -- <path-or-filter> [vitest args...]` (for example `pnpm test -- src/commands/onboard-search.test.ts -t "shows registered plugin providers"`); do not default to raw `pnpm vitest run ...` because it bypasses wrapper config/profile/pool routing.
|
||||
- For targeted/local debugging, use the native root-project entrypoint: `pnpm test <path-or-filter> [vitest args...]` (for example `pnpm test src/commands/onboard-search.test.ts -t "shows registered plugin providers"`); do not default to raw `pnpm vitest run ...` because it bypasses the repo's default config/profile/pool routing.
|
||||
- Do not set test workers above 16; tried already.
|
||||
- Keep Vitest on `forks` only. Do not introduce or reintroduce any non-`forks` Vitest pool or alternate execution mode in configs, wrapper scripts, or default test commands without explicit approval in this chat. This includes `threads`, `vmThreads`, `vmForks`, and any future/nonstandard pool variant.
|
||||
- If local Vitest runs cause memory pressure, the wrapper now derives budgets from host capabilities (CPU, memory band, current load). For a conservative explicit override during land/gate runs, use `OPENCLAW_TEST_PROFILE=serial OPENCLAW_TEST_SERIAL_GATEWAY=1 pnpm test`.
|
||||
- Vitest now defaults to native root-project `threads`, with hard `forks` exceptions for `gateway`, `agents`, and `commands`. Keep new pool changes explicit and justified; use `OPENCLAW_VITEST_POOL=forks` for full local fork debugging.
|
||||
- If local Vitest runs cause memory pressure, the default worker budget now derives from host capabilities (CPU, memory band, current load). For a conservative explicit override during land/gate runs, use `OPENCLAW_VITEST_MAX_WORKERS=1 pnpm test`.
|
||||
- Live tests (real keys): `OPENCLAW_LIVE_TEST=1 pnpm test:live` (OpenClaw-only) or `LIVE=1 pnpm test:live` (includes provider live tests). Docker: `pnpm test:docker:live-models`, `pnpm test:docker:live-gateway`. Onboarding Docker E2E: `pnpm test:docker:onboard`.
|
||||
- `pnpm test:live` defaults quiet now. Keep `[live]` progress; suppress profile/gateway chatter. Full logs: `OPENCLAW_LIVE_TEST_QUIET=0 pnpm test:live`.
|
||||
- Full kit + what’s covered: `docs/help/testing.md`.
|
||||
@@ -252,6 +265,8 @@
|
||||
- "Bump version everywhere" means all version locations above **except** `appcast.xml` (only touch appcast when cutting a new macOS Sparkle release).
|
||||
- **Restart apps:** “restart iOS/Android apps” means rebuild (recompile/install) and relaunch, not just kill/launch.
|
||||
- **Device checks:** before testing, verify connected real devices (iOS/Android) before reaching for simulators/emulators.
|
||||
- Mobile pairing: `ws://` (cleartext) is allowed for private LAN addresses (RFC 1918, link-local, mDNS `.local`) and loopback. Private LAN hosts typically lack PKI-backed identity, so requiring TLS there adds complexity without meaningful security gain. `wss://` is required for Tailscale and public endpoints.
|
||||
- Security report scope: reports that treat cleartext `ws://` mobile pairing over private LAN as a vulnerability are out of scope unless they demonstrate a trust-boundary bypass beyond passive network observation on the same LAN.
|
||||
- iOS Team ID lookup: `security find-identity -p codesigning -v` → use Apple Development (…) TEAMID. Fallback: `defaults read com.apple.dt.Xcode IDEProvisioningTeamIdentifiers`.
|
||||
- A2UI bundle hash: `src/canvas-host/a2ui/.bundle.hash` is auto-generated; ignore unexpected changes, and only regenerate via `pnpm canvas:a2ui:bundle` (or `scripts/bundle-a2ui.sh`) when needed. Commit the hash as a separate commit.
|
||||
- Release signing/notary credentials are managed outside the repo; maintainers keep that setup in the private [maintainer release docs](https://github.com/openclaw/maintainers/tree/main/release).
|
||||
|
||||
228
CHANGELOG.md
228
CHANGELOG.md
@@ -4,104 +4,133 @@ Docs: https://docs.openclaw.ai
|
||||
|
||||
## Unreleased
|
||||
|
||||
### Breaking
|
||||
|
||||
- Config: remove legacy public config aliases such as `talk.voiceId` / `talk.apiKey`, `agents.*.sandbox.perSession`, `browser.ssrfPolicy.allowPrivateNetwork`, `hooks.internal.handlers`, and channel/group/room `allow` toggles in favor of the canonical public paths and `enabled`, while keeping load-time compatibility and `openclaw doctor --fix` migration support for existing configs. (#60726) Thanks @vincentkoc.
|
||||
|
||||
### Changes
|
||||
|
||||
- Memory/dreaming (experimental): add weighted short-term recall promotion, managed dreaming modes (`off|core|rem|deep`), a `/dreaming` command, Dreams UI, multilingual conceptual tagging, and doctor/status repair support so durable memory promotion can run in the background with less manual setup. (#60569, #60697)
|
||||
- Channels/context visibility: add configurable `contextVisibility` per channel (`all`, `allowlist`, `allowlist_quote`) so supplemental quote, thread, and fetched history context can be filtered by sender allowlists instead of always passing through as received.
|
||||
- Matrix/exec approvals: add Matrix-native exec approval prompts with account-scoped approvers, channel-or-DM delivery, and room-thread aware resolution handling. (#58635) Thanks @gumadeiras.
|
||||
- Providers/StepFun: add the bundled StepFun provider plugin with standard and Step Plan endpoints, China/global onboarding choices, `step-3.5-flash` on both catalogs, and `step-3.5-flash-2603` currently exposed on Step Plan. (#60032) Thanks @hengm3467.
|
||||
- Providers/config: add full `models.providers.*.request` transport overrides for model-provider paths, including headers, auth, proxy, and TLS, and keep media provider HTTP request transport overrides aligned with the same request-policy surface. (#60200) Thanks @vincentkoc.
|
||||
- Providers/Fireworks: add a bundled Fireworks AI provider plugin with `FIREWORKS_API_KEY` onboarding, Fire Pass Kimi defaults, and dynamic Fireworks model-id support.
|
||||
- Providers/config: add `models.providers.*.request` overrides for headers and auth on model-provider paths, and full request transport overrides for media provider HTTP paths.
|
||||
- MiniMax/TTS: add a bundled MiniMax speech provider backed by the T2A v2 API so speech synthesis can run through MiniMax-native voices and auth. (#55921) Thanks @duncanita.
|
||||
- Control UI/skills: add ClawHub search, detail, and install flows directly in the Skills panel. (#60134) Thanks @samzong.
|
||||
- Outbound/runtime seams: split delivery, target-resolution, and session/transcript helper loading into narrower runtime seams so outbound hot paths and their owner tests avoid broader setup fan-out. (#60311) Thanks @shakkernerd.
|
||||
- Plugins/browser seams: split browser and WhatsApp plugin-sdk seams into narrower browser, approval-auth, and target-helper facades so hot paths and owner tests avoid broader runtime fan-out. (#60376) Thanks @shakkernerd.
|
||||
- Tests/runtime: trim local unit-test import/runtime fan-out across browser, WhatsApp, cron, task, and reply flows so owner suites start faster with lower shared-worker overhead while preserving the same focused behavior coverage. (#60249) Thanks @shakkernerd.
|
||||
- Tests/secrets runtime: restore split secrets suite cache and env isolation cleanup so broader runs do not leak stale plugin or provider snapshot state. (#60395) Thanks @shakkernerd.
|
||||
- Providers/Ollama: add bundled Ollama Web Search provider for key-free web_search via your configured Ollama host and `ollama signin`. (#59318) Thanks @BruceMacD.
|
||||
- Providers/Ollama: add a bundled Ollama Web Search provider for key-free `web_search` via your configured Ollama host and `ollama signin`. (#59318) Thanks @BruceMacD.
|
||||
- Plugins/onboarding: add plugin config TUI prompts to onboard and configure wizards so more plugin setup can stay in the guided flow. (#60590)
|
||||
- Plugins/install: add `openclaw plugins install --force` to overwrite existing plugin and hook-pack install targets without using the dangerous-code override flag. (#60544) Thanks @gumadeiras.
|
||||
- Providers/transport: add shared proxy/TLS/auth-aware request transport support across model-provider paths, including Anthropic and Google native transport runtimes, so provider request overrides work beyond OpenAI-family traffic.
|
||||
- Providers/Anthropic: remove setup-token from new onboarding and auth-command setup paths, keep existing configured legacy token profiles runnable, and steer new Anthropic setup to Claude CLI or API keys.
|
||||
- Providers/OpenAI Codex: add forward-compat `openai-codex/gpt-5.4-mini` synthesis across provider runtime, model catalog, and model listing so Codex mini works before bundled Pi catalog updates land.
|
||||
- Tools/web_search: add a bundled MiniMax Search provider backed by the Coding Plan search API, with region reuse from `MINIMAX_API_HOST` and plugin-owned credential config. (#54648) Thanks @fengmk2.
|
||||
- Channels/context visibility: add configurable `contextVisibility` per channel (`all`, `allowlist`, `allowlist_quote`) so quoted, threaded, and fetched history context can be filtered by sender allowlists instead of always passing through as received.
|
||||
- Providers/request overrides: add shared model and media request transport overrides across OpenAI-, Anthropic-, Google-, and compatible provider paths, including headers, auth, proxy, and TLS controls. (#60200)
|
||||
- Matrix/exec approvals: add Matrix-native exec approval prompts with account-scoped approvers, channel-or-DM delivery, and room-thread aware resolution handling. (#58635) Thanks @gumadeiras.
|
||||
- Agents/Claude CLI: expose OpenClaw tools to background Claude CLI runs through a loopback MCP bridge that reuses gateway tool policy, honors session/account/channel scoping, and only advertises the bridge when the local runtime is actually live. (#35676) Thanks @mylukin.
|
||||
- Agents/Claude CLI: switch bundled Claude CLI runs to stdin + `stream-json` partial-message streaming so prompts stop riding argv, long replies show live progress, and final session/usage metadata still land cleanly.
|
||||
- Prompt caching: keep prompt prefixes more reusable across transport fallback, deterministic MCP tool ordering, compaction, and embedded image history so follow-up turns hit cache more reliably. (#58036, #58037, #58038, #59054, #60603, #60691) Thanks @bcherny.
|
||||
- Agents/cache: diagnostics: add prompt-cache break diagnostics, trace live cache scenarios through embedded runner paths, and show cache reuse explicitly in `openclaw status --verbose`. Thanks @vincentkoc.
|
||||
- Agents/cache: stabilize cache-relevant system prompt fingerprints by normalizing equivalent structured prompt whitespace, line endings, hook-added system context, and runtime capability ordering so semantically unchanged prompts reuse KV/cache more reliably. Thanks @vincentkoc.
|
||||
- Config/schema: enrich the exported `openclaw config schema` JSON Schema with field titles and descriptions so editors, agents, and other schema consumers receive the same config help metadata. (#60067) Thanks @solavrc.
|
||||
- Providers/StepFun: add the bundled StepFun provider plugin with standard and Step Plan endpoints, China/global onboarding choices, `step-3.5-flash` on both catalogs, and `step-3.5-flash-2603` currently exposed on Step Plan. (#60032) Thanks @hengm3467.
|
||||
|
||||
### Fixes
|
||||
|
||||
- Skills/uv install: block workspace `.env` from overriding `UV_PYTHON` and strip related interpreter override keys from uv skill-install subprocesses so repository-controlled env files cannot steer the selected Python runtime. (#59178) Thanks @pgondhi987.
|
||||
- Telegram/reactions: preserve `reactionNotifications: "own"` across gateway restarts by persisting sent-message ownership state instead of treating cold cache as a permissive fallback. (#59207) Thanks @samzong.
|
||||
- Gateway/startup: detect PID recycling in gateway lock files on Windows and macOS, and add startup progress so stale lock conflicts no longer block healthy restarts. (#59843) Thanks @TonyDerek-dot.
|
||||
- MS Teams/DM media: download inline images in 1:1 chats via Graph API so Teams DM image attachments stop failing to load. (#52212) Thanks @Ted-developer.
|
||||
- MS Teams/threading: preserve channel reply threading in proactive fallback so replies stay in the original thread instead of dropping into the channel root. (#55198) Thanks @hyojin.
|
||||
- Telegram/media: preserve `<media:...>` placeholders and `file_id` in captioned messages when Bot API downloads fail, so agents still receive media context. (#59948) Thanks @v1p0r.
|
||||
- Telegram/media: keep inbound image attachments readable on upgraded installs where legacy state roots still differ from the managed config-dir media cache. (#59971) Thanks @neeravmakwana.
|
||||
- Telegram/local Bot API: thread `channels.telegram.apiRoot` through buffered reply-media and album downloads so self-hosted Bot API file paths stop falling back to `api.telegram.org` and 404ing. (#59544) Thanks @SARAMALI15792.
|
||||
- Telegram/replies: preserve explicit topic targets when `replyTo` is present while still inheriting the current topic for same-chat replies without an explicit topic. (#59634) Thanks @dashhuang.
|
||||
- Telegram/native commands: clean up metadata-driven progress placeholders when replies fall back, edits fail, or local exec approval prompts are suppressed. (#59300) Thanks @jalehman.
|
||||
- Telegram/models: compare full provider/model refs in the Telegram picker so same-id models from other providers no longer show the wrong current-model checkmark. (#60384) Thanks @sfuminya.
|
||||
- Media/request overrides: resolve shared and capability-filtered media request SecretRefs correctly and expose media transport override fields to schema-driven config consumers. (#59848) Thanks @vincentkoc.
|
||||
- Providers/request overrides: stop advertising unsupported proxy and TLS transport settings on `models.providers.*.request`, and fail closed if unvalidated config tries to route LLM model-provider traffic through dead transport fields. (#59682) Thanks @vincentkoc.
|
||||
- Discord/mentions: treat `@everyone` and `@here` as valid mention-gate triggers in guild preflight so mention-required bots still respond to those broadcasts. (#60343) Thanks @geekhuashan.
|
||||
- Matrix: allow secret-storage recreation during automatic repair bootstrap so clients that lose their recovery key can recover and persist new cross-signing keys. (#59846) Thanks @al3mart.
|
||||
- Matrix/crypto persistence: capture and write the IndexedDB snapshot while holding the snapshot file lock so concurrent gateway and CLI persists cannot overwrite newer crypto state. (#59851) Thanks @al3mart.
|
||||
- Ollama/auth: prefer real cloud auth over local marker during model auth resolution so cloud-backed Ollama auth does not get shadowed by stale local-only markers.
|
||||
- Plugins/Kimi Coding: parse tagged Kimi tool-call text into structured tool calls on the provider stream path so tools execute instead of echoing raw markup. (#60051) Thanks @obviyus.
|
||||
- Channels/passive hooks: emit passive message hooks for mention-skipped Telegram and Signal group messages when `ingest` is enabled, including wildcard/default fallback and per-group override handling. (#60018) Thanks @obviyus.
|
||||
- Providers/compat: stop forcing OpenAI-only payload defaults on proxy and custom OpenAI-compatible routes, and preserve native vendor-specific reasoning, tool, and streaming behavior for Anthropic-compatible, Moonshot, Mistral, ModelStudio, OpenRouter, xAI, Z.ai, and other routed provider paths.
|
||||
- Plugins/manifest registry: stop warning when an explicit manifest `id` intentionally differs from the discovery hint. (#59185) Thanks @samzong.
|
||||
- WhatsApp/streaming: honor `channels.whatsapp.blockStreaming` again for inbound auto-replies so progressive block replies can be enabled explicitly instead of being forced to final-only delivery. Thanks @mcaxtr.
|
||||
- Auth/failover: shorten `auth_permanent` lockouts, add dedicated config knobs for permanent-auth backoff, and downgrade ambiguous auth-ish upstream incidents to retryable auth failures so providers recover automatically after transient outages. (#60404) Thanks @extrasmall0.
|
||||
- Providers/GitHub Copilot: route Claude models through Anthropic Messages with Copilot-compatible headers and Anthropic prompt-cache markers instead of forcing the OpenAI Responses transport.
|
||||
- Plugins/runtime: reuse compatible active registries for `web_search` and `web_fetch` provider snapshot resolution so repeated runtime reads do not re-import the same bundled plugin set on each agent message. Related #48380.
|
||||
- Infra/tailscale: ignore `OPENCLAW_TEST_TAILSCALE_BINARY` outside explicit test environments and block it from workspace `.env`, so test-only binary overrides cannot be injected through trusted repository state. (#58468) Thanks @eleqtrizit.
|
||||
- Plugins/OpenAI: enable reference-image edits for `gpt-image-1` by routing edit calls to `/images/edits` with multipart image uploads, and update image-generation capability/docs metadata accordingly. Thanks @steipete.
|
||||
- Cache/context guard: compact newest tool results first so the cached prompt prefix stays byte-identical and avoids full re-tokenization every turn past the 75% context threshold. (#58036) Thanks @bcherny.
|
||||
- Agents/tools: include value-shape hints in missing-parameter tool errors so dropped, empty-string, and wrong-type write payloads are easier to diagnose from logs. (#55317) Thanks @priyansh19.
|
||||
- Android/assistant: keep queued App Actions prompts pending when auto-send enqueue is rejected, so transient chat-health drops do not silently lose the assistant request. Thanks @obviyus.
|
||||
- Plugins/startup: migrate legacy `tools.web.search.<provider>` config before strict startup validation, and record plugin failure phase/timestamp so degraded plugin startup is easier to diagnose from logs and `plugins list`.
|
||||
- Plugins/Google: separate OAuth CSRF state from PKCE code verifier during Gemini browser sign-in so state validation and token exchange use independent values. (#59116) Thanks @eleqtrizit.
|
||||
- Agents/subagents: honor `agents.defaults.subagents.allowAgents` for `sessions_spawn` and `agents_list`, so default cross-agent allowlists work without duplicating per-agent config. (#59944) Thanks @hclsys.
|
||||
- Agents/tools: normalize only truly empty MCP tool schemas to `{ type: "object", properties: {} }` so OpenAI accepts parameter-free tools without rewriting unrelated conditional schemas. (#60176) Thanks @Bartok9.
|
||||
- Update/npm: prefer the npm binary that owns the installed global OpenClaw prefix during package self-update, so mixed Homebrew-plus-nvm setups update the right install. (#60153) Thanks @jayeshp19.
|
||||
- Plugins/browser: block SSRF redirect bypass by installing a real-time Playwright route handler before `page.goto()` so navigation to private/internal IPs is intercepted and aborted mid-redirect instead of checked post-hoc. (#58771) Thanks @pgondhi987.
|
||||
- Android/gateway: require TLS for non-loopback remote gateway endpoints while still allowing local loopback and emulator cleartext setup flows. (#58475) Thanks @eleqtrizit.
|
||||
- Exec/Windows: hide transient console windows for `runExec` and `runCommandWithTimeout` child-process launches, matching other Windows exec paths and stopping visible shell flashes during tool runs. (#59466) Thanks @lawrence3699.
|
||||
- Zalo/webhook: scope replay-dedupe cache key to path and account using `JSON.stringify` so multi-account deployments do not silently drop events due to cross-account cache poisoning. (#59387) Thanks @pgondhi987.
|
||||
- Exec/Windows: reject malformed drive-less rooted executable paths like `:\Users\...` so approval and allowlist candidate resolution no longer treat them as cwd-relative commands. (#58040) Thanks @SnowSky1.
|
||||
- Exec/preflight: fail closed on complex interpreter invocations that would otherwise skip script-content validation, and correctly inspect quoted script paths before host execution. Thanks @pgondhi987.
|
||||
- Exec/Windows: include Windows-compatible env override keys like `ProgramFiles(x86)` in system-run approval binding so changed approved values are rejected instead of silently passing unbound. (#59182) Thanks @pgondhi987.
|
||||
- ACP/Windows spawn: fail closed on unresolved `.cmd` and `.bat` OpenClaw wrappers unless a caller explicitly opts into shell fallback, so Windows ACP launches do not silently drop into shell-mediated execution when wrapper unwrapping fails. (#58436) Thanks @eleqtrizit.
|
||||
- Exec/Windows: prefer strict-inline-eval denial over generic allowlist prompts for interpreter carriers, while keeping persisted Windows allow-always approvals argv-bound. (#59780) Thanks @luoyanglang.
|
||||
- Gateway/connect: omit admin-scoped config and auth metadata from lower-privilege `hello-ok` snapshots while preserving those fields for admin reconnects. (#58469) Thanks @eleqtrizit.
|
||||
- iOS/canvas: restrict A2UI bridge trust to the bundled scaffold and exact capability-backed remote canvas URLs, so generic `canvas.navigate` and `canvas.present` loads no longer gain action-dispatch authority. (#58471) Thanks @eleqtrizit.
|
||||
- Agents/tool policy: preserve restrictive plugin-only allowlists instead of silently widening access to core tools, and keep allowlist warnings aligned with the enforced policy. (#58476) Thanks @eleqtrizit.
|
||||
- Hooks/session_end: preserve deterministic reason metadata for custom reset aliases and overlapping idle-plus-daily rollovers so plugins can rely on lifecycle reason reporting. (#59715) Thanks @jalehman.
|
||||
- Tools/image generation: stop inferring unsupported resolution overrides for OpenAI reference-image edits when no explicit `size` or `resolution` is provided, so default edit flows no longer fail before the provider request is sent.
|
||||
- Agents/sessions: release embedded runner session locks even when teardown cleanup throws, so timed-out or failed cleanup paths no longer leave sessions wedged until the stale-lock watchdog recovers them. (#59194) Thanks @samzong.
|
||||
- Slack/app manifest: add the missing `groups:read` scope to the onboarding and example Slack app manifest so apps copied from the OpenClaw templates can resolve private group conversations reliably.
|
||||
- Mobile pairing/Android: stop generating Tailscale and public mobile setup codes that point at unusable cleartext remote gateways, keep private LAN pairing allowed, and make Android reject insecure remote endpoints with clearer guidance while mixed bootstrap approvals honor operator scopes correctly. (#60128) Thanks @obviyus.
|
||||
- Telegram/media: add `channels.telegram.network.dangerouslyAllowPrivateNetwork` for trusted fake-IP or transparent-proxy environments where Telegram media downloads resolve `api.telegram.org` to private/internal/special-use addresses.
|
||||
- Discord/proxy: keep Carbon REST, monitor startup, and webhook sends on the configured Discord proxy while falling back cleanly when the proxy URL is invalid, so Discord replies and deploys do not hard-fail on malformed proxy config. (#57465) Thanks @geekhuashan.
|
||||
- Discord/components: keep modal-trigger and spoiler-file component messages on the component path when sending media, so classic-message fallback does not silently drop component-only behavior. (#60361) Thanks @geekhuashan.
|
||||
- Mobile pairing/device approval: mint both node and operator device tokens when one approval grants merged roles, so mixed mobile bootstrap pairings stop reconnecting as operator-only and showing the node offline. (#60208) Thanks @obviyus.
|
||||
- Agents/tool policy: stop `tools.profile` warnings from flagging runtime-gated baseline core tools as unknown when the coding profile is missing tools like `code_execution`, `x_search`, `image`, or `image_generate`, while still warning on explicit extra allowlist entries. Thanks @vincentkoc.
|
||||
- Sessions/resolution: collapse alias-duplicate session-id matches before scoring, keep distinct structural ties ambiguous, and prefer current-store reuse when resolving equal cross-store duplicates so follow-up turns stop dropping or duplicating sessions on timestamp ties.
|
||||
- Mobile pairing/bootstrap: keep setup bootstrap tokens alive through the initial node auto-pair so the same QR bootstrap token can finish operator approval, then revoke it after the full issued profile connects successfully. (#60221) Thanks @obviyus.
|
||||
- Plugins/allowlists: let explicit bundled chat channel enablement bypass `plugins.allow`, while keeping auto-enabled channel activation and startup sidecars behind restrictive allowlists. (#60233) Thanks @dorukardahan.
|
||||
- Allowlist/commands: require owner access for `/allowlist add` and `/allowlist remove` so command-authorized non-owners cannot mutate persisted allowlists. (#59836) Thanks @eleqtrizit.
|
||||
- Control UI/skills: clear stale ClawHub results immediately when the search query changes, so debounced searches cannot keep outdated install targets visible. Related #60134.
|
||||
- Fetch/redirects: normalize guarded redirect method rewriting and loop detection so SSRF-guarded requests match platform redirect behavior without missing loops back to the original URL. (#59121) Thanks @eleqtrizit.
|
||||
- Discord/ack reactions: keep automatic ACK reaction auth on the active hydrated Discord account so SecretRef-backed and non-default-account reactions stop falling back to stale default config resolution. (#60081) Thanks @FunJim.
|
||||
- Telegram/model switching: render non-default `/model` callback confirmations with HTML formatting so Telegram shows the selected model in bold instead of raw `**...**` markers. (#60042) Thanks @GitZhangChi.
|
||||
- Plugins/update: allow `openclaw plugins update` to use `--dangerously-force-unsafe-install` for built-in dangerous-code false positives during plugin updates. (#60066) Thanks @huntharo.
|
||||
- Gateway/auth: disconnect shared-auth websocket sessions only for effective auth rotations on restart-capable config writes, and keep `config.set` auth edits from dropping still-valid live sessions. (#60387) Thanks @mappel-nv.
|
||||
- Control UI/chat: keep the Stop button visible during tool-only execution so abortable runs do not fall back to Send while tools are still running. (#54528) thanks @chziyue.
|
||||
- Discord/voice: make READY auto-join fire-and-forget while keeping the shorter initial voice-connect timeout separate from the longer playback-start wait. (#60345) Thanks @geekhuashan.
|
||||
- Agents/skills: add inherited `agents.defaults.skills` allowlists, make per-agent `agents.list[].skills` replace defaults instead of merging, and scope embedded, session, sandbox, and cron skill snapshots through the effective runtime agent. (#59992) Thanks @gumadeiras.
|
||||
- Matrix/Telegram exec approvals: recover stored same-channel account bindings even when session reply state drifted to another channel, so foreign-channel approvals route to the bound account instead of fanning out or being rejected as ambiguous. (#60417) thanks @gumadeiras.
|
||||
- Slack/app manifest: set `bot_user.always_online` to `true` in the onboarding and example Slack app manifest so the Slack app appears ready to respond.
|
||||
- Gateway/websocket auth: refresh auth on new websocket connects after secrets reload so rotated gateway tokens take effect immediately without requiring a restart. (#60323) Thanks @mappel-nv.
|
||||
- Onboarding/plugins: keep non-interactive auth-choice inference scoped to bundled and already-trusted plugins so untrusted workspace manifests cannot hijack built-in provider API-key flows. (#59120) Thanks @eleqtrizit.
|
||||
- Agents/workspace: respect `agents.defaults.workspace` for non-default agents by resolving them under the configured base path instead of falling back to `workspace-<id>`. (#59858) Thanks @joelnishanth.
|
||||
- Config/All Settings: keep the raw config view intact when sensitive fields are blank instead of corrupting or dropping the snapshot during redaction. (#28214) thanks @solodmd.
|
||||
- Plugins/runtime: honor explicit capability allowlists during fallback speech, media-understanding, and image-generation provider loading so bundled capability plugins do not bypass restrictive `plugins.allow` config. (#52262) Thanks @PerfectPan.
|
||||
- Hooks/tool policy: block tool calls when a `before_tool_call` hook crashes so hook failures fail closed instead of silently allowing execution. (#59822) Thanks @pgondhi987.
|
||||
- Matrix/media: surface a dedicated `[matrix <kind> attachment too large]` marker for oversized inbound media instead of the generic unavailable marker, and classify size-limit failures with a typed Matrix error. (#60289) Thanks @efe-arv.
|
||||
- WhatsApp/watchdog: reset watchdog timeout after reconnect so quiet channels no longer enter a tight reconnect loop from stale message timestamps carried across connection runs. (#60007) Thanks @MonkeyLeeT.
|
||||
- Agents/fallback: persist selected fallback overrides before retry attempts start, prefer persisted overrides during live-session reconciliation, and keep provider-scoped auth-profile failover from snapping retries back to stale primary selections.
|
||||
- Gateway/macOS: let launchd `KeepAlive` own in-process gateway restarts again, adding a short supervised-exit delay so rapid restarts avoid launchd crash-loop unloads while `openclaw gateway restart` still reports real LaunchAgent errors synchronously.
|
||||
- Synology Chat/security: route webhook token comparison through the shared constant-time secret helper for consistency with other bundled plugins.
|
||||
- Models/MiniMax: honor `MINIMAX_API_HOST` for implicit bundled MiniMax provider catalogs so China-hosted API-key setups pick `api.minimaxi.com/anthropic` without manual provider config. (#34524) Thanks @caiqinghua.
|
||||
- Usage/MiniMax: invert remaining-style `usage_percent` fields when MiniMax reports only remaining percentage data, so usage bars stop showing nearly-full remaining quota as nearly-exhausted usage. (#60254) Thanks @jwchmodx.
|
||||
- MiniMax: advertise image input on bundled `MiniMax-M2.7` and `MiniMax-M2.7-highspeed` model definitions so image-capable flows can route through the M2.7 family correctly. (#54843) Thanks @MerlinMiao88888888.
|
||||
- Media understanding: auto-register image-capable config providers for vision routing, so custom GLM-style provider ids with image models stop failing with “no media-understanding provider registered”. (#51418) Thanks @xydt-610.
|
||||
- Providers/OpenAI: preserve native `reasoning.effort: "none"` and strict tool schemas on direct OpenAI-family endpoints, keep compat routes on compat shaping, fix Responses WebSocket warm-up behavior, keep stable session and turn metadata, and fall back more gracefully after early WebSocket failures.
|
||||
- Providers/OpenAI Codex: split native `contextWindow` from runtime `contextTokens`, keep the default effective cap at `272000`, and expose a per-model `contextTokens` override on `models.providers.*.models[]`.
|
||||
- Providers/compat: stop forcing OpenAI-only defaults on proxy and custom OpenAI-compatible routes, preserve native vendor-specific reasoning/tool/streaming behavior across Anthropic-compatible, Moonshot, Mistral, ModelStudio, OpenRouter, xAI, and Z.ai endpoints, and route GitHub Copilot Claude models through Anthropic Messages instead of OpenAI Responses.
|
||||
- Providers/Model Studio: preserve native streaming usage reporting for DashScope-compatible endpoints even when they are configured under a generic provider key, so streamed token totals stop sticking at zero. (#52395) Thanks @IVY-AI-gif.
|
||||
- Providers/OpenAI-compatible WS: compute fallback token totals from normalized usage when providers omit or zero `total_tokens`, so DashScope-compatible sessions stop storing zero totals after alias normalization. (#54940) Thanks @lyfuci.
|
||||
- Status/usage: let `/status` and `session_status` fall back to transcript token totals when the session meta store stayed at zero, so LM Studio, Ollama, DashScope, and similar OpenAI-compatible providers stop showing `Context: 0/...`. (#55041) Thanks @jjjojoj.
|
||||
- Providers/Z.AI: preserve explicitly registered `glm-5-*` variants like `glm-5-turbo` instead of intercepting them with the generic GLM-5 forward-compat shim. (#48185) Thanks @haoyu-haoyu.
|
||||
- Live model switching: only treat explicit user-driven model changes as pending live switches, so fallback rotation, heartbeat overrides, and compaction no longer trip `LiveSessionModelSwitchError` before making an API call. (#60266) Thanks @kiranvk-2011.
|
||||
- Voice-call/OpenAI: pass full plugin config into realtime transcription provider resolution so streaming calls can discover the bundled OpenAI realtime transcription provider again. Fixes #60936. Thanks @sliekens and @vincentkoc.
|
||||
- Plugins/OpenAI: enable `gpt-image-1` reference-image edits through `/images/edits` multipart uploads, and stop inferring unsupported resolution overrides when no explicit `size` or `resolution` is provided.
|
||||
- Gateway/startup: default `gateway.mode` to `local` when unset, detect PID recycling in gateway lock files on Windows and macOS, and show startup progress so healthy restarts stop getting blocked by stale locks. (#54801, #60085, #59843)
|
||||
- Mobile pairing/Android: tighten secure endpoint handling so Tailscale and public remote setup reject cleartext endpoints, private LAN pairing still works, merged-role approvals mint both node and operator device tokens, and bootstrap tokens survive node auto-pair until operator approval finishes. (#60128, #60208, #60221)
|
||||
- Android/Talk Mode: restore spoken assistant replies on node-scoped sessions by keeping reply routing synced to the resolved node session key and pausing mic capture during reply playback. (#60306) Thanks @MKV21.
|
||||
- Telegram: fix current-model checks in the model picker, HTML-format non-default `/model` confirmations, explicit topic replies, persisted reaction ownership across restarts, caption-media placeholder and `file_id` preservation on download failure, and upgraded-install inbound image reads. (#60384, #60042, #59634, #59207, #59948, #59971)
|
||||
- Telegram/local Bot API: honor `channels.telegram.apiRoot` for buffered media downloads, add `channels.telegram.network.dangerouslyAllowPrivateNetwork` for trusted fake-IP setups, and require `channels.telegram.trustedLocalFileRoots` before reading absolute Bot API `file_path` values. (#59544, #60705)
|
||||
- Matrix: recover more reliably when secret storage or recovery keys are missing by recreating secret storage during repair and backup reset, hold crypto snapshot locks during persistence, and surface explicit too-large attachment markers. (#59846, #59851, #60599, #60289)
|
||||
- ACP/agents: inherit the target agent workspace for cross-agent ACP spawns and fall back safely when the inherited workspace no longer exists. (#58438) Thanks @zssggle-rgb.
|
||||
- ACPX/Windows: preserve backslashes and absolute `.exe` paths in Claude CLI parsing, and fail fast on wrapper-script targets with guidance to use `cmd.exe /c`, `powershell.exe -File`, or `node <script>`. (#60689)
|
||||
- Gateway/Windows scheduled tasks: preserve Task Scheduler settings on reinstall, fail loudly when `/Run` does not start, and report fast failed restarts accurately instead of pretending they timed out after 60 seconds. (#59335) Thanks @tmimmanuel.
|
||||
- Discord: keep REST, webhook, and monitor traffic on the configured proxy, preserve component-only media sends, honor `@everyone` and `@here` mention gates, keep ACK reactions on the active account, and split voice connect/playback timeouts so auto-join is more reliable. (#57465, #60361, #60345)
|
||||
- WhatsApp: restore `channels.whatsapp.blockStreaming` and reset watchdog timeouts after reconnect so quiet chats stop falling into reconnect loops. (#60007, #60069)
|
||||
- Control UI: keep Stop visible during tool-only execution, preserve pending-send busy state, and clear stale ClawHub search results as soon as the query changes. (#54528, #59800, #60267)
|
||||
- MS Teams: download inline DM images via Graph API and preserve channel reply threading in proactive fallback. (#52212, #55198)
|
||||
- Agents/Claude CLI: persist explicit `openclaw agent --session-id` runs under a stable session key so follow-ups can reuse the stored CLI binding and resume the same underlying Claude session.
|
||||
- Agents/CLI backends: invalidate stored CLI session reuse when local CLI login state or the selected auth profile credential changes, so relogin and token rotation stop resuming stale sessions.
|
||||
- Gateway/macOS: recover installed-but-unloaded LaunchAgents during `openclaw gateway start` and `restart`, while still preferring live unmanaged gateways during restart recovery. (#43766) Thanks @HenryC-3.
|
||||
- Auth/failover: persist selected fallback overrides before retrying, shorten `auth_permanent` lockouts, and refresh websocket/shared-auth sessions only when real auth changes occur so retries and secret rotations behave predictably. (#60404, #60323, #60387)
|
||||
- Cron: replay interrupted recurring jobs on the first gateway restart instead of waiting for a second restart. (#60583) Thanks @joelnishanth.
|
||||
- Plugins/media understanding: enable bundled Groq and Deepgram providers by default so configured transcription models work without extra plugin activation config. (#59982) Thanks @yxjsxy.
|
||||
- Plugins/Kimi Coding: parse tagged tool calls and keep Anthropic-native tool payloads so Kimi coding endpoints execute tools instead of echoing raw markup. (#60051, #60391)
|
||||
- Tools/web_search (Kimi): when `tools.web.search.kimi.baseUrl` is unset, inherit native Moonshot chat `baseUrl` (`.ai` / `.cn`) so China console keys authenticate on the same host as chat. Fixes #44851. (#56769) Thanks @tonga54.
|
||||
- Plugins/marketplace: block remote marketplace symlink escapes without breaking ordinary local marketplace install paths. (#60556) Thanks @eleqtrizit.
|
||||
- Plugins/install: preserve unsafe override flags across linked plugin and hook-pack probes so local `--link` installs honor the documented override behavior. (#60624) Thanks @JerrettDavis.
|
||||
- Config/All Settings: keep the raw config view intact when sensitive fields are blank instead of corrupting or dropping the rendered snapshot. (#28214) Thanks @solodmd.
|
||||
- Security: preserve restrictive plugin-only tool allowlists, require owner access for `/allowlist add` and `/allowlist remove`, fail closed when `before_tool_call` hooks crash, block browser SSRF redirect bypasses earlier, and keep non-interactive auth-choice inference scoped to bundled and already-trusted plugins. (#58476, #59836, #59822, #58771, #59120)
|
||||
- Exec approvals: reuse durable exact-command `allow-always` approvals in allowlist mode so identical reruns stop prompting, and tighten Windows interpreter/path approval handling so wrapper and malformed-path cases fail closed more consistently. (#59880, #59780, #58040, #59182)
|
||||
- Agents/runtime: make default subagent allowlists, inherited skills/workspaces, and duplicate session-id resolution behave more predictably, and include value-shape hints in missing-parameter tool errors. (#59944, #59992, #59858, #55317)
|
||||
- Update/npm: prefer the npm binary that owns the installed global OpenClaw prefix so mixed Homebrew-plus-nvm setups update the right install. (#60153) Thanks @jayeshp19.
|
||||
- Gateway/plugin routes: keep gateway-auth plugin runtime routes on write-only fallback scopes unless a trusted-proxy caller explicitly declares narrower `x-openclaw-scopes`, so plugin HTTP handlers no longer mint admin-level runtime scopes on missing or untrusted HTTP scope headers. (#59815) Thanks @pgondhi987.
|
||||
- Agents/exec approvals: let `exec-approvals.json` agent security override stricter gateway tool defaults so approved subagents can use `security: "full"` without falling back to allowlist enforcement again. (#60310) Thanks @lml2468.
|
||||
- Tasks/maintenance: reconcile stale cron and chat-backed CLI task rows against live cron-job and agent-run ownership instead of treating any persisted session key as proof that the task is still running. (#60310) Thanks @lml2468.
|
||||
- Providers/GitHub Copilot: send IDE identity headers on runtime model requests and GitHub token exchange so IDE-authenticated Copilot runs stop failing with missing `Editor-Version`. (#60641) Thanks @VACInc and @vincentkoc.
|
||||
- Model picker/providers: treat bundled BytePlus and Volcengine plan aliases as their native providers during setup, and expose their bundled standard/coding catalogs before auth so setup can suggest the right models. (#58819) Thanks @Luckymingxuan.
|
||||
- Prompt caching: route Codex Responses and Anthropic Vertex through boundary-aware cache shaping, and report the actual outbound system prompt in cache traces so cache reuse and misses line up with what providers really receive. Thanks @vincentkoc.
|
||||
- Prompt caching: order stable workspace project-context files before `HEARTBEAT.md` and keep `HEARTBEAT.md` below the system-prompt cache boundary so heartbeat churn does not invalidate the stable project-context prefix. (#58979) Thanks @yozu and @vincentkoc.
|
||||
- Plugins/cache: inherit the active gateway workspace for provider, web-search, and web-fetch snapshot loads when callers omit `workspaceDir`, so compatible plugin registries and snapshot caches stop missing on gateway-owned runtime paths. (#61138) Thanks @jzakirov.
|
||||
- Agents/Kimi tool-call repair: preserve tool arguments that were already present on streamed tool calls when later malformed deltas fail reevaluation, while still dropping stale repair-only state before `toolcall_end`.
|
||||
- MiniMax/pricing: keep bundled MiniMax highspeed pricing distinct in provider catalogs and preserve the lower M2.5 cache-read pricing when onboarding older MiniMax models. (#54214) Thanks @octo-patch.
|
||||
- Agents/cache: preserve the full 3-turn prompt-cache image window across tool loops, keep colliding bundled MCP tool definitions deterministic, and reapply Anthropic Vertex cache shaping after payload hook replacements so KV/cache reuse stays stable. Thanks @vincentkoc.
|
||||
- Device pairing: reject rotating device tokens into roles that were never approved during pairing, and keep reconnect role checks bounded to the paired device's approved role set. (#60462) Thanks @eleqtrizit.
|
||||
- Mobile pairing/security: fail closed for internal `/pair` setup-code issuance, cleanup, and approval paths when gateway pairing scopes are missing, and keep approval-time requested-scope enforcement on the internal command path. (#55996) Thanks @coygeek.
|
||||
- Status/cache: restore `cacheRead` and `cacheWrite` in transcript fallback so `/status` keeps showing cache hit percentages when session logs are the only complete usage source. (#59247) Thanks @stuartsy.
|
||||
- Exec approvals/node host: forward prepared `system.run` approval plans on the async node invoke path so mutable script operands keep their approval-time binding and drift revalidation instead of dropping back to unbound execution.
|
||||
- Synology Chat/security: default low-level HTTPS helper TLS verification to on so helper/API defaults match the shipped safe account default, and only explicit `allowInsecureSsl: true` opts out.
|
||||
- Android/canvas security: require exact normalized A2UI URL matches before forwarding canvas bridge actions, rejecting query mismatches and descendant paths while still allowing fragment-only A2UI navigation.
|
||||
- Cron: send failure notifications through the job's primary delivery channel using the same session context as successful delivery when no explicit `failureDestination` is configured. (#60622) Thanks @artwalker.
|
||||
- Mobile pairing/bootstrap: keep QR bootstrap handoff tokens bounded to the mobile-safe contract so node handoff stays unscoped and operator handoff drops mixed `node.*`, `operator.admin`, and `operator.pairing` scopes.
|
||||
- Gateway/auth: serialize async shared-secret auth attempts per client so concurrent Tailscale-capable failures cannot overrun the intended auth rate-limit budget. Thanks @Telecaster2147.
|
||||
- Doctor/config: compare normalized `talk` configs by deep structural equality instead of key-order-sensitive serialization so `openclaw doctor --fix` stops repeatedly reporting/applying no-op `talk.provider/providers` normalization. (#59911) Thanks @ejames-dev.
|
||||
- Providers/Anthropic Vertex: honor `cacheRetention: "long"` with the real 1-hour prompt-cache TTL on Vertex AI endpoints, and default `anthropic-vertex` cache retention like direct Anthropic. (#60888) Thanks @affsantos.
|
||||
- Gateway/device auth: reuse cached device-token scopes only for cached-token reconnects, while keeping explicit `deviceToken` scope requests and empty-cache fallbacks intact so reconnects preserve `operator.read` without breaking explicit auth flows. (#46032) Thanks @caicongyang.
|
||||
- Agents/scheduling: steer background-now work toward automatic completion wake and treat `process` polling as on-demand inspection or intervention instead of default completion handling. (#60877) Thanks @vincentkoc.
|
||||
- Google Gemini CLI auth: improve OAuth credential discovery across Windows nvm and Homebrew libexec installs, and align Code Assist metadata so Gemini login stops failing on packaged CLI layouts. (#40729) Thanks @hughcube.
|
||||
- Google Gemini CLI auth: detect bundled npm installs by scanning packaged bundle files for the Gemini OAuth client config, so `npm install -g @google/gemini-cli` layouts work again. (#60486) Thanks @wzfmini01.
|
||||
- Mattermost/config schema: accept `groups.*.requireMention` again so existing Mattermost configs no longer fail strict validation after upgrade. (#58271) Thanks @MoerAI.
|
||||
- Agents/failover: scope Anthropic `An unknown error occurred` failover matching by provider so generic internal unknown-error text no longer triggers retryable timeout fallback. (#59325) Thanks @aaron-he-zhu.
|
||||
- Providers/OpenRouter failover: classify `403 "Key limit exceeded"` spending-limit responses as billing so model fallback continues instead of stopping on generic auth. (#59892) Thanks @rockcent.
|
||||
- Device pairing/security: keep non-operator device scope checks bound to the requested role prefix so bootstrap verification cannot redeem `operator.*` scopes through `node` auth. (#57258) Thanks @jlapenna.
|
||||
- Gateway/device pairing: require non-admin paired-device sessions to manage only their own device for token rotate/revoke and paired-device removal, blocking cross-device token theft inside pairing-scoped sessions. (#50627) Thanks @coygeek.
|
||||
- CLI/skills JSON: route `skills list --json`, `skills info --json`, and `skills check --json` output to stdout instead of stderr so machine-readable consumers receive JSON on the expected stream again. (#60914; fixes #57599; landed from contributor PR #57611 by @Aftabbs) Thanks @Aftabbs.
|
||||
- Agents/subagents: honor allowlist validation, auth-profile handoff, and session override state when a subagent retries after `LiveSessionModelSwitchError`. (#58178) Thanks @openperf.
|
||||
- Google image generation: disable pinned DNS for Gemini image requests and honor explicit `pinDns` overrides in shared provider HTTP helpers so proxy-backed image generation works again. (#59873) Thanks @luoyanglang.
|
||||
- Agents/exec: restore `host=node` routing for node-pinned and `host=auto` sessions, while still blocking sandboxed `auto` sessions from jumping to gateway. (#60788) Thanks @openperf.
|
||||
- Agents/compaction: keep assistant tool calls and displaced tool results in the same compaction chunk so strict summarization providers stop rejecting orphaned tool pairs. (#58849) Thanks @openperf.
|
||||
- Outbound/sanitizer: strip leaked `<tool_call>`, `<function_calls>`, and model special tokens from shared user-visible assistant text, including truncated tool-call streams, so internal scaffolding no longer bleeds into replies across surfaces. (#60619) Thanks @oliviareid-svg.
|
||||
- Telegram: restore DM voice-note preflight transcription so direct-message audio stops arriving as raw `<media:audio>` placeholders. (#61008) Thanks @manueltarouca.
|
||||
- Control UI/avatar: honor `ui.assistant.avatar` when serving `/avatar/:agentId` so Appearance UI avatar paths stop falling back to initials placeholders. (#60778) Thanks @hannasdev.
|
||||
- Control UI/Overview: prevent gateway access token/password visibility toggle buttons from overlapping their inputs at narrow widths. (#56924) Thanks @bbddbb1.
|
||||
- Control UI/cron: highlight the Cron refresh button while refresh is in flight so the page's loading state stays visible even when prior data remains on screen. (#60394) Thanks @coder-zhuzm.
|
||||
- MS Teams: replace the deprecated Teams SDK HttpPlugin stub with `httpServerAdapter` so recurring gateway deprecation warnings stop firing and the Express 5 compatibility workaround stays on the supported SDK path. (#60939) Thanks @coolramukaka-sys.
|
||||
- CLI/Commander: preserve Commander-computed exit codes for argument and help-error paths, and cover the user-argv parse mode in the regression tests so invalid CLI invocations no longer report success when exits are intercepted. (#60923) Thanks @Linux2010.
|
||||
- Telegram/native command menu: trim long menu descriptions before dropping commands so sub-100 command sets can still fit Telegram's payload budget and keep more `/` entries visible. (#61129) Thanks @neeravmakwana.
|
||||
- Agents/Claude CLI: keep non-interactive `--permission-mode bypassPermissions` when custom `cliBackends.claude-cli.args` override defaults, including fallback resolution before the runtime plugin registry is active, so cron and heartbeat Claude CLI runs do not regress to interactive approval mode. (#61114) Thanks @cathrynlavery and @thewilloftheshadow.
|
||||
- Agents/skills: skip `.git` and `node_modules` when mirroring skills into sandbox workspaces so read-only sandboxes do not copy repo history or dependency trees. (#61090) Thanks @joelnishanth.
|
||||
- Android/Talk Mode: cancel in-flight `talk.speak` playback when speech is explicitly stopped, so stale replies stop starting after barge-in or manual stop. (#61164) Thanks @obviyus.
|
||||
- Plugins/onboarding: write dotted plugin uiHint paths like Brave `webSearch.mode` as nested plugin config so `llm-context` setup stops failing validation. (#61159) Thanks @obviyus.
|
||||
- Android/Talk Mode: restore voice replies on gateway-backed talk mode sessions by updating embedded runner transport overrides to the current agent transport API. (#61214) Thanks @obviyus.
|
||||
- Amazon Bedrock/aws-sdk auth: stop injecting the fake `AWS_PROFILE` apiKey marker when no AWS auth env vars exist, so instance-role and other default-chain setups keep working without poisoning provider config. (#61194) Thanks @wirjo.
|
||||
|
||||
## 2026.4.2
|
||||
|
||||
@@ -132,6 +161,9 @@ Docs: https://docs.openclaw.ai
|
||||
### Fixes
|
||||
|
||||
- Sandbox/security: block credential-path binds even when sandbox home paths resolve through canonical aliases, so agent containers cannot mount user secret stores through alternate home-directory paths. (#59157) Thanks @eleqtrizit.
|
||||
- Gateway/Windows scheduled tasks: preserve Task Scheduler settings on reinstall, fail loud when Scheduled Task `/Run` does not start, and report fast failed restarts with the actual elapsed time instead of a fake 60s timeout. (#59335) Thanks @tmimmanuel.
|
||||
- Control UI/model picker: preserve already-qualified `provider/model` refs from the server so models whose ids already contain slashes stop being double-prefixed and remapped to the wrong provider. (#49874) Thanks @ShionEria.
|
||||
- Models/selection: resolve bare model ids in session model switches against the configured allowlist before falling back to the current session provider, so Control UI model picks stop drifting into `google/k2p5` and similar wrong-provider refs. (#51580) Thanks @honwee.
|
||||
|
||||
## 2026.4.1-beta.1
|
||||
|
||||
@@ -162,6 +194,7 @@ Docs: https://docs.openclaw.ai
|
||||
- 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.
|
||||
- Browser/host inspection: keep static Chrome inspection helpers out of the activated browser runtime so `openclaw doctor browser` and related checks do not eagerly load the bundled browser plugin. (#59471) Thanks @vincentkoc.
|
||||
- Browser/CDP: normalize trailing-dot localhost absolute-form hosts before loopback checks so remote CDP websocket URLs like `ws://localhost.:...` rewrite back to the configured remote host. (#59236) Thanks @mappel-nv.
|
||||
- Browser/attach-only profiles: disconnect cached Playwright CDP sessions when stopping attach-only or remote CDP profiles, while still reporting never-started local managed profiles as not stopped. (#60097) Thanks @pedh.
|
||||
- Agents/output sanitization: strip namespaced `antml:thinking` blocks from user-visible text so Anthropic-style internal monologue tags do not leak into replies. (#59550) Thanks @obviyus.
|
||||
- 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.
|
||||
- Image tool/paths: resolve relative local media paths against the agent `workspaceDir` instead of `process.cwd()` so inputs like `inbox/receipt.png` pass the local-path allowlist reliably. (#57222) Thanks Priyansh Gupta.
|
||||
@@ -187,6 +220,16 @@ Docs: https://docs.openclaw.ai
|
||||
- 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 `SYSTEM_RUN_DENIED`. (#58977) Thanks @Starhappysh.
|
||||
- TUI/chat: keep pending local sends visible and reconciled across history reloads, make busy/error recovery clearer through fallback and terminal-error paths, and reclaim transcript width for long links and paths. (#59800) Thanks @vincentkoc.
|
||||
- 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.
|
||||
- Agents/logging: keep orphaned-user transcript repair warnings focused on interactive runs, and downgrade background-trigger repairs (`heartbeat`, `cron`, `memory`, `overflow`) to debug logs to reduce false-alarm gateway noise.
|
||||
- Gateway/node pairing: require `operator.pairing` for node approvals end-to-end, while still requiring `operator.write` or `operator.admin` when the pending node commands need those higher scopes. (#60461) Thanks @eleqtrizit.
|
||||
- Providers/OpenRouter: gate Anthropic prompt-cache `cache_control` markers to native/default OpenRouter routes and preserve them for native OpenRouter hosts behind custom provider ids. Thanks @vincentkoc.
|
||||
- Browser/CDP: validate both initial and discovered CDP websocket endpoints before connect so strict SSRF policy blocks cross-host pivots and direct websocket targets. (#60469) Thanks @eleqtrizit.
|
||||
- Browser/profiles: reject remote browser profile `cdpUrl` values that violate strict SSRF policy before saving config, with clearer validation errors for blocked endpoints. (#60477) Thanks @eleqtrizit.
|
||||
- Browser/screenshots: stop sending `fromSurface: false` on CDP screenshots so managed Chrome 146+ browsers can capture images again. (#60682) Thanks @mvanhorn.
|
||||
- Mattermost/slash commands: harden native slash-command callback token validation to use constant-time secret comparison, matching the existing interaction-token path.
|
||||
- Control UI/mobile chat: reduce narrow-screen overflow by shrinking the chat pane minimum width, removing extra mobile padding, widening message groups, and hiding avatars on very small screens. (#60220) Thanks @macdao.
|
||||
- Android/Talk Mode: route spoken replies through `talk.speak`, keep compressed playback cleanup deterministic, and fall back to local TTS for legacy gateways that omit Talk error reasons. (#60954) Thanks @obviyus.
|
||||
- Android/Talk Mode: keep reply-speaker routing and teardown behavior aligned with the new remote playback path. (#60954) Thanks @MKV21.
|
||||
|
||||
## 2026.4.1
|
||||
|
||||
@@ -216,6 +259,12 @@ Docs: https://docs.openclaw.ai
|
||||
- Channels/WhatsApp: pass inbound message timestamp to model context so the AI can see when WhatsApp messages were sent. (#58590) Thanks @Maninae
|
||||
- QQBot/voice: lazy-load `silk-wasm` in `audio-convert.ts` 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.
|
||||
- WhatsApp/groups: fix bot waking up on self-number quoted replies in groups with `selfChatMode` enabled. (#60148) Thanks @lurebat
|
||||
- Device pairing: require `operator.pairing` or `operator.admin` for internal `/pair` setup-code, QR, and cleanup commands so lower-privilege gateway callers cannot mint or revoke pairing bootstrap material. (#60491) Thanks @eleqtrizit.
|
||||
- Agents/failover: unify structured and raw provider error classification so provider-specific `400`/`422` payloads no longer get forced into generic format failures before retry, billing, or compaction logic can inspect them. (#58856) Thanks @aaron-he-zhu.
|
||||
- Auth profiles/store: coerce misplaced SecretRef objects out of plaintext `key` and `token` fields during store load so agents without ACP runtime stop crashing on `.trim()` after upgrade. (#58923) Thanks @openperf.
|
||||
- ACPX/runtime: repair `queue owner unavailable` session recovery by replacing dead named sessions and resuming the backend session when ACPX exposes a stable session id, so the first ACP prompt no longer inherits a dead handle. (#58669) Thanks @neeravmakwana
|
||||
- ACPX/runtime: retry dead-session queue-owner repair without `--resume-session` when the reported ACPX session id is stale, so recovery still creates a fresh named session instead of failing session init. Thanks @obviyus.
|
||||
- Tools/web_search (Kimi): replay native Moonshot `$web_search` arguments verbatim, disable thinking for `kimi-k2.5`, and add Moonshot region/model setup prompts so bundled Kimi web search works again. (#59356) Thanks @Innocent-children.
|
||||
|
||||
## 2026.3.31
|
||||
|
||||
@@ -589,6 +638,9 @@ Docs: https://docs.openclaw.ai
|
||||
- Plugins/Matrix: encrypt E2EE image thumbnails with `thumbnail_file` while keeping unencrypted-room previews on `thumbnail_url`, so encrypted Matrix image events keep thumbnail metadata without leaking plaintext previews. (#54711) thanks @frischeDaten.
|
||||
- Telegram/forum topics: keep native `/new` and `/reset` routed to the active topic by preserving the topic target on forum-thread command context. (#35963)
|
||||
- Status/port diagnostics: treat single-process dual-stack loopback gateway listeners as healthy in `openclaw status --all`, suppressing false "port already in use" conflict warnings. (#53398) Thanks @DanWebb1949.
|
||||
- CLI/Docker: treat loopback private-host CLI gateway connects as local for silent pairing auto-approval, while keeping remote backend and public-host CLI connects behind pairing. (#55113) Thanks @sar618.
|
||||
|
||||
## 2026.3.24
|
||||
|
||||
### Breaking
|
||||
|
||||
|
||||
@@ -85,6 +85,12 @@ Welcome to the lobster tank! 🦞
|
||||
4. **Test/CI-only PRs for known `main` failures** → Don't open a PR. The Maintainer team is already tracking those failures, and PRs that only tweak tests or CI to chase them will be closed unless they are required to validate a new fix.
|
||||
5. **Questions** → Discord [#help](https://discord.com/channels/1456350064065904867/1459642797895319552) / [#users-helping-users](https://discord.com/channels/1456350064065904867/1459007081603403828)
|
||||
|
||||
## PR Limits
|
||||
|
||||
We cap at **10 open PRs per author**. If you exceed this, the `r: too-many-prs` label is added and your PR is auto-closed. This is a hard limit.
|
||||
|
||||
For coordinated change sets that genuinely need more than 10 PRs, join the **#clawtributors** channel in Discord and talk to maintainers first.
|
||||
|
||||
## Before You PR
|
||||
|
||||
- Test locally with your OpenClaw instance
|
||||
|
||||
18
README.md
18
README.md
@@ -34,7 +34,7 @@ New install? Start here: [Getting started](https://docs.openclaw.ai/start/gettin
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td align="center" width="20%">
|
||||
<td align="center" width="16.66%">
|
||||
<a href="https://openai.com/">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/openclaw/openclaw/main/docs/assets/sponsors/openai-light.svg">
|
||||
@@ -42,7 +42,15 @@ New install? Start here: [Getting started](https://docs.openclaw.ai/start/gettin
|
||||
</picture>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center" width="20%">
|
||||
<td align="center" width="16.66%">
|
||||
<a href="https://github.com/">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/openclaw/openclaw/main/docs/assets/sponsors/github-light.svg">
|
||||
<img src="https://raw.githubusercontent.com/openclaw/openclaw/main/docs/assets/sponsors/github.svg" alt="GitHub" height="28">
|
||||
</picture>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center" width="16.66%">
|
||||
<a href="https://www.nvidia.com/">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/openclaw/openclaw/main/docs/assets/sponsors/nvidia.svg">
|
||||
@@ -50,7 +58,7 @@ New install? Start here: [Getting started](https://docs.openclaw.ai/start/gettin
|
||||
</picture>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center" width="20%">
|
||||
<td align="center" width="16.66%">
|
||||
<a href="https://vercel.com/">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/openclaw/openclaw/main/docs/assets/sponsors/vercel-light.svg">
|
||||
@@ -58,7 +66,7 @@ New install? Start here: [Getting started](https://docs.openclaw.ai/start/gettin
|
||||
</picture>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center" width="20%">
|
||||
<td align="center" width="16.66%">
|
||||
<a href="https://blacksmith.sh/">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/openclaw/openclaw/main/docs/assets/sponsors/blacksmith-light.svg">
|
||||
@@ -66,7 +74,7 @@ New install? Start here: [Getting started](https://docs.openclaw.ai/start/gettin
|
||||
</picture>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center" width="20%">
|
||||
<td align="center" width="16.66%">
|
||||
<a href="https://www.convex.dev/">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/openclaw/openclaw/main/docs/assets/sponsors/convex-light.svg">
|
||||
|
||||
@@ -65,8 +65,8 @@ android {
|
||||
applicationId = "ai.openclaw.app"
|
||||
minSdk = 31
|
||||
targetSdk = 36
|
||||
versionCode = 2026040301
|
||||
versionName = "2026.4.3"
|
||||
versionCode = 2026040401
|
||||
versionName = "2026.4.4"
|
||||
ndk {
|
||||
// Support all major ABIs — native libs are tiny (~47 KB per ABI)
|
||||
abiFilters += listOf("armeabi-v7a", "arm64-v8a", "x86", "x86_64")
|
||||
|
||||
@@ -71,6 +71,7 @@ class NodeRuntime(
|
||||
|
||||
private val identityStore = DeviceIdentityStore(appContext)
|
||||
private var connectedEndpoint: GatewayEndpoint? = null
|
||||
private var activeGatewayAuth: GatewayConnectAuth? = null
|
||||
|
||||
private val cameraHandler: CameraHandler = CameraHandler(
|
||||
appContext = appContext,
|
||||
@@ -299,6 +300,11 @@ class NodeRuntime(
|
||||
_canvasRehydrateErrorText.value = null
|
||||
updateStatus()
|
||||
showLocalCanvasOnConnect()
|
||||
val endpoint = connectedEndpoint
|
||||
val auth = activeGatewayAuth
|
||||
if (endpoint != null && auth != null) {
|
||||
maybeStartOperatorSessionAfterNodeConnect(endpoint, auth)
|
||||
}
|
||||
},
|
||||
onDisconnected = { message ->
|
||||
_nodeConnected.value = false
|
||||
@@ -345,6 +351,8 @@ class NodeRuntime(
|
||||
session = operatorSession,
|
||||
supportsChatSubscribe = false,
|
||||
isConnected = { operatorConnected },
|
||||
onBeforeSpeak = { micCapture.pauseForTts() },
|
||||
onAfterSpeak = { micCapture.resumeAfterTts() },
|
||||
).also { speaker ->
|
||||
speaker.setPlaybackEnabled(prefs.speakerEnabled.value)
|
||||
}
|
||||
@@ -373,11 +381,10 @@ class NodeRuntime(
|
||||
parseChatSendRunId(response) ?: idempotencyKey
|
||||
},
|
||||
speakAssistantReply = { text ->
|
||||
// Skip if TalkModeManager is handling TTS (ttsOnAllResponses) to avoid
|
||||
// double-speaking the same assistant reply from both pipelines.
|
||||
if (!talkMode.ttsOnAllResponses) {
|
||||
voiceReplySpeaker.speakAssistantReply(text)
|
||||
}
|
||||
// Voice-tab replies should speak through the dedicated reply speaker.
|
||||
// Relying on talkMode.ttsOnAllResponses here can drop playback if the
|
||||
// chat-event path misses the terminal event for this turn.
|
||||
voiceReplySpeaker.speakAssistantReply(text)
|
||||
},
|
||||
)
|
||||
}
|
||||
@@ -416,14 +423,19 @@ class NodeRuntime(
|
||||
session = operatorSession,
|
||||
supportsChatSubscribe = true,
|
||||
isConnected = { operatorConnected },
|
||||
onBeforeSpeak = { micCapture.pauseForTts() },
|
||||
onAfterSpeak = { micCapture.resumeAfterTts() },
|
||||
)
|
||||
}
|
||||
|
||||
private fun syncMainSessionKey(agentId: String?) {
|
||||
val resolvedKey = resolveNodeMainSessionKey(agentId)
|
||||
// Always push the resolved session key into TalkMode, even when the
|
||||
// state flow value is unchanged, so lazy TalkMode instances do not
|
||||
// stay on the default "main" session key.
|
||||
talkMode.setMainSessionKey(resolvedKey)
|
||||
if (_mainSessionKey.value == resolvedKey) return
|
||||
_mainSessionKey.value = resolvedKey
|
||||
talkMode.setMainSessionKey(resolvedKey)
|
||||
chat.applyMainSessionKey(resolvedKey)
|
||||
updateHomeCanvasState()
|
||||
}
|
||||
@@ -583,12 +595,11 @@ class NodeRuntime(
|
||||
|
||||
scope.launch {
|
||||
prefs.talkEnabled.collect { enabled ->
|
||||
// MicCaptureManager handles STT + send to gateway.
|
||||
// TalkModeManager plays TTS on assistant responses.
|
||||
// MicCaptureManager handles STT + send to gateway, while the dedicated
|
||||
// reply speaker handles TTS for assistant replies in the voice tab.
|
||||
micCapture.setMicEnabled(enabled)
|
||||
if (enabled) {
|
||||
// Mic on = user is on voice screen and wants TTS responses.
|
||||
talkMode.ttsOnAllResponses = true
|
||||
talkMode.ttsOnAllResponses = false
|
||||
scope.launch { talkMode.ensureChatSubscribed() }
|
||||
}
|
||||
externalAudioCaptureActive.value = enabled
|
||||
@@ -749,8 +760,8 @@ class NodeRuntime(
|
||||
prefs.setTalkEnabled(value)
|
||||
if (value) {
|
||||
// Tapping mic on interrupts any active TTS (barge-in)
|
||||
talkMode.stopTts()
|
||||
talkMode.ttsOnAllResponses = true
|
||||
stopVoicePlayback()
|
||||
talkMode.ttsOnAllResponses = false
|
||||
scope.launch { talkMode.ensureChatSubscribed() }
|
||||
}
|
||||
micCapture.setMicEnabled(value)
|
||||
@@ -765,18 +776,25 @@ class NodeRuntime(
|
||||
if (voiceReplySpeakerLazy.isInitialized()) {
|
||||
voiceReplySpeaker.setPlaybackEnabled(value)
|
||||
}
|
||||
// Keep TalkMode in sync so speaker mute works when ttsOnAllResponses is active.
|
||||
// Keep TalkMode in sync so any active Talk playback also respects speaker mute.
|
||||
talkMode.setPlaybackEnabled(value)
|
||||
}
|
||||
|
||||
private fun stopActiveVoiceSession() {
|
||||
talkMode.ttsOnAllResponses = false
|
||||
talkMode.stopTts()
|
||||
stopVoicePlayback()
|
||||
micCapture.setMicEnabled(false)
|
||||
prefs.setTalkEnabled(false)
|
||||
externalAudioCaptureActive.value = false
|
||||
}
|
||||
|
||||
private fun stopVoicePlayback() {
|
||||
talkMode.stopTts()
|
||||
if (voiceReplySpeakerLazy.isInitialized()) {
|
||||
voiceReplySpeaker.stopTts()
|
||||
}
|
||||
}
|
||||
|
||||
fun refreshGatewayConnection() {
|
||||
val endpoint =
|
||||
connectedEndpoint ?: run {
|
||||
@@ -793,15 +811,14 @@ class NodeRuntime(
|
||||
auth: GatewayConnectAuth,
|
||||
reconnect: Boolean = false,
|
||||
) {
|
||||
activeGatewayAuth = auth
|
||||
val tls = connectionManager.resolveTlsParams(endpoint)
|
||||
val connectOperator =
|
||||
shouldConnectOperatorSession(
|
||||
auth.token,
|
||||
auth.bootstrapToken,
|
||||
auth.password,
|
||||
loadStoredRoleDeviceToken("operator"),
|
||||
val operatorAuth =
|
||||
resolveOperatorSessionConnectAuth(
|
||||
auth = auth,
|
||||
storedOperatorToken = loadStoredRoleDeviceToken("operator"),
|
||||
)
|
||||
if (!connectOperator) {
|
||||
if (operatorAuth == null) {
|
||||
operatorConnected = false
|
||||
operatorStatusText = "Offline"
|
||||
operatorSession.disconnect()
|
||||
@@ -809,9 +826,9 @@ class NodeRuntime(
|
||||
} else {
|
||||
operatorSession.connect(
|
||||
endpoint,
|
||||
auth.token,
|
||||
auth.bootstrapToken,
|
||||
auth.password,
|
||||
operatorAuth.token,
|
||||
operatorAuth.bootstrapToken,
|
||||
operatorAuth.password,
|
||||
connectionManager.buildOperatorConnectOptions(),
|
||||
tls,
|
||||
)
|
||||
@@ -824,7 +841,7 @@ class NodeRuntime(
|
||||
connectionManager.buildNodeConnectOptions(),
|
||||
tls,
|
||||
)
|
||||
if (reconnect && connectOperator) {
|
||||
if (reconnect && operatorAuth != null) {
|
||||
operatorSession.reconnect()
|
||||
}
|
||||
if (reconnect) {
|
||||
@@ -922,8 +939,33 @@ class NodeRuntime(
|
||||
return deviceAuthStore.loadToken(deviceId, role)
|
||||
}
|
||||
|
||||
private fun maybeStartOperatorSessionAfterNodeConnect(
|
||||
endpoint: GatewayEndpoint,
|
||||
auth: GatewayConnectAuth,
|
||||
) {
|
||||
if (operatorConnected || operatorStatusText == "Connecting…") {
|
||||
return
|
||||
}
|
||||
val operatorAuth =
|
||||
resolveOperatorSessionConnectAuth(
|
||||
auth = auth,
|
||||
storedOperatorToken = loadStoredRoleDeviceToken("operator"),
|
||||
) ?: return
|
||||
operatorStatusText = "Connecting…"
|
||||
updateStatus()
|
||||
operatorSession.connect(
|
||||
endpoint,
|
||||
operatorAuth.token,
|
||||
operatorAuth.bootstrapToken,
|
||||
operatorAuth.password,
|
||||
connectionManager.buildOperatorConnectOptions(),
|
||||
connectionManager.resolveTlsParams(endpoint),
|
||||
)
|
||||
}
|
||||
|
||||
fun disconnect() {
|
||||
connectedEndpoint = null
|
||||
activeGatewayAuth = null
|
||||
_pendingGatewayTrust.value = null
|
||||
operatorSession.disconnect()
|
||||
nodeSession.disconnect()
|
||||
@@ -1259,18 +1301,47 @@ class NodeRuntime(
|
||||
|
||||
}
|
||||
|
||||
internal fun resolveOperatorSessionConnectAuth(
|
||||
auth: NodeRuntime.GatewayConnectAuth,
|
||||
storedOperatorToken: String?,
|
||||
): NodeRuntime.GatewayConnectAuth? {
|
||||
val explicitToken = auth.token?.trim()?.takeIf { it.isNotEmpty() }
|
||||
if (explicitToken != null) {
|
||||
return NodeRuntime.GatewayConnectAuth(
|
||||
token = explicitToken,
|
||||
bootstrapToken = null,
|
||||
password = null,
|
||||
)
|
||||
}
|
||||
|
||||
val explicitPassword = auth.password?.trim()?.takeIf { it.isNotEmpty() }
|
||||
if (explicitPassword != null) {
|
||||
return NodeRuntime.GatewayConnectAuth(
|
||||
token = null,
|
||||
bootstrapToken = null,
|
||||
password = explicitPassword,
|
||||
)
|
||||
}
|
||||
|
||||
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,
|
||||
password = null,
|
||||
)
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
internal fun shouldConnectOperatorSession(
|
||||
token: String?,
|
||||
bootstrapToken: String?,
|
||||
password: String?,
|
||||
auth: NodeRuntime.GatewayConnectAuth,
|
||||
storedOperatorToken: String?,
|
||||
): Boolean {
|
||||
return (
|
||||
!token.isNullOrBlank() ||
|
||||
!bootstrapToken.isNullOrBlank() ||
|
||||
!password.isNullOrBlank() ||
|
||||
!storedOperatorToken.isNullOrBlank()
|
||||
)
|
||||
return resolveOperatorSessionConnectAuth(auth, storedOperatorToken) != null
|
||||
}
|
||||
|
||||
private enum class HomeCanvasGatewayState {
|
||||
|
||||
@@ -1,32 +1,92 @@
|
||||
package ai.openclaw.app.gateway
|
||||
|
||||
import ai.openclaw.app.SecurePrefs
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.encodeToString
|
||||
import kotlinx.serialization.json.Json
|
||||
|
||||
data class DeviceAuthEntry(
|
||||
val token: String,
|
||||
val role: String,
|
||||
val scopes: List<String>,
|
||||
val updatedAtMs: Long,
|
||||
)
|
||||
|
||||
@Serializable
|
||||
private data class PersistedDeviceAuthMetadata(
|
||||
val scopes: List<String> = emptyList(),
|
||||
val updatedAtMs: Long = 0L,
|
||||
)
|
||||
|
||||
interface DeviceAuthTokenStore {
|
||||
fun loadToken(deviceId: String, role: String): String?
|
||||
fun saveToken(deviceId: String, role: String, token: String)
|
||||
fun loadEntry(deviceId: String, role: String): DeviceAuthEntry?
|
||||
fun loadToken(deviceId: String, role: String): String? = loadEntry(deviceId, role)?.token
|
||||
fun saveToken(deviceId: String, role: String, token: String, scopes: List<String> = emptyList())
|
||||
fun clearToken(deviceId: String, role: String)
|
||||
}
|
||||
|
||||
class DeviceAuthStore(private val prefs: SecurePrefs) : DeviceAuthTokenStore {
|
||||
override fun loadToken(deviceId: String, role: String): String? {
|
||||
private val json = Json { ignoreUnknownKeys = true }
|
||||
|
||||
override fun loadEntry(deviceId: String, role: String): DeviceAuthEntry? {
|
||||
val key = tokenKey(deviceId, role)
|
||||
return prefs.getString(key)?.trim()?.takeIf { it.isNotEmpty() }
|
||||
val token = prefs.getString(key)?.trim()?.takeIf { it.isNotEmpty() } ?: return null
|
||||
val normalizedRole = normalizeRole(role)
|
||||
val metadata =
|
||||
prefs.getString(metadataKey(deviceId, role))
|
||||
?.let { raw ->
|
||||
runCatching { json.decodeFromString<PersistedDeviceAuthMetadata>(raw) }.getOrNull()
|
||||
}
|
||||
return DeviceAuthEntry(
|
||||
token = token,
|
||||
role = normalizedRole,
|
||||
scopes = metadata?.scopes ?: emptyList(),
|
||||
updatedAtMs = metadata?.updatedAtMs ?: 0L,
|
||||
)
|
||||
}
|
||||
|
||||
override fun saveToken(deviceId: String, role: String, token: String) {
|
||||
override fun saveToken(deviceId: String, role: String, token: String, scopes: List<String>) {
|
||||
val normalizedScopes = normalizeScopes(scopes)
|
||||
val key = tokenKey(deviceId, role)
|
||||
prefs.putString(key, token.trim())
|
||||
prefs.putString(
|
||||
metadataKey(deviceId, role),
|
||||
json.encodeToString(
|
||||
PersistedDeviceAuthMetadata(
|
||||
scopes = normalizedScopes,
|
||||
updatedAtMs = System.currentTimeMillis(),
|
||||
),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
override fun clearToken(deviceId: String, role: String) {
|
||||
val key = tokenKey(deviceId, role)
|
||||
prefs.remove(key)
|
||||
prefs.remove(metadataKey(deviceId, role))
|
||||
}
|
||||
|
||||
private fun tokenKey(deviceId: String, role: String): String {
|
||||
val normalizedDevice = deviceId.trim().lowercase()
|
||||
val normalizedRole = role.trim().lowercase()
|
||||
val normalizedDevice = normalizeDeviceId(deviceId)
|
||||
val normalizedRole = normalizeRole(role)
|
||||
return "gateway.deviceToken.$normalizedDevice.$normalizedRole"
|
||||
}
|
||||
|
||||
private fun metadataKey(deviceId: String, role: String): String {
|
||||
val normalizedDevice = normalizeDeviceId(deviceId)
|
||||
val normalizedRole = normalizeRole(role)
|
||||
return "gateway.deviceTokenMeta.$normalizedDevice.$normalizedRole"
|
||||
}
|
||||
|
||||
private fun normalizeDeviceId(deviceId: String): String = deviceId.trim().lowercase()
|
||||
|
||||
private fun normalizeRole(role: String): String = role.trim().lowercase()
|
||||
|
||||
private fun normalizeScopes(scopes: List<String>): List<String> {
|
||||
return scopes
|
||||
.map { it.trim() }
|
||||
.filter { it.isNotEmpty() }
|
||||
.distinct()
|
||||
.sorted()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,6 +64,7 @@ data class GatewayConnectErrorDetails(
|
||||
val code: String?,
|
||||
val canRetryWithDeviceToken: Boolean,
|
||||
val recommendedNextStep: String?,
|
||||
val reason: String? = null,
|
||||
)
|
||||
|
||||
private data class SelectedConnectAuth(
|
||||
@@ -116,6 +117,8 @@ class GatewaySession(
|
||||
val details: GatewayConnectErrorDetails? = null,
|
||||
)
|
||||
|
||||
data class RpcResult(val ok: Boolean, val payloadJson: String?, val error: ErrorShape?)
|
||||
|
||||
private val json = Json { ignoreUnknownKeys = true }
|
||||
private val writeLock = Mutex()
|
||||
private val pending = ConcurrentHashMap<String, CompletableDeferred<RpcResponse>>()
|
||||
@@ -196,6 +199,13 @@ class GatewaySession(
|
||||
}
|
||||
|
||||
suspend fun request(method: String, paramsJson: String?, timeoutMs: Long = 15_000): String {
|
||||
val res = requestDetailed(method = method, paramsJson = paramsJson, timeoutMs = timeoutMs)
|
||||
if (res.ok) return res.payloadJson ?: ""
|
||||
val err = res.error
|
||||
throw IllegalStateException("${err?.code ?: "UNAVAILABLE"}: ${err?.message ?: "request failed"}")
|
||||
}
|
||||
|
||||
suspend fun requestDetailed(method: String, paramsJson: String?, timeoutMs: Long = 15_000): RpcResult {
|
||||
val conn = currentConnection ?: throw IllegalStateException("not connected")
|
||||
val params =
|
||||
if (paramsJson.isNullOrBlank()) {
|
||||
@@ -204,9 +214,7 @@ class GatewaySession(
|
||||
json.parseToJsonElement(paramsJson)
|
||||
}
|
||||
val res = conn.request(method, params, timeoutMs)
|
||||
if (res.ok) return res.payloadJson ?: ""
|
||||
val err = res.error
|
||||
throw IllegalStateException("${err?.code ?: "UNAVAILABLE"}: ${err?.message ?: "request failed"}")
|
||||
return RpcResult(ok = res.ok, payloadJson = res.payloadJson, error = res.error)
|
||||
}
|
||||
|
||||
suspend fun refreshNodeCanvasCapability(timeoutMs: Long = 8_000): Boolean {
|
||||
@@ -418,11 +426,63 @@ class GatewaySession(
|
||||
}
|
||||
throw GatewayConnectFailure(error)
|
||||
}
|
||||
handleConnectSuccess(res, identity.deviceId)
|
||||
handleConnectSuccess(res, identity.deviceId, selectedAuth.authSource)
|
||||
connectDeferred.complete(Unit)
|
||||
}
|
||||
|
||||
private fun handleConnectSuccess(res: RpcResponse, deviceId: String) {
|
||||
private fun shouldPersistBootstrapHandoffTokens(authSource: GatewayConnectAuthSource): Boolean {
|
||||
if (authSource != GatewayConnectAuthSource.BOOTSTRAP_TOKEN) return false
|
||||
if (isLoopbackGatewayHost(endpoint.host)) return true
|
||||
return tls != null
|
||||
}
|
||||
|
||||
private fun filteredBootstrapHandoffScopes(role: String, scopes: List<String>): List<String>? {
|
||||
return when (role.trim()) {
|
||||
"node" -> emptyList()
|
||||
"operator" -> {
|
||||
val allowedOperatorScopes =
|
||||
setOf(
|
||||
"operator.approvals",
|
||||
"operator.read",
|
||||
"operator.talk.secrets",
|
||||
"operator.write",
|
||||
)
|
||||
scopes.filter { allowedOperatorScopes.contains(it) }.distinct().sorted()
|
||||
}
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
private fun persistBootstrapHandoffToken(
|
||||
deviceId: String,
|
||||
role: String,
|
||||
token: String,
|
||||
scopes: List<String>,
|
||||
) {
|
||||
val filteredScopes = filteredBootstrapHandoffScopes(role, scopes) ?: return
|
||||
deviceAuthStore.saveToken(deviceId, role, token, filteredScopes)
|
||||
}
|
||||
|
||||
private fun persistIssuedDeviceToken(
|
||||
authSource: GatewayConnectAuthSource,
|
||||
deviceId: String,
|
||||
role: String,
|
||||
token: String,
|
||||
scopes: List<String>,
|
||||
) {
|
||||
if (authSource == GatewayConnectAuthSource.BOOTSTRAP_TOKEN) {
|
||||
if (!shouldPersistBootstrapHandoffTokens(authSource)) return
|
||||
persistBootstrapHandoffToken(deviceId, role, token, scopes)
|
||||
return
|
||||
}
|
||||
deviceAuthStore.saveToken(deviceId, role, token, scopes)
|
||||
}
|
||||
|
||||
private fun handleConnectSuccess(
|
||||
res: RpcResponse,
|
||||
deviceId: String,
|
||||
authSource: GatewayConnectAuthSource,
|
||||
) {
|
||||
val payloadJson = res.payloadJson ?: throw IllegalStateException("connect failed: missing payload")
|
||||
val obj = json.parseToJsonElement(payloadJson).asObjectOrNull() ?: throw IllegalStateException("connect failed")
|
||||
pendingDeviceTokenRetry = false
|
||||
@@ -432,8 +492,27 @@ class GatewaySession(
|
||||
val authObj = obj["auth"].asObjectOrNull()
|
||||
val deviceToken = authObj?.get("deviceToken").asStringOrNull()
|
||||
val authRole = authObj?.get("role").asStringOrNull() ?: options.role
|
||||
val authScopes =
|
||||
authObj?.get("scopes").asArrayOrNull()
|
||||
?.mapNotNull { it.asStringOrNull() }
|
||||
?: emptyList()
|
||||
if (!deviceToken.isNullOrBlank()) {
|
||||
deviceAuthStore.saveToken(deviceId, authRole, deviceToken)
|
||||
persistIssuedDeviceToken(authSource, deviceId, authRole, deviceToken, authScopes)
|
||||
}
|
||||
if (shouldPersistBootstrapHandoffTokens(authSource)) {
|
||||
authObj?.get("deviceTokens").asArrayOrNull()
|
||||
?.mapNotNull { it.asObjectOrNull() }
|
||||
?.forEach { tokenEntry ->
|
||||
val handoffToken = tokenEntry["deviceToken"].asStringOrNull()
|
||||
val handoffRole = tokenEntry["role"].asStringOrNull()
|
||||
val handoffScopes =
|
||||
tokenEntry["scopes"].asArrayOrNull()
|
||||
?.mapNotNull { it.asStringOrNull() }
|
||||
?: emptyList()
|
||||
if (!handoffToken.isNullOrBlank() && !handoffRole.isNullOrBlank()) {
|
||||
persistBootstrapHandoffToken(deviceId, handoffRole, handoffToken, handoffScopes)
|
||||
}
|
||||
}
|
||||
}
|
||||
val rawCanvas = obj["canvasHostUrl"].asStringOrNull()
|
||||
canvasHostUrl = normalizeCanvasHostUrl(rawCanvas, endpoint, isTlsConnection = tls != null)
|
||||
@@ -560,6 +639,7 @@ class GatewaySession(
|
||||
code = it["code"].asStringOrNull(),
|
||||
canRetryWithDeviceToken = it["canRetryWithDeviceToken"].asBooleanOrNull() == true,
|
||||
recommendedNextStep = it["recommendedNextStep"].asStringOrNull(),
|
||||
reason = it["reason"].asStringOrNull(),
|
||||
)
|
||||
}
|
||||
ErrorShape(code, msg, details)
|
||||
@@ -899,6 +979,8 @@ private fun formatGatewayAuthorityHost(host: String): String {
|
||||
|
||||
private fun JsonElement?.asObjectOrNull(): JsonObject? = this as? JsonObject
|
||||
|
||||
private fun JsonElement?.asArrayOrNull(): JsonArray? = this as? JsonArray
|
||||
|
||||
private fun JsonElement?.asStringOrNull(): String? =
|
||||
when (this) {
|
||||
is JsonNull -> null
|
||||
|
||||
@@ -14,30 +14,31 @@ object CanvasActionTrust {
|
||||
if (candidateUri.scheme.equals("file", ignoreCase = true)) {
|
||||
return false
|
||||
}
|
||||
val normalizedCandidate = normalizeTrustedRemoteA2uiUri(candidateUri) ?: return false
|
||||
|
||||
return trustedA2uiUrls.any { trusted ->
|
||||
isTrustedA2uiPage(candidateUri, trusted)
|
||||
matchesTrustedRemoteA2uiUrlExact(normalizedCandidate, trusted)
|
||||
}
|
||||
}
|
||||
|
||||
private fun isTrustedA2uiPage(candidateUri: URI, trustedUrl: String): Boolean {
|
||||
private fun matchesTrustedRemoteA2uiUrlExact(candidateUri: URI, trustedUrl: String): Boolean {
|
||||
val trustedUri = parseUri(trustedUrl) ?: return false
|
||||
if (!candidateUri.scheme.equals(trustedUri.scheme, ignoreCase = true)) return false
|
||||
if (candidateUri.host?.equals(trustedUri.host, ignoreCase = true) != true) return false
|
||||
if (effectivePort(candidateUri) != effectivePort(trustedUri)) return false
|
||||
|
||||
val trustedPath = trustedUri.rawPath?.takeIf { it.isNotBlank() } ?: return false
|
||||
val candidatePath = candidateUri.rawPath?.takeIf { it.isNotBlank() } ?: return false
|
||||
val trustedPrefix = if (trustedPath.endsWith("/")) trustedPath else "$trustedPath/"
|
||||
return candidatePath == trustedPath || candidatePath.startsWith(trustedPrefix)
|
||||
val normalizedTrusted = normalizeTrustedRemoteA2uiUri(trustedUri) ?: return false
|
||||
return candidateUri == normalizedTrusted
|
||||
}
|
||||
|
||||
private fun effectivePort(uri: URI): Int {
|
||||
if (uri.port >= 0) return uri.port
|
||||
return when (uri.scheme?.lowercase()) {
|
||||
"https" -> 443
|
||||
"http" -> 80
|
||||
else -> -1
|
||||
private fun normalizeTrustedRemoteA2uiUri(uri: URI): URI? {
|
||||
// Keep Android trust normalization aligned with iOS ScreenController:
|
||||
// exact remote URL match, scheme/host normalized, fragment ignored.
|
||||
val scheme = uri.scheme?.lowercase() ?: return null
|
||||
if (scheme != "http" && scheme != "https") return null
|
||||
|
||||
val host = uri.host?.trim()?.takeIf { it.isNotEmpty() }?.lowercase() ?: return null
|
||||
|
||||
return try {
|
||||
URI(scheme, uri.userInfo, host, uri.port, uri.rawPath, uri.rawQuery, null)
|
||||
} catch (_: Throwable) {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import ai.openclaw.app.gateway.GatewayClientInfo
|
||||
import ai.openclaw.app.gateway.GatewayConnectOptions
|
||||
import ai.openclaw.app.gateway.GatewayEndpoint
|
||||
import ai.openclaw.app.gateway.GatewayTlsParams
|
||||
import ai.openclaw.app.gateway.isLoopbackGatewayHost
|
||||
import ai.openclaw.app.gateway.isPrivateLanGatewayHost
|
||||
import ai.openclaw.app.LocationMode
|
||||
import ai.openclaw.app.VoiceWakeMode
|
||||
|
||||
@@ -34,7 +34,7 @@ class ConnectionManager(
|
||||
val stableId = endpoint.stableId
|
||||
val stored = storedFingerprint?.trim().takeIf { !it.isNullOrEmpty() }
|
||||
val isManual = stableId.startsWith("manual|")
|
||||
val cleartextAllowedHost = isLoopbackGatewayHost(endpoint.host)
|
||||
val cleartextAllowedHost = isPrivateLanGatewayHost(endpoint.host)
|
||||
|
||||
if (isManual) {
|
||||
if (!manualTlsEnabled && cleartextAllowedHost) return null
|
||||
|
||||
@@ -163,7 +163,7 @@ private fun disableForceDarkIfSupported(settings: WebSettings) {
|
||||
WebSettingsCompat.setForceDark(settings, WebSettingsCompat.FORCE_DARK_OFF)
|
||||
}
|
||||
|
||||
private class CanvasA2UIActionBridge(
|
||||
internal class CanvasA2UIActionBridge(
|
||||
private val isTrustedPage: () -> Boolean,
|
||||
private val onMessage: (String) -> Unit,
|
||||
) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package ai.openclaw.app.ui
|
||||
|
||||
import ai.openclaw.app.gateway.isLoopbackGatewayHost
|
||||
import ai.openclaw.app.gateway.isPrivateLanGatewayHost
|
||||
import java.util.Base64
|
||||
import java.util.Locale
|
||||
import java.net.URI
|
||||
@@ -56,7 +56,7 @@ internal data class GatewayScannedSetupCodeResult(
|
||||
|
||||
private val gatewaySetupJson = Json { ignoreUnknownKeys = true }
|
||||
private const val remoteGatewaySecurityRule =
|
||||
"Non-loopback mobile nodes require wss:// or Tailscale Serve. ws:// is allowed only for localhost and the Android emulator."
|
||||
"Tailscale and public mobile nodes require wss:// or Tailscale Serve. ws:// is allowed for private LAN, localhost, and the Android emulator."
|
||||
private const val remoteGatewaySecurityFix =
|
||||
"Use a private LAN host/address, or enable Tailscale Serve / expose a wss:// gateway URL."
|
||||
|
||||
@@ -143,7 +143,7 @@ internal fun parseGatewayEndpoint(rawInput: String): GatewayEndpointConfig? {
|
||||
"wss", "https" -> true
|
||||
else -> true
|
||||
}
|
||||
if (!tls && !isLoopbackGatewayHost(host)) {
|
||||
if (!tls && !isPrivateLanGatewayHost(host)) {
|
||||
return GatewayEndpointParseResult(error = GatewayEndpointValidationError.INSECURE_REMOTE_URL)
|
||||
}
|
||||
val defaultPort =
|
||||
|
||||
@@ -14,11 +14,13 @@ import android.speech.SpeechRecognizer
|
||||
import androidx.core.content.ContextCompat
|
||||
import java.util.UUID
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import kotlinx.serialization.json.Json
|
||||
import kotlinx.serialization.json.JsonArray
|
||||
import kotlinx.serialization.json.JsonObject
|
||||
@@ -88,6 +90,7 @@ class MicCaptureManager(
|
||||
val isSending: StateFlow<Boolean> = _isSending
|
||||
|
||||
private val messageQueue = ArrayDeque<String>()
|
||||
private val messageQueueLock = Any()
|
||||
private var flushedPartialTranscript: String? = null
|
||||
private var pendingRunId: String? = null
|
||||
private var pendingAssistantEntryId: String? = null
|
||||
@@ -99,11 +102,63 @@ class MicCaptureManager(
|
||||
private var transcriptFlushJob: Job? = null
|
||||
private var pendingRunTimeoutJob: Job? = null
|
||||
private var stopRequested = false
|
||||
private val ttsPauseLock = Any()
|
||||
private var ttsPauseDepth = 0
|
||||
private var resumeMicAfterTts = false
|
||||
|
||||
private fun enqueueMessage(message: String) {
|
||||
synchronized(messageQueueLock) {
|
||||
messageQueue.addLast(message)
|
||||
}
|
||||
}
|
||||
|
||||
private fun snapshotMessageQueue(): List<String> {
|
||||
return synchronized(messageQueueLock) {
|
||||
messageQueue.toList()
|
||||
}
|
||||
}
|
||||
|
||||
private fun hasQueuedMessages(): Boolean {
|
||||
return synchronized(messageQueueLock) {
|
||||
messageQueue.isNotEmpty()
|
||||
}
|
||||
}
|
||||
|
||||
private fun firstQueuedMessage(): String? {
|
||||
return synchronized(messageQueueLock) {
|
||||
messageQueue.firstOrNull()
|
||||
}
|
||||
}
|
||||
|
||||
private fun removeFirstQueuedMessage(): String? {
|
||||
return synchronized(messageQueueLock) {
|
||||
if (messageQueue.isEmpty()) null else messageQueue.removeFirst()
|
||||
}
|
||||
}
|
||||
|
||||
private fun queuedMessageCount(): Int {
|
||||
return synchronized(messageQueueLock) {
|
||||
messageQueue.size
|
||||
}
|
||||
}
|
||||
|
||||
fun setMicEnabled(enabled: Boolean) {
|
||||
if (_micEnabled.value == enabled) return
|
||||
_micEnabled.value = enabled
|
||||
if (enabled) {
|
||||
val pausedForTts =
|
||||
synchronized(ttsPauseLock) {
|
||||
if (ttsPauseDepth > 0) {
|
||||
resumeMicAfterTts = true
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
if (pausedForTts) {
|
||||
_statusText.value = if (_isSending.value) "Speaking · waiting for reply" else "Speaking…"
|
||||
return
|
||||
}
|
||||
start()
|
||||
sendQueuedIfIdle()
|
||||
} else {
|
||||
@@ -126,6 +181,58 @@ class MicCaptureManager(
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun pauseForTts() {
|
||||
val shouldPause =
|
||||
synchronized(ttsPauseLock) {
|
||||
ttsPauseDepth += 1
|
||||
if (ttsPauseDepth > 1) return@synchronized false
|
||||
resumeMicAfterTts = _micEnabled.value
|
||||
val active = resumeMicAfterTts || recognizer != null || _isListening.value
|
||||
if (!active) return@synchronized false
|
||||
stopRequested = true
|
||||
restartJob?.cancel()
|
||||
restartJob = null
|
||||
transcriptFlushJob?.cancel()
|
||||
transcriptFlushJob = null
|
||||
_isListening.value = false
|
||||
_inputLevel.value = 0f
|
||||
_liveTranscript.value = null
|
||||
_statusText.value = if (_isSending.value) "Speaking · waiting for reply" else "Speaking…"
|
||||
true
|
||||
}
|
||||
if (!shouldPause) return
|
||||
withContext(Dispatchers.Main) {
|
||||
recognizer?.cancel()
|
||||
recognizer?.destroy()
|
||||
recognizer = null
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun resumeAfterTts() {
|
||||
val shouldResume =
|
||||
synchronized(ttsPauseLock) {
|
||||
if (ttsPauseDepth == 0) return@synchronized false
|
||||
ttsPauseDepth -= 1
|
||||
if (ttsPauseDepth > 0) return@synchronized false
|
||||
val resume = resumeMicAfterTts && _micEnabled.value
|
||||
resumeMicAfterTts = false
|
||||
if (!resume) {
|
||||
_statusText.value =
|
||||
when {
|
||||
_micEnabled.value && _isSending.value -> "Listening · sending queued voice"
|
||||
_micEnabled.value -> "Listening"
|
||||
_isSending.value -> "Mic off · sending…"
|
||||
else -> "Mic off"
|
||||
}
|
||||
}
|
||||
resume
|
||||
}
|
||||
if (!shouldResume) return
|
||||
stopRequested = false
|
||||
start()
|
||||
sendQueuedIfIdle()
|
||||
}
|
||||
|
||||
fun onGatewayConnectionChanged(connected: Boolean) {
|
||||
gatewayConnected = connected
|
||||
if (connected) {
|
||||
@@ -137,7 +244,7 @@ class MicCaptureManager(
|
||||
pendingRunId = null
|
||||
pendingAssistantEntryId = null
|
||||
_isSending.value = false
|
||||
if (messageQueue.isNotEmpty()) {
|
||||
if (hasQueuedMessages()) {
|
||||
_statusText.value = queuedWaitingStatus()
|
||||
}
|
||||
}
|
||||
@@ -245,7 +352,7 @@ class MicCaptureManager(
|
||||
_statusText.value =
|
||||
when {
|
||||
_isSending.value -> "Listening · sending queued voice"
|
||||
messageQueue.isNotEmpty() -> "Listening · ${messageQueue.size} queued"
|
||||
hasQueuedMessages() -> "Listening · ${queuedMessageCount()} queued"
|
||||
else -> "Listening"
|
||||
}
|
||||
_isListening.value = true
|
||||
@@ -278,7 +385,7 @@ class MicCaptureManager(
|
||||
role = VoiceConversationRole.User,
|
||||
text = message,
|
||||
)
|
||||
messageQueue.addLast(message)
|
||||
enqueueMessage(message)
|
||||
publishQueue()
|
||||
}
|
||||
|
||||
@@ -297,12 +404,12 @@ class MicCaptureManager(
|
||||
}
|
||||
|
||||
private fun publishQueue() {
|
||||
_queuedMessages.value = messageQueue.toList()
|
||||
_queuedMessages.value = snapshotMessageQueue()
|
||||
}
|
||||
|
||||
private fun sendQueuedIfIdle() {
|
||||
if (_isSending.value) return
|
||||
if (messageQueue.isEmpty()) {
|
||||
if (!hasQueuedMessages()) {
|
||||
if (_micEnabled.value) {
|
||||
_statusText.value = "Listening"
|
||||
} else {
|
||||
@@ -315,7 +422,7 @@ class MicCaptureManager(
|
||||
return
|
||||
}
|
||||
|
||||
val next = messageQueue.first()
|
||||
val next = firstQueuedMessage() ?: return
|
||||
_isSending.value = true
|
||||
pendingRunTimeoutJob?.cancel()
|
||||
pendingRunTimeoutJob = null
|
||||
@@ -333,7 +440,7 @@ class MicCaptureManager(
|
||||
if (runId == null) {
|
||||
pendingRunTimeoutJob?.cancel()
|
||||
pendingRunTimeoutJob = null
|
||||
messageQueue.removeFirst()
|
||||
removeFirstQueuedMessage()
|
||||
publishQueue()
|
||||
_isSending.value = false
|
||||
pendingAssistantEntryId = null
|
||||
@@ -379,8 +486,7 @@ class MicCaptureManager(
|
||||
private fun completePendingTurn() {
|
||||
pendingRunTimeoutJob?.cancel()
|
||||
pendingRunTimeoutJob = null
|
||||
if (messageQueue.isNotEmpty()) {
|
||||
messageQueue.removeFirst()
|
||||
if (removeFirstQueuedMessage() != null) {
|
||||
publishQueue()
|
||||
}
|
||||
pendingRunId = null
|
||||
@@ -390,7 +496,7 @@ class MicCaptureManager(
|
||||
}
|
||||
|
||||
private fun queuedWaitingStatus(): String {
|
||||
return "${messageQueue.size} queued · waiting for gateway"
|
||||
return "${queuedMessageCount()} queued · waiting for gateway"
|
||||
}
|
||||
|
||||
private fun appendConversation(
|
||||
|
||||
@@ -0,0 +1,242 @@
|
||||
package ai.openclaw.app.voice
|
||||
|
||||
import android.content.Context
|
||||
import android.media.AudioAttributes
|
||||
import android.media.AudioFormat
|
||||
import android.media.AudioTrack
|
||||
import android.media.MediaPlayer
|
||||
import kotlinx.coroutines.CancellationException
|
||||
import kotlinx.coroutines.CompletableDeferred
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.withContext
|
||||
import java.io.File
|
||||
|
||||
internal class TalkAudioPlayer(
|
||||
private val context: Context,
|
||||
) {
|
||||
private val lock = Any()
|
||||
private var active: ActivePlayback? = null
|
||||
|
||||
suspend fun play(audio: TalkSpeakAudio) {
|
||||
when (val mode = resolvePlaybackMode(audio)) {
|
||||
is TalkPlaybackMode.Pcm -> playPcm(audio.bytes, mode.sampleRate)
|
||||
is TalkPlaybackMode.Compressed -> playCompressed(audio.bytes, mode.fileExtension)
|
||||
}
|
||||
}
|
||||
|
||||
fun stop() {
|
||||
synchronized(lock) {
|
||||
active?.cancel()
|
||||
active = null
|
||||
}
|
||||
}
|
||||
|
||||
internal fun resolvePlaybackMode(audio: TalkSpeakAudio): TalkPlaybackMode {
|
||||
return resolvePlaybackMode(
|
||||
outputFormat = audio.outputFormat,
|
||||
mimeType = audio.mimeType,
|
||||
fileExtension = audio.fileExtension,
|
||||
)
|
||||
}
|
||||
|
||||
companion object {
|
||||
internal fun resolvePlaybackMode(
|
||||
outputFormat: String?,
|
||||
mimeType: String?,
|
||||
fileExtension: String?,
|
||||
): TalkPlaybackMode {
|
||||
val normalizedOutputFormat = outputFormat?.trim()?.lowercase()
|
||||
if (normalizedOutputFormat != null) {
|
||||
val pcmSampleRate = parsePcmSampleRate(normalizedOutputFormat)
|
||||
if (pcmSampleRate != null) {
|
||||
return TalkPlaybackMode.Pcm(sampleRate = pcmSampleRate)
|
||||
}
|
||||
}
|
||||
val normalizedMimeType = mimeType?.trim()?.lowercase()
|
||||
val extension =
|
||||
normalizeExtension(
|
||||
fileExtension ?: inferExtension(outputFormat = normalizedOutputFormat, mimeType = normalizedMimeType),
|
||||
)
|
||||
if (extension != null) {
|
||||
return TalkPlaybackMode.Compressed(fileExtension = extension)
|
||||
}
|
||||
throw IllegalStateException("Unsupported talk audio format")
|
||||
}
|
||||
|
||||
private fun parsePcmSampleRate(outputFormat: String): Int? {
|
||||
return when (outputFormat) {
|
||||
"pcm_16000" -> 16_000
|
||||
"pcm_22050" -> 22_050
|
||||
"pcm_24000" -> 24_000
|
||||
"pcm_44100" -> 44_100
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
private fun inferExtension(outputFormat: String?, mimeType: String?): String? {
|
||||
return when {
|
||||
outputFormat == "mp3" || outputFormat?.startsWith("mp3_") == true || mimeType == "audio/mpeg" -> ".mp3"
|
||||
outputFormat == "opus" || outputFormat?.startsWith("opus_") == true || mimeType == "audio/ogg" -> ".ogg"
|
||||
outputFormat?.endsWith("-wav") == true || mimeType == "audio/wav" -> ".wav"
|
||||
outputFormat?.endsWith("-webm") == true || mimeType == "audio/webm" -> ".webm"
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
private fun normalizeExtension(value: String?): String? {
|
||||
val trimmed = value?.trim()?.lowercase().orEmpty()
|
||||
if (trimmed.isEmpty()) return null
|
||||
return if (trimmed.startsWith(".")) trimmed else ".$trimmed"
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun playPcm(bytes: ByteArray, sampleRate: Int) {
|
||||
withContext(Dispatchers.IO) {
|
||||
val minBufferSize =
|
||||
AudioTrack.getMinBufferSize(
|
||||
sampleRate,
|
||||
AudioFormat.CHANNEL_OUT_MONO,
|
||||
AudioFormat.ENCODING_PCM_16BIT,
|
||||
)
|
||||
if (minBufferSize <= 0) {
|
||||
throw IllegalStateException("AudioTrack buffer unavailable")
|
||||
}
|
||||
val track =
|
||||
AudioTrack.Builder()
|
||||
.setAudioAttributes(
|
||||
AudioAttributes.Builder()
|
||||
.setUsage(AudioAttributes.USAGE_MEDIA)
|
||||
.setContentType(AudioAttributes.CONTENT_TYPE_SPEECH)
|
||||
.build(),
|
||||
)
|
||||
.setAudioFormat(
|
||||
AudioFormat.Builder()
|
||||
.setEncoding(AudioFormat.ENCODING_PCM_16BIT)
|
||||
.setSampleRate(sampleRate)
|
||||
.setChannelMask(AudioFormat.CHANNEL_OUT_MONO)
|
||||
.build(),
|
||||
)
|
||||
.setTransferMode(AudioTrack.MODE_STATIC)
|
||||
.setBufferSizeInBytes(maxOf(minBufferSize, bytes.size))
|
||||
.build()
|
||||
val finished = CompletableDeferred<Unit>()
|
||||
val playback =
|
||||
ActivePlayback(
|
||||
cancel = {
|
||||
finished.completeExceptionally(CancellationException("assistant speech cancelled"))
|
||||
runCatching { track.pause() }
|
||||
runCatching { track.flush() }
|
||||
runCatching { track.stop() }
|
||||
},
|
||||
)
|
||||
register(playback)
|
||||
try {
|
||||
val written = track.write(bytes, 0, bytes.size)
|
||||
if (written != bytes.size) {
|
||||
throw IllegalStateException("AudioTrack write failed")
|
||||
}
|
||||
val totalFrames = bytes.size / 2
|
||||
track.play()
|
||||
while (track.playState == AudioTrack.PLAYSTATE_PLAYING) {
|
||||
if (track.playbackHeadPosition >= totalFrames) {
|
||||
finished.complete(Unit)
|
||||
break
|
||||
}
|
||||
delay(20)
|
||||
}
|
||||
if (!finished.isCompleted) {
|
||||
finished.complete(Unit)
|
||||
}
|
||||
finished.await()
|
||||
} finally {
|
||||
clear(playback)
|
||||
runCatching { track.pause() }
|
||||
runCatching { track.flush() }
|
||||
runCatching { track.stop() }
|
||||
track.release()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun playCompressed(bytes: ByteArray, fileExtension: String) {
|
||||
val tempFile = withContext(Dispatchers.IO) {
|
||||
File.createTempFile("talk-audio-", fileExtension, context.cacheDir).apply {
|
||||
writeBytes(bytes)
|
||||
}
|
||||
}
|
||||
try {
|
||||
val finished = CompletableDeferred<Unit>()
|
||||
val player =
|
||||
withContext(Dispatchers.Main) {
|
||||
MediaPlayer().apply {
|
||||
setAudioAttributes(
|
||||
AudioAttributes.Builder()
|
||||
.setUsage(AudioAttributes.USAGE_MEDIA)
|
||||
.setContentType(AudioAttributes.CONTENT_TYPE_SPEECH)
|
||||
.build(),
|
||||
)
|
||||
setDataSource(tempFile.absolutePath)
|
||||
setOnCompletionListener {
|
||||
finished.complete(Unit)
|
||||
}
|
||||
setOnErrorListener { _, what, extra ->
|
||||
finished.completeExceptionally(IllegalStateException("MediaPlayer error ($what/$extra)"))
|
||||
true
|
||||
}
|
||||
prepare()
|
||||
}
|
||||
}
|
||||
val playback =
|
||||
ActivePlayback(
|
||||
cancel = {
|
||||
finished.completeExceptionally(CancellationException("assistant speech cancelled"))
|
||||
runCatching { player.stop() }
|
||||
},
|
||||
)
|
||||
register(playback)
|
||||
try {
|
||||
withContext(Dispatchers.Main) {
|
||||
player.start()
|
||||
}
|
||||
finished.await()
|
||||
} finally {
|
||||
clear(playback)
|
||||
withContext(Dispatchers.Main) {
|
||||
runCatching { player.stop() }
|
||||
player.release()
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
withContext(Dispatchers.IO) {
|
||||
tempFile.delete()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun register(playback: ActivePlayback) {
|
||||
synchronized(lock) {
|
||||
active?.cancel()
|
||||
active = playback
|
||||
}
|
||||
}
|
||||
|
||||
private fun clear(playback: ActivePlayback) {
|
||||
synchronized(lock) {
|
||||
if (active === playback) {
|
||||
active = null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
internal sealed interface TalkPlaybackMode {
|
||||
data class Pcm(val sampleRate: Int) : TalkPlaybackMode
|
||||
|
||||
data class Compressed(val fileExtension: String) : TalkPlaybackMode
|
||||
}
|
||||
|
||||
private class ActivePlayback(
|
||||
val cancel: () -> Unit,
|
||||
)
|
||||
@@ -14,19 +14,21 @@ import android.os.SystemClock
|
||||
import android.speech.RecognitionListener
|
||||
import android.speech.RecognizerIntent
|
||||
import android.speech.SpeechRecognizer
|
||||
import android.util.Log
|
||||
import android.speech.tts.TextToSpeech
|
||||
import android.speech.tts.UtteranceProgressListener
|
||||
import android.util.Log
|
||||
import androidx.core.content.ContextCompat
|
||||
import ai.openclaw.app.gateway.GatewaySession
|
||||
import java.util.Locale
|
||||
import java.util.UUID
|
||||
import java.util.concurrent.atomic.AtomicLong
|
||||
import kotlin.coroutines.coroutineContext
|
||||
import kotlinx.coroutines.CancellationException
|
||||
import kotlinx.coroutines.CompletableDeferred
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.NonCancellable
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.ensureActive
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
@@ -46,6 +48,8 @@ class TalkModeManager(
|
||||
private val session: GatewaySession,
|
||||
private val supportsChatSubscribe: Boolean,
|
||||
private val isConnected: () -> Boolean,
|
||||
private val onBeforeSpeak: suspend () -> Unit = {},
|
||||
private val onAfterSpeak: suspend () -> Unit = {},
|
||||
) {
|
||||
companion object {
|
||||
private const val tag = "TalkMode"
|
||||
@@ -57,6 +61,8 @@ class TalkModeManager(
|
||||
|
||||
private val mainHandler = Handler(Looper.getMainLooper())
|
||||
private val json = Json { ignoreUnknownKeys = true }
|
||||
private val talkSpeakClient = TalkSpeakClient(session = session, json = json)
|
||||
private val talkAudioPlayer = TalkAudioPlayer(context)
|
||||
|
||||
private val _isEnabled = MutableStateFlow(false)
|
||||
val isEnabled: StateFlow<Boolean> = _isEnabled
|
||||
@@ -101,6 +107,7 @@ class TalkModeManager(
|
||||
private val playbackGeneration = AtomicLong(0L)
|
||||
|
||||
private var ttsJob: Job? = null
|
||||
private val ttsJobLock = Any()
|
||||
private val ttsLock = Any()
|
||||
private var textToSpeech: TextToSpeech? = null
|
||||
private var textToSpeechInit: CompletableDeferred<TextToSpeech>? = null
|
||||
@@ -163,8 +170,11 @@ class TalkModeManager(
|
||||
?: waitForAssistantText(session, startedAt, if (ok) 12_000 else 25_000)
|
||||
if (!assistant.isNullOrBlank()) {
|
||||
val playbackToken = playbackGeneration.incrementAndGet()
|
||||
cancelActivePlayback()
|
||||
_statusText.value = "Speaking…"
|
||||
playAssistant(assistant, playbackToken)
|
||||
runPlaybackSession(playbackToken) {
|
||||
playAssistant(assistant, playbackToken)
|
||||
}
|
||||
} else {
|
||||
_statusText.value = "No reply"
|
||||
}
|
||||
@@ -180,14 +190,12 @@ class TalkModeManager(
|
||||
|
||||
fun playTtsForText(text: String) {
|
||||
val playbackToken = playbackGeneration.incrementAndGet()
|
||||
ttsJob?.cancel()
|
||||
ttsJob = scope.launch {
|
||||
cancelActivePlayback()
|
||||
scope.launch {
|
||||
reloadConfig()
|
||||
ensurePlaybackActive(playbackToken)
|
||||
_isSpeaking.value = true
|
||||
_statusText.value = "Speaking…"
|
||||
playAssistant(text, playbackToken)
|
||||
ttsJob = null
|
||||
runPlaybackSession(playbackToken) {
|
||||
playAssistant(text, playbackToken)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,7 +266,6 @@ class TalkModeManager(
|
||||
if (playbackEnabled == enabled) return
|
||||
playbackEnabled = enabled
|
||||
if (!enabled) {
|
||||
playbackGeneration.incrementAndGet()
|
||||
stopSpeaking()
|
||||
}
|
||||
}
|
||||
@@ -270,10 +277,11 @@ class TalkModeManager(
|
||||
suspend fun speakAssistantReply(text: String) {
|
||||
if (!playbackEnabled) return
|
||||
val playbackToken = playbackGeneration.incrementAndGet()
|
||||
stopSpeaking(resetInterrupt = false)
|
||||
cancelActivePlayback()
|
||||
ensureConfigLoaded()
|
||||
ensurePlaybackActive(playbackToken)
|
||||
playAssistant(text, playbackToken)
|
||||
runPlaybackSession(playbackToken) {
|
||||
playAssistant(text, playbackToken)
|
||||
}
|
||||
}
|
||||
|
||||
private fun start() {
|
||||
@@ -483,9 +491,10 @@ class TalkModeManager(
|
||||
}
|
||||
Log.d(tag, "assistant text ok chars=${assistant.length}")
|
||||
val playbackToken = playbackGeneration.incrementAndGet()
|
||||
stopSpeaking(resetInterrupt = false)
|
||||
ensurePlaybackActive(playbackToken)
|
||||
playAssistant(assistant, playbackToken)
|
||||
cancelActivePlayback()
|
||||
runPlaybackSession(playbackToken) {
|
||||
playAssistant(assistant, playbackToken)
|
||||
}
|
||||
} catch (err: Throwable) {
|
||||
if (err is CancellationException) {
|
||||
Log.d(tag, "finalize speech cancelled")
|
||||
@@ -655,22 +664,87 @@ class TalkModeManager(
|
||||
requestAudioFocusForTts()
|
||||
|
||||
try {
|
||||
val ttsStarted = SystemClock.elapsedRealtime()
|
||||
speakWithSystemTts(cleaned, directive, playbackToken)
|
||||
Log.d(tag, "system tts ok durMs=${SystemClock.elapsedRealtime() - ttsStarted}")
|
||||
val started = SystemClock.elapsedRealtime()
|
||||
when (val result = talkSpeakClient.synthesize(text = cleaned, directive = directive)) {
|
||||
is TalkSpeakResult.Success -> {
|
||||
ensurePlaybackActive(playbackToken)
|
||||
talkAudioPlayer.play(result.audio)
|
||||
ensurePlaybackActive(playbackToken)
|
||||
Log.d(tag, "talk.speak ok durMs=${SystemClock.elapsedRealtime() - started}")
|
||||
}
|
||||
is TalkSpeakResult.FallbackToLocal -> {
|
||||
Log.d(tag, "talk.speak unavailable; using local TTS: ${result.message}")
|
||||
speakWithSystemTts(cleaned, directive, playbackToken)
|
||||
Log.d(tag, "system tts ok durMs=${SystemClock.elapsedRealtime() - started}")
|
||||
}
|
||||
is TalkSpeakResult.Failure -> {
|
||||
throw IllegalStateException(result.message)
|
||||
}
|
||||
}
|
||||
} catch (err: Throwable) {
|
||||
if (isPlaybackCancelled(err, playbackToken)) {
|
||||
Log.d(tag, "assistant speech cancelled")
|
||||
return
|
||||
}
|
||||
_statusText.value = "Speak failed: ${err.message ?: err::class.simpleName}"
|
||||
Log.w(tag, "system tts failed: ${err.message ?: err::class.simpleName}")
|
||||
Log.w(tag, "talk playback failed: ${err.message ?: err::class.simpleName}")
|
||||
} finally {
|
||||
|
||||
_isSpeaking.value = false
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun runPlaybackSession(
|
||||
playbackToken: Long,
|
||||
block: suspend () -> Unit,
|
||||
) {
|
||||
val currentJob = coroutineContext[Job]
|
||||
var shouldResumeAfterSpeak = false
|
||||
try {
|
||||
val claimedPlayback =
|
||||
synchronized(ttsJobLock) {
|
||||
if (!playbackEnabled || playbackToken != playbackGeneration.get()) {
|
||||
false
|
||||
} else {
|
||||
ttsJob = currentJob
|
||||
true
|
||||
}
|
||||
}
|
||||
if (!claimedPlayback) {
|
||||
ensurePlaybackActive(playbackToken)
|
||||
return
|
||||
}
|
||||
ensurePlaybackActive(playbackToken)
|
||||
shouldResumeAfterSpeak = true
|
||||
onBeforeSpeak()
|
||||
ensurePlaybackActive(playbackToken)
|
||||
_isSpeaking.value = true
|
||||
_statusText.value = "Speaking…"
|
||||
block()
|
||||
} finally {
|
||||
synchronized(ttsJobLock) {
|
||||
if (ttsJob === currentJob) {
|
||||
ttsJob = null
|
||||
}
|
||||
}
|
||||
_isSpeaking.value = false
|
||||
if (shouldResumeAfterSpeak) {
|
||||
withContext(NonCancellable) {
|
||||
onAfterSpeak()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun cancelActivePlayback() {
|
||||
val activeJob =
|
||||
synchronized(ttsJobLock) {
|
||||
ttsJob
|
||||
}
|
||||
activeJob?.cancel()
|
||||
talkAudioPlayer.stop()
|
||||
stopTextToSpeechPlayback()
|
||||
}
|
||||
|
||||
private suspend fun speakWithSystemTts(text: String, directive: TalkDirective?, playbackToken: Long) {
|
||||
ensurePlaybackActive(playbackToken)
|
||||
val engine = ensureTextToSpeech()
|
||||
@@ -755,15 +829,16 @@ class TalkModeManager(
|
||||
}
|
||||
|
||||
private fun stopSpeaking(resetInterrupt: Boolean = true) {
|
||||
playbackGeneration.incrementAndGet()
|
||||
if (!_isSpeaking.value) {
|
||||
stopTextToSpeechPlayback()
|
||||
cancelActivePlayback()
|
||||
abandonAudioFocus()
|
||||
return
|
||||
}
|
||||
if (resetInterrupt) {
|
||||
lastInterruptedAtSeconds = null
|
||||
}
|
||||
stopTextToSpeechPlayback()
|
||||
cancelActivePlayback()
|
||||
_isSpeaking.value = false
|
||||
abandonAudioFocus()
|
||||
}
|
||||
|
||||
@@ -0,0 +1,143 @@
|
||||
package ai.openclaw.app.voice
|
||||
|
||||
import ai.openclaw.app.gateway.GatewaySession
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.encodeToString
|
||||
import kotlinx.serialization.json.Json
|
||||
|
||||
internal data class TalkSpeakAudio(
|
||||
val bytes: ByteArray,
|
||||
val provider: String,
|
||||
val outputFormat: String?,
|
||||
val voiceCompatible: Boolean?,
|
||||
val mimeType: String?,
|
||||
val fileExtension: String?,
|
||||
)
|
||||
|
||||
internal sealed interface TalkSpeakResult {
|
||||
data class Success(val audio: TalkSpeakAudio) : TalkSpeakResult
|
||||
|
||||
data class FallbackToLocal(val message: String) : TalkSpeakResult
|
||||
|
||||
data class Failure(val message: String) : TalkSpeakResult
|
||||
}
|
||||
|
||||
internal class TalkSpeakClient(
|
||||
private val session: GatewaySession? = null,
|
||||
private val json: Json = Json { ignoreUnknownKeys = true },
|
||||
private val requestDetailed: (suspend (String, String, Long) -> GatewaySession.RpcResult)? = null,
|
||||
) {
|
||||
suspend fun synthesize(text: String, directive: TalkDirective?): TalkSpeakResult {
|
||||
val response =
|
||||
try {
|
||||
performRequest(
|
||||
method = "talk.speak",
|
||||
paramsJson = json.encodeToString(TalkSpeakRequest.from(text = text, directive = directive)),
|
||||
timeoutMs = 45_000,
|
||||
)
|
||||
} catch (err: Throwable) {
|
||||
return TalkSpeakResult.Failure(err.message ?: "talk.speak request failed")
|
||||
}
|
||||
if (!response.ok) {
|
||||
val error = response.error
|
||||
val message = error?.message ?: "talk.speak request failed"
|
||||
return if (isFallbackEligible(error)) {
|
||||
TalkSpeakResult.FallbackToLocal(message)
|
||||
} else {
|
||||
TalkSpeakResult.Failure(message)
|
||||
}
|
||||
}
|
||||
val payload =
|
||||
try {
|
||||
json.decodeFromString<TalkSpeakResponse>(response.payloadJson ?: "")
|
||||
} catch (err: Throwable) {
|
||||
return TalkSpeakResult.Failure(err.message ?: "talk.speak payload invalid")
|
||||
}
|
||||
val bytes =
|
||||
try {
|
||||
android.util.Base64.decode(payload.audioBase64, android.util.Base64.DEFAULT)
|
||||
} catch (err: Throwable) {
|
||||
return TalkSpeakResult.Failure(err.message ?: "talk.speak audio decode failed")
|
||||
}
|
||||
if (bytes.isEmpty()) {
|
||||
return TalkSpeakResult.Failure("talk.speak returned empty audio")
|
||||
}
|
||||
return TalkSpeakResult.Success(
|
||||
TalkSpeakAudio(
|
||||
bytes = bytes,
|
||||
provider = payload.provider,
|
||||
outputFormat = payload.outputFormat,
|
||||
voiceCompatible = payload.voiceCompatible,
|
||||
mimeType = payload.mimeType,
|
||||
fileExtension = payload.fileExtension,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
private fun isFallbackEligible(error: GatewaySession.ErrorShape?): Boolean {
|
||||
val reason = error?.details?.reason
|
||||
if (reason == null) return true
|
||||
return reason == "talk_unconfigured" ||
|
||||
reason == "talk_provider_unsupported" ||
|
||||
reason == "method_unavailable"
|
||||
}
|
||||
|
||||
private suspend fun performRequest(
|
||||
method: String,
|
||||
paramsJson: String,
|
||||
timeoutMs: Long,
|
||||
): GatewaySession.RpcResult {
|
||||
requestDetailed?.let { return it(method, paramsJson, timeoutMs) }
|
||||
val activeSession = session ?: throw IllegalStateException("session missing")
|
||||
return activeSession.requestDetailed(method = method, paramsJson = paramsJson, timeoutMs = timeoutMs)
|
||||
}
|
||||
}
|
||||
|
||||
@Serializable
|
||||
internal data class TalkSpeakRequest(
|
||||
val text: String,
|
||||
val voiceId: String? = null,
|
||||
val modelId: String? = null,
|
||||
val outputFormat: String? = null,
|
||||
val speed: Double? = null,
|
||||
val rateWpm: Int? = null,
|
||||
val stability: Double? = null,
|
||||
val similarity: Double? = null,
|
||||
val style: Double? = null,
|
||||
val speakerBoost: Boolean? = null,
|
||||
val seed: Long? = null,
|
||||
val normalize: String? = null,
|
||||
val language: String? = null,
|
||||
val latencyTier: Int? = null,
|
||||
) {
|
||||
companion object {
|
||||
fun from(text: String, directive: TalkDirective?): TalkSpeakRequest {
|
||||
return TalkSpeakRequest(
|
||||
text = text,
|
||||
voiceId = directive?.voiceId,
|
||||
modelId = directive?.modelId,
|
||||
outputFormat = directive?.outputFormat,
|
||||
speed = directive?.speed,
|
||||
rateWpm = directive?.rateWpm,
|
||||
stability = directive?.stability,
|
||||
similarity = directive?.similarity,
|
||||
style = directive?.style,
|
||||
speakerBoost = directive?.speakerBoost,
|
||||
seed = directive?.seed,
|
||||
normalize = directive?.normalize,
|
||||
language = directive?.language,
|
||||
latencyTier = directive?.latencyTier,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Serializable
|
||||
private data class TalkSpeakResponse(
|
||||
val audioBase64: String,
|
||||
val provider: String,
|
||||
val outputFormat: String? = null,
|
||||
val voiceCompatible: Boolean? = null,
|
||||
val mimeType: String? = null,
|
||||
val fileExtension: String? = null,
|
||||
)
|
||||
@@ -21,17 +21,72 @@ import java.util.UUID
|
||||
@Config(sdk = [34])
|
||||
class GatewayBootstrapAuthTest {
|
||||
@Test
|
||||
fun connectsOperatorSessionWhenBootstrapAuthExists() {
|
||||
assertTrue(shouldConnectOperatorSession(token = "", bootstrapToken = "bootstrap-1", password = "", storedOperatorToken = ""))
|
||||
assertTrue(shouldConnectOperatorSession(token = null, bootstrapToken = "bootstrap-1", password = null, storedOperatorToken = null))
|
||||
fun skipsOperatorSessionWhenOnlyBootstrapAuthExists() {
|
||||
assertFalse(
|
||||
shouldConnectOperatorSession(
|
||||
NodeRuntime.GatewayConnectAuth(token = "", bootstrapToken = "bootstrap-1", password = ""),
|
||||
storedOperatorToken = "",
|
||||
),
|
||||
)
|
||||
assertFalse(
|
||||
shouldConnectOperatorSession(
|
||||
NodeRuntime.GatewayConnectAuth(token = null, bootstrapToken = "bootstrap-1", password = null),
|
||||
storedOperatorToken = null,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun skipsOperatorSessionOnlyWhenNoSharedBootstrapOrStoredAuthExists() {
|
||||
assertTrue(shouldConnectOperatorSession(token = "shared-token", bootstrapToken = "bootstrap-1", password = null, storedOperatorToken = null))
|
||||
assertTrue(shouldConnectOperatorSession(token = null, bootstrapToken = "bootstrap-1", password = "shared-password", storedOperatorToken = null))
|
||||
assertTrue(shouldConnectOperatorSession(token = null, bootstrapToken = null, password = null, storedOperatorToken = "stored-token"))
|
||||
assertFalse(shouldConnectOperatorSession(token = null, bootstrapToken = "", password = null, storedOperatorToken = null))
|
||||
fun connectsOperatorSessionWhenSharedPasswordOrStoredAuthExists() {
|
||||
assertTrue(
|
||||
shouldConnectOperatorSession(
|
||||
NodeRuntime.GatewayConnectAuth(token = "shared-token", bootstrapToken = "bootstrap-1", password = null),
|
||||
storedOperatorToken = null,
|
||||
),
|
||||
)
|
||||
assertTrue(
|
||||
shouldConnectOperatorSession(
|
||||
NodeRuntime.GatewayConnectAuth(token = null, bootstrapToken = "bootstrap-1", password = "shared-password"),
|
||||
storedOperatorToken = null,
|
||||
),
|
||||
)
|
||||
assertTrue(
|
||||
shouldConnectOperatorSession(
|
||||
NodeRuntime.GatewayConnectAuth(token = null, bootstrapToken = "bootstrap-1", password = null),
|
||||
storedOperatorToken = "stored-token",
|
||||
),
|
||||
)
|
||||
assertFalse(
|
||||
shouldConnectOperatorSession(
|
||||
NodeRuntime.GatewayConnectAuth(token = null, bootstrapToken = "", password = null),
|
||||
storedOperatorToken = null,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun resolveOperatorSessionConnectAuthUsesStoredTokenPathAfterBootstrapHandoff() {
|
||||
val resolved =
|
||||
resolveOperatorSessionConnectAuth(
|
||||
auth = NodeRuntime.GatewayConnectAuth(token = null, bootstrapToken = "bootstrap-1", password = null),
|
||||
storedOperatorToken = "stored-token",
|
||||
)
|
||||
|
||||
assertEquals(NodeRuntime.GatewayConnectAuth(token = null, bootstrapToken = null, password = null), resolved)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun resolveOperatorSessionConnectAuthPrefersExplicitSharedAuth() {
|
||||
val resolved =
|
||||
resolveOperatorSessionConnectAuth(
|
||||
auth = NodeRuntime.GatewayConnectAuth(token = "shared-token", bootstrapToken = "bootstrap-1", password = "shared-password"),
|
||||
storedOperatorToken = "stored-token",
|
||||
)
|
||||
|
||||
assertEquals(
|
||||
NodeRuntime.GatewayConnectAuth(token = "shared-token", bootstrapToken = null, password = null),
|
||||
resolved,
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -97,7 +152,7 @@ class GatewayBootstrapAuthTest {
|
||||
|
||||
assertEquals("fp-1", prefs.loadGatewayTlsFingerprint(endpoint.stableId))
|
||||
assertEquals("setup-bootstrap-token", desiredBootstrapToken(runtime, "nodeSession"))
|
||||
assertEquals("setup-bootstrap-token", desiredBootstrapToken(runtime, "operatorSession"))
|
||||
assertNull(desiredBootstrapToken(runtime, "operatorSession"))
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
package ai.openclaw.app.gateway
|
||||
|
||||
import ai.openclaw.app.SecurePrefs
|
||||
import android.content.Context
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertNotNull
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.RuntimeEnvironment
|
||||
import org.robolectric.annotation.Config
|
||||
import java.util.UUID
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
@Config(sdk = [34])
|
||||
class DeviceAuthStoreTest {
|
||||
@Test
|
||||
fun saveTokenPersistsNormalizedScopesMetadata() {
|
||||
val app = RuntimeEnvironment.getApplication()
|
||||
val securePrefs =
|
||||
app.getSharedPreferences(
|
||||
"openclaw.node.secure.test.${UUID.randomUUID()}",
|
||||
Context.MODE_PRIVATE,
|
||||
)
|
||||
val prefs = SecurePrefs(app, securePrefsOverride = securePrefs)
|
||||
val store = DeviceAuthStore(prefs)
|
||||
|
||||
store.saveToken(
|
||||
deviceId = " Device-1 ",
|
||||
role = " Operator ",
|
||||
token = " operator-token ",
|
||||
scopes = listOf("operator.write", "operator.read", "operator.write", " "),
|
||||
)
|
||||
|
||||
val entry = store.loadEntry("device-1", "operator")
|
||||
assertNotNull(entry)
|
||||
assertEquals("operator-token", entry?.token)
|
||||
assertEquals("operator", entry?.role)
|
||||
assertEquals(listOf("operator.read", "operator.write"), entry?.scopes)
|
||||
assertTrue((entry?.updatedAtMs ?: 0L) > 0L)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun loadEntryReadsLegacyTokenWithoutMetadata() {
|
||||
val app = RuntimeEnvironment.getApplication()
|
||||
val securePrefs =
|
||||
app.getSharedPreferences(
|
||||
"openclaw.node.secure.test.${UUID.randomUUID()}",
|
||||
Context.MODE_PRIVATE,
|
||||
)
|
||||
val prefs = SecurePrefs(app, securePrefsOverride = securePrefs)
|
||||
prefs.putString("gateway.deviceToken.device-1.operator", "legacy-token")
|
||||
val store = DeviceAuthStore(prefs)
|
||||
|
||||
val entry = store.loadEntry("device-1", "operator")
|
||||
assertNotNull(entry)
|
||||
assertEquals("legacy-token", entry?.token)
|
||||
assertEquals("operator", entry?.role)
|
||||
assertEquals(emptyList<String>(), entry?.scopes)
|
||||
assertEquals(0L, entry?.updatedAtMs)
|
||||
}
|
||||
}
|
||||
@@ -35,12 +35,18 @@ private const val CONNECT_CHALLENGE_FRAME =
|
||||
"""{"type":"event","event":"connect.challenge","payload":{"nonce":"android-test-nonce"}}"""
|
||||
|
||||
private class InMemoryDeviceAuthStore : DeviceAuthTokenStore {
|
||||
private val tokens = mutableMapOf<String, String>()
|
||||
private val tokens = mutableMapOf<String, DeviceAuthEntry>()
|
||||
|
||||
override fun loadToken(deviceId: String, role: String): String? = tokens["${deviceId.trim()}|${role.trim()}"]?.trim()?.takeIf { it.isNotEmpty() }
|
||||
override fun loadEntry(deviceId: String, role: String): DeviceAuthEntry? = tokens["${deviceId.trim()}|${role.trim()}"]
|
||||
|
||||
override fun saveToken(deviceId: String, role: String, token: String) {
|
||||
tokens["${deviceId.trim()}|${role.trim()}"] = token.trim()
|
||||
override fun saveToken(deviceId: String, role: String, token: String, scopes: List<String>) {
|
||||
tokens["${deviceId.trim()}|${role.trim()}"] =
|
||||
DeviceAuthEntry(
|
||||
token = token.trim(),
|
||||
role = role.trim(),
|
||||
scopes = scopes,
|
||||
updatedAtMs = System.currentTimeMillis(),
|
||||
)
|
||||
}
|
||||
|
||||
override fun clearToken(deviceId: String, role: String) {
|
||||
@@ -213,6 +219,144 @@ class GatewaySessionInvokeTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun connect_storesPrimaryDeviceTokenFromSuccessfulSharedTokenConnect() = runBlocking {
|
||||
val json = testJson()
|
||||
val connected = CompletableDeferred<Unit>()
|
||||
val lastDisconnect = AtomicReference("")
|
||||
val server =
|
||||
startGatewayServer(json) { webSocket, id, method, _ ->
|
||||
when (method) {
|
||||
"connect" -> {
|
||||
webSocket.send(
|
||||
connectResponseFrame(
|
||||
id,
|
||||
authJson = """{"deviceToken":"shared-node-token","role":"node","scopes":[]}""",
|
||||
),
|
||||
)
|
||||
webSocket.close(1000, "done")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val harness =
|
||||
createNodeHarness(
|
||||
connected = connected,
|
||||
lastDisconnect = lastDisconnect,
|
||||
) { GatewaySession.InvokeResult.ok("""{"handled":true}""") }
|
||||
|
||||
try {
|
||||
connectNodeSession(
|
||||
session = harness.session,
|
||||
port = server.port,
|
||||
token = "shared-auth-token",
|
||||
bootstrapToken = null,
|
||||
)
|
||||
awaitConnectedOrThrow(connected, lastDisconnect, server)
|
||||
|
||||
val deviceId = DeviceIdentityStore(RuntimeEnvironment.getApplication()).loadOrCreate().deviceId
|
||||
assertEquals("shared-node-token", harness.deviceAuthStore.loadToken(deviceId, "node"))
|
||||
assertNull(harness.deviceAuthStore.loadToken(deviceId, "operator"))
|
||||
} finally {
|
||||
shutdownHarness(harness, server)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun bootstrapConnect_storesAdditionalBoundedDeviceTokensOnTrustedTransport() = runBlocking {
|
||||
val json = testJson()
|
||||
val connected = CompletableDeferred<Unit>()
|
||||
val lastDisconnect = AtomicReference("")
|
||||
val server =
|
||||
startGatewayServer(json) { webSocket, id, method, _ ->
|
||||
when (method) {
|
||||
"connect" -> {
|
||||
webSocket.send(
|
||||
connectResponseFrame(
|
||||
id,
|
||||
authJson =
|
||||
"""{"deviceToken":"bootstrap-node-token","role":"node","scopes":[],"deviceTokens":[{"deviceToken":"bootstrap-operator-token","role":"operator","scopes":["operator.admin","operator.approvals","operator.read","operator.talk.secrets","operator.write"]}]}""",
|
||||
),
|
||||
)
|
||||
webSocket.close(1000, "done")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val harness =
|
||||
createNodeHarness(
|
||||
connected = connected,
|
||||
lastDisconnect = lastDisconnect,
|
||||
) { GatewaySession.InvokeResult.ok("""{"handled":true}""") }
|
||||
|
||||
try {
|
||||
connectNodeSession(
|
||||
session = harness.session,
|
||||
port = server.port,
|
||||
token = null,
|
||||
bootstrapToken = "bootstrap-token",
|
||||
)
|
||||
awaitConnectedOrThrow(connected, lastDisconnect, server)
|
||||
|
||||
val deviceId = DeviceIdentityStore(RuntimeEnvironment.getApplication()).loadOrCreate().deviceId
|
||||
val nodeEntry = harness.deviceAuthStore.loadEntry(deviceId, "node")
|
||||
val operatorEntry = harness.deviceAuthStore.loadEntry(deviceId, "operator")
|
||||
assertEquals("bootstrap-node-token", nodeEntry?.token)
|
||||
assertEquals(emptyList<String>(), nodeEntry?.scopes)
|
||||
assertEquals("bootstrap-operator-token", operatorEntry?.token)
|
||||
assertEquals(
|
||||
listOf("operator.approvals", "operator.read", "operator.talk.secrets", "operator.write"),
|
||||
operatorEntry?.scopes,
|
||||
)
|
||||
} finally {
|
||||
shutdownHarness(harness, server)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun nonBootstrapConnect_ignoresAdditionalBootstrapDeviceTokens() = runBlocking {
|
||||
val json = testJson()
|
||||
val connected = CompletableDeferred<Unit>()
|
||||
val lastDisconnect = AtomicReference("")
|
||||
val server =
|
||||
startGatewayServer(json) { webSocket, id, method, _ ->
|
||||
when (method) {
|
||||
"connect" -> {
|
||||
webSocket.send(
|
||||
connectResponseFrame(
|
||||
id,
|
||||
authJson =
|
||||
"""{"deviceToken":"shared-node-token","role":"node","scopes":[],"deviceTokens":[{"deviceToken":"shared-operator-token","role":"operator","scopes":["operator.approvals","operator.read"]}]}""",
|
||||
),
|
||||
)
|
||||
webSocket.close(1000, "done")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val harness =
|
||||
createNodeHarness(
|
||||
connected = connected,
|
||||
lastDisconnect = lastDisconnect,
|
||||
) { GatewaySession.InvokeResult.ok("""{"handled":true}""") }
|
||||
|
||||
try {
|
||||
connectNodeSession(
|
||||
session = harness.session,
|
||||
port = server.port,
|
||||
token = "shared-auth-token",
|
||||
bootstrapToken = null,
|
||||
)
|
||||
awaitConnectedOrThrow(connected, lastDisconnect, server)
|
||||
|
||||
val deviceId = DeviceIdentityStore(RuntimeEnvironment.getApplication()).loadOrCreate().deviceId
|
||||
assertEquals("shared-node-token", harness.deviceAuthStore.loadToken(deviceId, "node"))
|
||||
assertNull(harness.deviceAuthStore.loadToken(deviceId, "operator"))
|
||||
} finally {
|
||||
shutdownHarness(harness, server)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun nodeInvokeRequest_roundTripsInvokeResult() = runBlocking {
|
||||
val handshakeOrigin = AtomicReference<String?>(null)
|
||||
@@ -470,9 +614,14 @@ class GatewaySessionInvokeTest {
|
||||
}
|
||||
}
|
||||
|
||||
private fun connectResponseFrame(id: String, canvasHostUrl: String? = null): String {
|
||||
private fun connectResponseFrame(
|
||||
id: String,
|
||||
canvasHostUrl: String? = null,
|
||||
authJson: String? = null,
|
||||
): String {
|
||||
val canvas = canvasHostUrl?.let { "\"canvasHostUrl\":\"$it\"," } ?: ""
|
||||
return """{"type":"res","id":"$id","ok":true,"payload":{$canvas"snapshot":{"sessionDefaults":{"mainSessionKey":"main"}}}}"""
|
||||
val auth = authJson?.let { "\"auth\":$it," } ?: ""
|
||||
return """{"type":"res","id":"$id","ok":true,"payload":{$canvas$auth"snapshot":{"sessionDefaults":{"mainSessionKey":"main"}}}}"""
|
||||
}
|
||||
|
||||
private fun startGatewayServer(
|
||||
|
||||
@@ -39,4 +39,34 @@ class CanvasActionTrustTest {
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun acceptsFragmentOnlyDifferenceForTrustedA2uiPage() {
|
||||
assertTrue(
|
||||
CanvasActionTrust.isTrustedCanvasActionUrl(
|
||||
rawUrl = "https://canvas.example.com:9443/__openclaw__/cap/token/__openclaw__/a2ui/?platform=android#step2",
|
||||
trustedA2uiUrls = listOf("https://canvas.example.com:9443/__openclaw__/cap/token/__openclaw__/a2ui/?platform=android"),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun rejectsQueryMismatchOnTrustedOriginAndPath() {
|
||||
assertFalse(
|
||||
CanvasActionTrust.isTrustedCanvasActionUrl(
|
||||
rawUrl = "https://canvas.example.com:9443/__openclaw__/cap/token/__openclaw__/a2ui/?platform=ios",
|
||||
trustedA2uiUrls = listOf("https://canvas.example.com:9443/__openclaw__/cap/token/__openclaw__/a2ui/?platform=android"),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun rejectsDescendantPathUnderTrustedA2uiRoot() {
|
||||
assertFalse(
|
||||
CanvasActionTrust.isTrustedCanvasActionUrl(
|
||||
rawUrl = "https://canvas.example.com:9443/__openclaw__/cap/token/__openclaw__/a2ui/child/index.html?platform=android",
|
||||
trustedA2uiUrls = listOf("https://canvas.example.com:9443/__openclaw__/cap/token/__openclaw__/a2ui/?platform=android"),
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ class ConnectionManagerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
fun resolveTlsParamsForEndpoint_manualPrivateLanRequiresTlsWhenToggleIsOff() {
|
||||
fun resolveTlsParamsForEndpoint_manualPrivateLanCanStayCleartextWhenToggleIsOff() {
|
||||
val endpoint = GatewayEndpoint.manual(host = "192.168.1.20", port = 18789)
|
||||
|
||||
val params =
|
||||
@@ -118,9 +118,7 @@ class ConnectionManagerTest {
|
||||
manualTlsEnabled = false,
|
||||
)
|
||||
|
||||
assertEquals(true, params?.required)
|
||||
assertNull(params?.expectedFingerprint)
|
||||
assertEquals(false, params?.allowTOFU)
|
||||
assertNull(params)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -148,7 +146,7 @@ class ConnectionManagerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
fun resolveTlsParamsForEndpoint_discoveryPrivateLanWithoutHintsRequiresTls() {
|
||||
fun resolveTlsParamsForEndpoint_discoveryPrivateLanWithoutHintsCanStayCleartext() {
|
||||
val endpoint =
|
||||
GatewayEndpoint(
|
||||
stableId = "_openclaw-gw._tcp.|local.|Test",
|
||||
@@ -166,9 +164,7 @@ class ConnectionManagerTest {
|
||||
manualTlsEnabled = false,
|
||||
)
|
||||
|
||||
assertEquals(true, params?.required)
|
||||
assertNull(params?.expectedFingerprint)
|
||||
assertEquals(false, params?.allowTOFU)
|
||||
assertNull(params)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package ai.openclaw.app.ui
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
class CanvasA2UIActionBridgeTest {
|
||||
@Test
|
||||
fun forwardsTrimmedPayloadFromTrustedPage() {
|
||||
val forwarded = mutableListOf<String>()
|
||||
val bridge =
|
||||
CanvasA2UIActionBridge(
|
||||
isTrustedPage = { true },
|
||||
onMessage = { forwarded += it },
|
||||
)
|
||||
|
||||
bridge.postMessage(" {\"ok\":true} ")
|
||||
|
||||
assertEquals(listOf("{\"ok\":true}"), forwarded)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun rejectsPayloadFromUntrustedPage() {
|
||||
val forwarded = mutableListOf<String>()
|
||||
val bridge =
|
||||
CanvasA2UIActionBridge(
|
||||
isTrustedPage = { false },
|
||||
onMessage = { forwarded += it },
|
||||
)
|
||||
|
||||
bridge.postMessage("{\"ok\":true}")
|
||||
|
||||
assertTrue(forwarded.isEmpty())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun rejectsBlankPayloadBeforeForwarding() {
|
||||
val forwarded = mutableListOf<String>()
|
||||
val bridge =
|
||||
CanvasA2UIActionBridge(
|
||||
isTrustedPage = { true },
|
||||
onMessage = { forwarded += it },
|
||||
)
|
||||
|
||||
bridge.postMessage(" ")
|
||||
bridge.postMessage(null)
|
||||
|
||||
assertTrue(forwarded.isEmpty())
|
||||
}
|
||||
}
|
||||
@@ -290,11 +290,19 @@ class GatewayConfigResolverTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
fun parseGatewayEndpointResultFlagsInsecureLanCleartextGateway() {
|
||||
fun parseGatewayEndpointResultAcceptsLanCleartextGateway() {
|
||||
val parsed = parseGatewayEndpointResult("ws://192.168.1.20:18789")
|
||||
|
||||
assertNull(parsed.config)
|
||||
assertEquals(GatewayEndpointValidationError.INSECURE_REMOTE_URL, parsed.error)
|
||||
assertEquals(
|
||||
GatewayEndpointConfig(
|
||||
host = "192.168.1.20",
|
||||
port = 18789,
|
||||
tls = false,
|
||||
displayUrl = "http://192.168.1.20:18789",
|
||||
),
|
||||
parsed.config,
|
||||
)
|
||||
assertNull(parsed.error)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package ai.openclaw.app.voice
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
class TalkAudioPlayerTest {
|
||||
@Test
|
||||
fun resolvesPcmPlaybackFromOutputFormat() {
|
||||
val mode =
|
||||
TalkAudioPlayer.resolvePlaybackMode(
|
||||
outputFormat = "pcm_24000",
|
||||
mimeType = null,
|
||||
fileExtension = null,
|
||||
)
|
||||
|
||||
assertEquals(TalkPlaybackMode.Pcm(sampleRate = 24_000), mode)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun resolvesCompressedPlaybackFromMimeType() {
|
||||
val mode =
|
||||
TalkAudioPlayer.resolvePlaybackMode(
|
||||
outputFormat = null,
|
||||
mimeType = "audio/mpeg",
|
||||
fileExtension = null,
|
||||
)
|
||||
|
||||
assertEquals(TalkPlaybackMode.Compressed(fileExtension = ".mp3"), mode)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun preservesProvidedExtensionForCompressedPlayback() {
|
||||
val mode =
|
||||
TalkAudioPlayer.resolvePlaybackMode(
|
||||
outputFormat = null,
|
||||
mimeType = "audio/webm",
|
||||
fileExtension = "webm",
|
||||
)
|
||||
|
||||
assertTrue(mode is TalkPlaybackMode.Compressed)
|
||||
assertEquals(".webm", (mode as TalkPlaybackMode.Compressed).fileExtension)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package ai.openclaw.app.voice
|
||||
|
||||
import ai.openclaw.app.gateway.DeviceAuthEntry
|
||||
import ai.openclaw.app.gateway.DeviceAuthTokenStore
|
||||
import ai.openclaw.app.gateway.DeviceIdentityStore
|
||||
import ai.openclaw.app.gateway.GatewaySession
|
||||
import java.util.concurrent.atomic.AtomicLong
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.SupervisorJob
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.RuntimeEnvironment
|
||||
import org.robolectric.annotation.Config
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
@Config(sdk = [34])
|
||||
class TalkModeManagerTest {
|
||||
@Test
|
||||
fun stopTtsCancelsTrackedPlaybackJob() {
|
||||
val manager = createManager()
|
||||
val playbackJob = Job()
|
||||
|
||||
setPrivateField(manager, "ttsJob", playbackJob)
|
||||
playbackGeneration(manager).set(7L)
|
||||
|
||||
manager.stopTts()
|
||||
|
||||
assertTrue(playbackJob.isCancelled)
|
||||
assertEquals(8L, playbackGeneration(manager).get())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun disablingPlaybackCancelsTrackedJobOnce() {
|
||||
val manager = createManager()
|
||||
val playbackJob = Job()
|
||||
|
||||
setPrivateField(manager, "ttsJob", playbackJob)
|
||||
playbackGeneration(manager).set(11L)
|
||||
|
||||
manager.setPlaybackEnabled(false)
|
||||
manager.setPlaybackEnabled(false)
|
||||
|
||||
assertTrue(playbackJob.isCancelled)
|
||||
assertEquals(12L, playbackGeneration(manager).get())
|
||||
}
|
||||
|
||||
private fun createManager(): TalkModeManager {
|
||||
val app = RuntimeEnvironment.getApplication()
|
||||
val sessionJob = SupervisorJob()
|
||||
val session =
|
||||
GatewaySession(
|
||||
scope = CoroutineScope(sessionJob + Dispatchers.Default),
|
||||
identityStore = DeviceIdentityStore(app),
|
||||
deviceAuthStore = InMemoryDeviceAuthStore(),
|
||||
onConnected = { _, _, _ -> },
|
||||
onDisconnected = {},
|
||||
onEvent = { _, _ -> },
|
||||
)
|
||||
return TalkModeManager(
|
||||
context = app,
|
||||
scope = CoroutineScope(SupervisorJob() + Dispatchers.Default),
|
||||
session = session,
|
||||
supportsChatSubscribe = false,
|
||||
isConnected = { true },
|
||||
)
|
||||
}
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
private fun playbackGeneration(manager: TalkModeManager): AtomicLong {
|
||||
return readPrivateField(manager, "playbackGeneration") as AtomicLong
|
||||
}
|
||||
|
||||
private fun setPrivateField(target: Any, name: String, value: Any?) {
|
||||
val field = target.javaClass.getDeclaredField(name)
|
||||
field.isAccessible = true
|
||||
field.set(target, value)
|
||||
}
|
||||
|
||||
private fun readPrivateField(target: Any, name: String): Any? {
|
||||
val field = target.javaClass.getDeclaredField(name)
|
||||
field.isAccessible = true
|
||||
return field.get(target)
|
||||
}
|
||||
}
|
||||
|
||||
private class InMemoryDeviceAuthStore : DeviceAuthTokenStore {
|
||||
override fun loadEntry(deviceId: String, role: String): DeviceAuthEntry? = null
|
||||
|
||||
override fun saveToken(deviceId: String, role: String, token: String, scopes: List<String>) = Unit
|
||||
|
||||
override fun clearToken(deviceId: String, role: String) = Unit
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package ai.openclaw.app.voice
|
||||
|
||||
import ai.openclaw.app.gateway.GatewayConnectErrorDetails
|
||||
import ai.openclaw.app.gateway.GatewaySession
|
||||
import kotlinx.coroutines.test.runTest
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
class TalkSpeakClientTest {
|
||||
@Test
|
||||
fun buildsRequestFromDirective() {
|
||||
val request =
|
||||
TalkSpeakRequest.from(
|
||||
text = "Hello from talk mode.",
|
||||
directive =
|
||||
TalkDirective(
|
||||
voiceId = "voice-123",
|
||||
modelId = "model-abc",
|
||||
speed = 1.1,
|
||||
rateWpm = 190,
|
||||
stability = 0.5,
|
||||
similarity = 0.7,
|
||||
style = 0.2,
|
||||
speakerBoost = true,
|
||||
seed = 42,
|
||||
normalize = "auto",
|
||||
language = "en",
|
||||
outputFormat = "pcm_24000",
|
||||
latencyTier = 3,
|
||||
once = true,
|
||||
),
|
||||
)
|
||||
|
||||
assertEquals("Hello from talk mode.", request.text)
|
||||
assertEquals("voice-123", request.voiceId)
|
||||
assertEquals("model-abc", request.modelId)
|
||||
assertEquals(1.1, request.speed)
|
||||
assertEquals(190, request.rateWpm)
|
||||
assertEquals(0.5, request.stability)
|
||||
assertEquals(0.7, request.similarity)
|
||||
assertEquals(0.2, request.style)
|
||||
assertEquals(true, request.speakerBoost)
|
||||
assertEquals(42L, request.seed)
|
||||
assertEquals("auto", request.normalize)
|
||||
assertEquals("en", request.language)
|
||||
assertEquals("pcm_24000", request.outputFormat)
|
||||
assertEquals(3, request.latencyTier)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun fallsBackOnlyForUnavailableReasons() = runTest {
|
||||
val client =
|
||||
TalkSpeakClient(
|
||||
requestDetailed = { _, _, _ ->
|
||||
GatewaySession.RpcResult(
|
||||
ok = false,
|
||||
payloadJson = null,
|
||||
error =
|
||||
GatewaySession.ErrorShape(
|
||||
code = "UNAVAILABLE",
|
||||
message = "talk unavailable",
|
||||
details =
|
||||
GatewayConnectErrorDetails(
|
||||
code = null,
|
||||
canRetryWithDeviceToken = false,
|
||||
recommendedNextStep = null,
|
||||
reason = "talk_unconfigured",
|
||||
),
|
||||
),
|
||||
)
|
||||
},
|
||||
)
|
||||
|
||||
val result = client.synthesize(text = "Hello", directive = null)
|
||||
assertTrue(result is TalkSpeakResult.FallbackToLocal)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun doesNotFallBackForSynthesisFailure() = runTest {
|
||||
val client =
|
||||
TalkSpeakClient(
|
||||
requestDetailed = { _, _, _ ->
|
||||
GatewaySession.RpcResult(
|
||||
ok = false,
|
||||
payloadJson = null,
|
||||
error =
|
||||
GatewaySession.ErrorShape(
|
||||
code = "UNAVAILABLE",
|
||||
message = "provider failed",
|
||||
details =
|
||||
GatewayConnectErrorDetails(
|
||||
code = null,
|
||||
canRetryWithDeviceToken = false,
|
||||
recommendedNextStep = null,
|
||||
reason = "synthesis_failed",
|
||||
),
|
||||
),
|
||||
)
|
||||
},
|
||||
)
|
||||
|
||||
val result = client.synthesize(text = "Hello", directive = null)
|
||||
assertTrue(result is TalkSpeakResult.Failure)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun fallsBackWhenGatewayOmitsReason() = runTest {
|
||||
val client =
|
||||
TalkSpeakClient(
|
||||
requestDetailed = { _, _, _ ->
|
||||
GatewaySession.RpcResult(
|
||||
ok = false,
|
||||
payloadJson = null,
|
||||
error =
|
||||
GatewaySession.ErrorShape(
|
||||
code = "INVALID_REQUEST",
|
||||
message = "unknown method: talk.speak",
|
||||
details = null,
|
||||
),
|
||||
)
|
||||
},
|
||||
)
|
||||
|
||||
val result = client.synthesize(text = "Hello", directive = null)
|
||||
assertTrue(result is TalkSpeakResult.FallbackToLocal)
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
// Shared iOS version defaults.
|
||||
// Generated overrides live in build/Version.xcconfig (git-ignored).
|
||||
|
||||
OPENCLAW_GATEWAY_VERSION = 2026.4.3
|
||||
OPENCLAW_MARKETING_VERSION = 2026.4.3
|
||||
OPENCLAW_BUILD_VERSION = 2026040301
|
||||
OPENCLAW_GATEWAY_VERSION = 2026.4.4
|
||||
OPENCLAW_MARKETING_VERSION = 2026.4.4
|
||||
OPENCLAW_BUILD_VERSION = 2026040401
|
||||
|
||||
#include? "../build/Version.xcconfig"
|
||||
|
||||
@@ -1816,7 +1816,7 @@ private extension NodeAppModel {
|
||||
return DeviceAuthStore.loadToken(deviceId: identity.deviceId, role: role) != nil
|
||||
}
|
||||
|
||||
static func shouldStartOperatorGatewayLoop(
|
||||
nonisolated static func shouldStartOperatorGatewayLoop(
|
||||
token: String?,
|
||||
bootstrapToken: String?,
|
||||
password: String?,
|
||||
@@ -1837,7 +1837,7 @@ private extension NodeAppModel {
|
||||
return hasStoredOperatorToken
|
||||
}
|
||||
|
||||
static func clearingBootstrapToken(in config: GatewayConnectConfig?) -> GatewayConnectConfig? {
|
||||
nonisolated static func clearingBootstrapToken(in config: GatewayConnectConfig?) -> GatewayConnectConfig? {
|
||||
guard let config else { return nil }
|
||||
let trimmedBootstrapToken = config.bootstrapToken?
|
||||
.trimmingCharacters(in: .whitespacesAndNewlines) ?? ""
|
||||
@@ -1878,6 +1878,36 @@ private extension NodeAppModel {
|
||||
GatewaySettingsStore.clearGatewayBootstrapToken(instanceId: trimmedInstanceId)
|
||||
}
|
||||
|
||||
private func handleSuccessfulBootstrapGatewayOnboarding(
|
||||
url: URL,
|
||||
stableID: String,
|
||||
token: String?,
|
||||
password: String?,
|
||||
nodeOptions: GatewayConnectOptions,
|
||||
sessionBox: WebSocketSessionBox?) async
|
||||
{
|
||||
self.clearPersistedGatewayBootstrapTokenIfNeeded()
|
||||
if self.operatorGatewayTask == nil && self.shouldStartOperatorGatewayLoop(
|
||||
token: token,
|
||||
bootstrapToken: nil,
|
||||
password: password,
|
||||
stableID: stableID)
|
||||
{
|
||||
self.startOperatorGatewayLoop(
|
||||
url: url,
|
||||
stableID: stableID,
|
||||
token: token,
|
||||
bootstrapToken: nil,
|
||||
password: password,
|
||||
nodeOptions: nodeOptions,
|
||||
sessionBox: sessionBox)
|
||||
}
|
||||
|
||||
// QR bootstrap onboarding should surface the system notification permission
|
||||
// prompt immediately so visible APNs alerts work without a second manual step.
|
||||
_ = await self.requestNotificationAuthorizationIfNeeded()
|
||||
}
|
||||
|
||||
func refreshBackgroundReconnectSuppressionIfNeeded(source: String) {
|
||||
guard self.isBackgrounded else { return }
|
||||
guard !self.backgroundReconnectSuppressed else { return }
|
||||
@@ -1927,17 +1957,20 @@ private extension NodeAppModel {
|
||||
continue
|
||||
}
|
||||
|
||||
let reconnectAuth = self.currentGatewayReconnectAuth(
|
||||
fallbackToken: token,
|
||||
fallbackBootstrapToken: bootstrapToken,
|
||||
fallbackPassword: password)
|
||||
let effectiveClientId =
|
||||
GatewaySettingsStore.loadGatewayClientIdOverride(stableID: stableID) ?? nodeOptions.clientId
|
||||
let operatorOptions = self.makeOperatorConnectOptions(
|
||||
clientId: effectiveClientId,
|
||||
displayName: nodeOptions.clientDisplayName)
|
||||
displayName: nodeOptions.clientDisplayName,
|
||||
includeApprovalScope: self.shouldRequestOperatorApprovalScope(
|
||||
token: reconnectAuth.token,
|
||||
password: reconnectAuth.password))
|
||||
|
||||
do {
|
||||
let reconnectAuth = self.currentGatewayReconnectAuth(
|
||||
fallbackToken: token,
|
||||
fallbackBootstrapToken: bootstrapToken,
|
||||
fallbackPassword: password)
|
||||
try await self.operatorGateway.connect(
|
||||
url: url,
|
||||
token: reconnectAuth.token,
|
||||
@@ -2049,13 +2082,14 @@ private extension NodeAppModel {
|
||||
fallbackToken: token,
|
||||
fallbackBootstrapToken: bootstrapToken,
|
||||
fallbackPassword: password)
|
||||
let connectedOptions = currentOptions
|
||||
GatewayDiagnostics.log("connect attempt epochMs=\(epochMs) url=\(url.absoluteString)")
|
||||
try await self.nodeGateway.connect(
|
||||
url: url,
|
||||
token: reconnectAuth.token,
|
||||
bootstrapToken: reconnectAuth.bootstrapToken,
|
||||
password: reconnectAuth.password,
|
||||
connectOptions: currentOptions,
|
||||
connectOptions: connectedOptions,
|
||||
sessionBox: sessionBox,
|
||||
onConnected: { [weak self] in
|
||||
guard let self else { return }
|
||||
@@ -2071,24 +2105,13 @@ private extension NodeAppModel {
|
||||
reconnectAuth.bootstrapToken?.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
.isEmpty == false
|
||||
if usedBootstrapToken {
|
||||
await MainActor.run {
|
||||
self.clearPersistedGatewayBootstrapTokenIfNeeded()
|
||||
if self.operatorGatewayTask == nil && self.shouldStartOperatorGatewayLoop(
|
||||
token: reconnectAuth.token,
|
||||
bootstrapToken: nil,
|
||||
password: reconnectAuth.password,
|
||||
stableID: stableID)
|
||||
{
|
||||
self.startOperatorGatewayLoop(
|
||||
url: url,
|
||||
stableID: stableID,
|
||||
token: reconnectAuth.token,
|
||||
bootstrapToken: nil,
|
||||
password: reconnectAuth.password,
|
||||
nodeOptions: currentOptions,
|
||||
sessionBox: sessionBox)
|
||||
}
|
||||
}
|
||||
await self.handleSuccessfulBootstrapGatewayOnboarding(
|
||||
url: url,
|
||||
stableID: stableID,
|
||||
token: reconnectAuth.token,
|
||||
password: reconnectAuth.password,
|
||||
nodeOptions: connectedOptions,
|
||||
sessionBox: sessionBox)
|
||||
}
|
||||
let relayData = await MainActor.run {
|
||||
(
|
||||
@@ -2246,10 +2269,47 @@ private extension NodeAppModel {
|
||||
}
|
||||
}
|
||||
|
||||
func makeOperatorConnectOptions(clientId: String, displayName: String?) -> GatewayConnectOptions {
|
||||
GatewayConnectOptions(
|
||||
func shouldRequestOperatorApprovalScope(token: String?, password: String?) -> Bool {
|
||||
let identity = DeviceIdentityStore.loadOrCreate()
|
||||
let storedOperatorScopes = DeviceAuthStore
|
||||
.loadToken(deviceId: identity.deviceId, role: "operator")?
|
||||
.scopes ?? []
|
||||
return Self.shouldRequestOperatorApprovalScope(
|
||||
token: token,
|
||||
password: password,
|
||||
storedOperatorScopes: storedOperatorScopes)
|
||||
}
|
||||
|
||||
nonisolated static func shouldRequestOperatorApprovalScope(
|
||||
token: String?,
|
||||
password: String?,
|
||||
storedOperatorScopes: [String]
|
||||
) -> Bool {
|
||||
let trimmedToken = token?.trimmingCharacters(in: .whitespacesAndNewlines) ?? ""
|
||||
if !trimmedToken.isEmpty {
|
||||
return true
|
||||
}
|
||||
let trimmedPassword = password?.trimmingCharacters(in: .whitespacesAndNewlines) ?? ""
|
||||
if !trimmedPassword.isEmpty {
|
||||
return true
|
||||
}
|
||||
return storedOperatorScopes.contains("operator.approvals")
|
||||
}
|
||||
|
||||
func makeOperatorConnectOptions(
|
||||
clientId: String,
|
||||
displayName: String?,
|
||||
includeApprovalScope: Bool
|
||||
) -> GatewayConnectOptions {
|
||||
var scopes = ["operator.read", "operator.write", "operator.talk.secrets"]
|
||||
// Preserve reconnect compatibility for older paired operator tokens that were
|
||||
// approved before iOS requested operator.approvals by default.
|
||||
if includeApprovalScope {
|
||||
scopes.append("operator.approvals")
|
||||
}
|
||||
return GatewayConnectOptions(
|
||||
role: "operator",
|
||||
scopes: ["operator.read", "operator.write", "operator.talk.secrets"],
|
||||
scopes: scopes,
|
||||
caps: [],
|
||||
commands: [],
|
||||
permissions: [:],
|
||||
@@ -3137,11 +3197,22 @@ extension NodeAppModel {
|
||||
await self.applyPendingForegroundNodeActions(mapped, trigger: "test")
|
||||
}
|
||||
|
||||
func _test_makeOperatorConnectOptions(
|
||||
clientId: String,
|
||||
displayName: String?,
|
||||
includeApprovalScope: Bool
|
||||
) -> GatewayConnectOptions {
|
||||
self.makeOperatorConnectOptions(
|
||||
clientId: clientId,
|
||||
displayName: displayName,
|
||||
includeApprovalScope: includeApprovalScope)
|
||||
}
|
||||
|
||||
static func _test_currentDeepLinkKey() -> String {
|
||||
self.expectedDeepLinkKey()
|
||||
}
|
||||
|
||||
static func _test_shouldStartOperatorGatewayLoop(
|
||||
nonisolated static func _test_shouldStartOperatorGatewayLoop(
|
||||
token: String?,
|
||||
bootstrapToken: String?,
|
||||
password: String?,
|
||||
@@ -3154,6 +3225,41 @@ extension NodeAppModel {
|
||||
hasStoredOperatorToken: hasStoredOperatorToken)
|
||||
}
|
||||
|
||||
nonisolated static func _test_shouldRequestOperatorApprovalScope(
|
||||
token: String?,
|
||||
password: String?,
|
||||
storedOperatorScopes: [String]
|
||||
) -> Bool {
|
||||
self.shouldRequestOperatorApprovalScope(
|
||||
token: token,
|
||||
password: password,
|
||||
storedOperatorScopes: storedOperatorScopes)
|
||||
}
|
||||
|
||||
nonisolated static func _test_clearingBootstrapToken(
|
||||
in config: GatewayConnectConfig?
|
||||
) -> GatewayConnectConfig? {
|
||||
self.clearingBootstrapToken(in: config)
|
||||
}
|
||||
|
||||
func _test_handleSuccessfulBootstrapGatewayOnboarding() async {
|
||||
await self.handleSuccessfulBootstrapGatewayOnboarding(
|
||||
url: URL(string: "wss://gateway.example")!,
|
||||
stableID: "test-gateway",
|
||||
token: nil,
|
||||
password: nil,
|
||||
nodeOptions: GatewayConnectOptions(
|
||||
role: "node",
|
||||
scopes: [],
|
||||
caps: [],
|
||||
commands: [],
|
||||
permissions: [:],
|
||||
clientId: "openclaw-ios",
|
||||
clientMode: "node",
|
||||
clientDisplayName: nil),
|
||||
sessionBox: nil)
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
// swiftlint:enable type_body_length file_length
|
||||
|
||||
@@ -70,6 +70,52 @@ import UIKit
|
||||
}
|
||||
}
|
||||
|
||||
@Test @MainActor func operatorConnectOptionsOnlyRequestApprovalScopeWhenEnabled() {
|
||||
let appModel = NodeAppModel()
|
||||
let withoutApprovalScope = appModel._test_makeOperatorConnectOptions(
|
||||
clientId: "openclaw-ios",
|
||||
displayName: "OpenClaw iOS",
|
||||
includeApprovalScope: false)
|
||||
let withApprovalScope = appModel._test_makeOperatorConnectOptions(
|
||||
clientId: "openclaw-ios",
|
||||
displayName: "OpenClaw iOS",
|
||||
includeApprovalScope: true)
|
||||
|
||||
#expect(withoutApprovalScope.role == "operator")
|
||||
#expect(withoutApprovalScope.scopes.contains("operator.read"))
|
||||
#expect(withoutApprovalScope.scopes.contains("operator.write"))
|
||||
#expect(!withoutApprovalScope.scopes.contains("operator.approvals"))
|
||||
#expect(withoutApprovalScope.scopes.contains("operator.talk.secrets"))
|
||||
|
||||
#expect(withApprovalScope.scopes.contains("operator.approvals"))
|
||||
}
|
||||
|
||||
@Test func operatorApprovalScopeRequestsStayBackwardCompatible() {
|
||||
#expect(
|
||||
!NodeAppModel._test_shouldRequestOperatorApprovalScope(
|
||||
token: nil,
|
||||
password: nil,
|
||||
storedOperatorScopes: ["operator.read", "operator.write", "operator.talk.secrets"])
|
||||
)
|
||||
#expect(
|
||||
NodeAppModel._test_shouldRequestOperatorApprovalScope(
|
||||
token: nil,
|
||||
password: nil,
|
||||
storedOperatorScopes: [
|
||||
"operator.approvals",
|
||||
"operator.read",
|
||||
"operator.write",
|
||||
"operator.talk.secrets",
|
||||
])
|
||||
)
|
||||
#expect(
|
||||
NodeAppModel._test_shouldRequestOperatorApprovalScope(
|
||||
token: "shared-token",
|
||||
password: nil,
|
||||
storedOperatorScopes: [])
|
||||
)
|
||||
}
|
||||
|
||||
@Test @MainActor func loadLastConnectionReadsSavedValues() {
|
||||
let prior = KeychainStore.loadString(service: "ai.openclaw.gateway", account: "lastConnection")
|
||||
defer {
|
||||
|
||||
@@ -2,6 +2,7 @@ import OpenClawKit
|
||||
import Foundation
|
||||
import Testing
|
||||
import UIKit
|
||||
import UserNotifications
|
||||
@testable import OpenClaw
|
||||
|
||||
private func makeAgentDeepLinkURL(
|
||||
@@ -68,6 +69,28 @@ private final class MockWatchMessagingService: @preconcurrency WatchMessagingSer
|
||||
}
|
||||
}
|
||||
|
||||
private final class MockBootstrapNotificationCenter: NotificationCentering, @unchecked Sendable {
|
||||
var status: NotificationAuthorizationStatus = .notDetermined
|
||||
var requestAuthorizationResult = false
|
||||
var requestAuthorizationCalls = 0
|
||||
|
||||
func authorizationStatus() async -> NotificationAuthorizationStatus {
|
||||
self.status
|
||||
}
|
||||
|
||||
func requestAuthorization(options _: UNAuthorizationOptions) async throws -> Bool {
|
||||
self.requestAuthorizationCalls += 1
|
||||
if self.requestAuthorizationResult {
|
||||
self.status = .authorized
|
||||
} else {
|
||||
self.status = .denied
|
||||
}
|
||||
return self.requestAuthorizationResult
|
||||
}
|
||||
|
||||
func add(_: UNNotificationRequest) async throws {}
|
||||
}
|
||||
|
||||
@Suite(.serialized) struct NodeAppModelInvokeTests {
|
||||
@Test @MainActor func decodeParamsFailsWithoutJSON() {
|
||||
#expect(throws: Error.self) {
|
||||
@@ -127,6 +150,15 @@ private final class MockWatchMessagingService: @preconcurrency WatchMessagingSer
|
||||
)
|
||||
}
|
||||
|
||||
@Test @MainActor func successfulBootstrapOnboardingRequestsNotificationAuthorization() async {
|
||||
let center = MockBootstrapNotificationCenter()
|
||||
let appModel = NodeAppModel(notificationCenter: center)
|
||||
|
||||
await appModel._test_handleSuccessfulBootstrapGatewayOnboarding()
|
||||
|
||||
#expect(center.requestAuthorizationCalls == 1)
|
||||
}
|
||||
|
||||
@Test func clearingBootstrapTokenStripsReconnectConfigEvenWithoutPersistence() {
|
||||
let config = GatewayConnectConfig(
|
||||
url: URL(string: "wss://gateway.example")!,
|
||||
@@ -145,7 +177,7 @@ private final class MockWatchMessagingService: @preconcurrency WatchMessagingSer
|
||||
clientMode: "node",
|
||||
clientDisplayName: nil))
|
||||
|
||||
let cleared = NodeAppModel.clearingBootstrapToken(in: config)
|
||||
let cleared = NodeAppModel._test_clearingBootstrapToken(in: config)
|
||||
#expect(cleared?.bootstrapToken == nil)
|
||||
#expect(cleared?.url == config.url)
|
||||
#expect(cleared?.stableID == config.stableID)
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>2026.4.3</string>
|
||||
<string>2026.4.4</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>2026040301</string>
|
||||
<string>2026040401</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>OpenClaw</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
|
||||
@@ -43,8 +43,8 @@ enum WideAreaGatewayDiscovery {
|
||||
guard let statusJson = context.tailscaleStatus(),
|
||||
!collectTailnetIPv4s(statusJson: statusJson).isEmpty,
|
||||
let discovery = loadWideAreaPtrRecords(
|
||||
remaining: remaining,
|
||||
dig: context.dig)
|
||||
remaining: remaining,
|
||||
dig: context.dig)
|
||||
else { return [] }
|
||||
|
||||
let domainTrimmed = discovery.domainTrimmed
|
||||
|
||||
@@ -2019,6 +2019,7 @@ public struct TalkSpeakParams: Codable, Sendable {
|
||||
public let modelid: String?
|
||||
public let outputformat: String?
|
||||
public let speed: Double?
|
||||
public let ratewpm: Int?
|
||||
public let stability: Double?
|
||||
public let similarity: Double?
|
||||
public let style: Double?
|
||||
@@ -2026,6 +2027,7 @@ public struct TalkSpeakParams: Codable, Sendable {
|
||||
public let seed: Int?
|
||||
public let normalize: String?
|
||||
public let language: String?
|
||||
public let latencytier: Int?
|
||||
|
||||
public init(
|
||||
text: String,
|
||||
@@ -2033,19 +2035,22 @@ public struct TalkSpeakParams: Codable, Sendable {
|
||||
modelid: String?,
|
||||
outputformat: String?,
|
||||
speed: Double?,
|
||||
ratewpm: Int?,
|
||||
stability: Double?,
|
||||
similarity: Double?,
|
||||
style: Double?,
|
||||
speakerboost: Bool?,
|
||||
seed: Int?,
|
||||
normalize: String?,
|
||||
language: String?)
|
||||
language: String?,
|
||||
latencytier: Int?)
|
||||
{
|
||||
self.text = text
|
||||
self.voiceid = voiceid
|
||||
self.modelid = modelid
|
||||
self.outputformat = outputformat
|
||||
self.speed = speed
|
||||
self.ratewpm = ratewpm
|
||||
self.stability = stability
|
||||
self.similarity = similarity
|
||||
self.style = style
|
||||
@@ -2053,6 +2058,7 @@ public struct TalkSpeakParams: Codable, Sendable {
|
||||
self.seed = seed
|
||||
self.normalize = normalize
|
||||
self.language = language
|
||||
self.latencytier = latencytier
|
||||
}
|
||||
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
@@ -2061,6 +2067,7 @@ public struct TalkSpeakParams: Codable, Sendable {
|
||||
case modelid = "modelId"
|
||||
case outputformat = "outputFormat"
|
||||
case speed
|
||||
case ratewpm = "rateWpm"
|
||||
case stability
|
||||
case similarity
|
||||
case style
|
||||
@@ -2068,6 +2075,7 @@ public struct TalkSpeakParams: Codable, Sendable {
|
||||
case seed
|
||||
case normalize
|
||||
case language
|
||||
case latencytier = "latencyTier"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -542,6 +542,77 @@ public actor GatewayChannelActor {
|
||||
authSource: authSource)
|
||||
}
|
||||
|
||||
private func shouldPersistBootstrapHandoffTokens() -> Bool {
|
||||
guard self.lastAuthSource == .bootstrapToken else { return false }
|
||||
let scheme = self.url.scheme?.lowercased()
|
||||
if scheme == "wss" {
|
||||
return true
|
||||
}
|
||||
if let host = self.url.host, LoopbackHost.isLoopback(host) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
private func filteredBootstrapHandoffScopes(role: String, scopes: [String]) -> [String]? {
|
||||
let normalizedRole = role.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
switch normalizedRole {
|
||||
case "node":
|
||||
return []
|
||||
case "operator":
|
||||
let allowedOperatorScopes: Set<String> = [
|
||||
"operator.approvals",
|
||||
"operator.read",
|
||||
"operator.talk.secrets",
|
||||
"operator.write",
|
||||
]
|
||||
return Array(Set(scopes.filter { allowedOperatorScopes.contains($0) })).sorted()
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
private func persistBootstrapHandoffToken(
|
||||
deviceId: String,
|
||||
role: String,
|
||||
token: String,
|
||||
scopes: [String]
|
||||
) {
|
||||
guard let filteredScopes = self.filteredBootstrapHandoffScopes(role: role, scopes: scopes) else {
|
||||
return
|
||||
}
|
||||
_ = DeviceAuthStore.storeToken(
|
||||
deviceId: deviceId,
|
||||
role: role,
|
||||
token: token,
|
||||
scopes: filteredScopes)
|
||||
}
|
||||
|
||||
private func persistIssuedDeviceToken(
|
||||
authSource: GatewayAuthSource,
|
||||
deviceId: String,
|
||||
role: String,
|
||||
token: String,
|
||||
scopes: [String]
|
||||
) {
|
||||
if authSource == .bootstrapToken {
|
||||
guard self.shouldPersistBootstrapHandoffTokens() else {
|
||||
return
|
||||
}
|
||||
self.persistBootstrapHandoffToken(
|
||||
deviceId: deviceId,
|
||||
role: role,
|
||||
token: token,
|
||||
scopes: scopes)
|
||||
return
|
||||
}
|
||||
_ = DeviceAuthStore.storeToken(
|
||||
deviceId: deviceId,
|
||||
role: role,
|
||||
token: token,
|
||||
scopes: scopes)
|
||||
}
|
||||
|
||||
private func handleConnectResponse(
|
||||
_ res: ResponseFrame,
|
||||
identity: DeviceIdentity?,
|
||||
@@ -572,18 +643,37 @@ public actor GatewayChannelActor {
|
||||
} else if let tick = ok.policy["tickIntervalMs"]?.value as? Int {
|
||||
self.tickIntervalMs = Double(tick)
|
||||
}
|
||||
if let auth = ok.auth,
|
||||
let deviceToken = auth["deviceToken"]?.value as? String {
|
||||
let authRole = auth["role"]?.value as? String ?? role
|
||||
let scopes = (auth["scopes"]?.value as? [ProtoAnyCodable])?
|
||||
.compactMap { $0.value as? String } ?? []
|
||||
if let identity {
|
||||
_ = DeviceAuthStore.storeToken(
|
||||
if let auth = ok.auth, let identity {
|
||||
if let deviceToken = auth["deviceToken"]?.value as? String {
|
||||
let authRole = auth["role"]?.value as? String ?? role
|
||||
let scopes = (auth["scopes"]?.value as? [ProtoAnyCodable])?
|
||||
.compactMap { $0.value as? String } ?? []
|
||||
self.persistIssuedDeviceToken(
|
||||
authSource: self.lastAuthSource,
|
||||
deviceId: identity.deviceId,
|
||||
role: authRole,
|
||||
token: deviceToken,
|
||||
scopes: scopes)
|
||||
}
|
||||
if self.shouldPersistBootstrapHandoffTokens(),
|
||||
let tokenEntries = auth["deviceTokens"]?.value as? [ProtoAnyCodable]
|
||||
{
|
||||
for entry in tokenEntries {
|
||||
guard let rawEntry = entry.value as? [String: ProtoAnyCodable],
|
||||
let deviceToken = rawEntry["deviceToken"]?.value as? String,
|
||||
let authRole = rawEntry["role"]?.value as? String
|
||||
else {
|
||||
continue
|
||||
}
|
||||
let scopes = (rawEntry["scopes"]?.value as? [ProtoAnyCodable])?
|
||||
.compactMap { $0.value as? String } ?? []
|
||||
self.persistBootstrapHandoffToken(
|
||||
deviceId: identity.deviceId,
|
||||
role: authRole,
|
||||
token: deviceToken,
|
||||
scopes: scopes)
|
||||
}
|
||||
}
|
||||
}
|
||||
self.lastTick = Date()
|
||||
self.tickTask?.cancel()
|
||||
|
||||
@@ -2019,6 +2019,7 @@ public struct TalkSpeakParams: Codable, Sendable {
|
||||
public let modelid: String?
|
||||
public let outputformat: String?
|
||||
public let speed: Double?
|
||||
public let ratewpm: Int?
|
||||
public let stability: Double?
|
||||
public let similarity: Double?
|
||||
public let style: Double?
|
||||
@@ -2026,6 +2027,7 @@ public struct TalkSpeakParams: Codable, Sendable {
|
||||
public let seed: Int?
|
||||
public let normalize: String?
|
||||
public let language: String?
|
||||
public let latencytier: Int?
|
||||
|
||||
public init(
|
||||
text: String,
|
||||
@@ -2033,19 +2035,22 @@ public struct TalkSpeakParams: Codable, Sendable {
|
||||
modelid: String?,
|
||||
outputformat: String?,
|
||||
speed: Double?,
|
||||
ratewpm: Int?,
|
||||
stability: Double?,
|
||||
similarity: Double?,
|
||||
style: Double?,
|
||||
speakerboost: Bool?,
|
||||
seed: Int?,
|
||||
normalize: String?,
|
||||
language: String?)
|
||||
language: String?,
|
||||
latencytier: Int?)
|
||||
{
|
||||
self.text = text
|
||||
self.voiceid = voiceid
|
||||
self.modelid = modelid
|
||||
self.outputformat = outputformat
|
||||
self.speed = speed
|
||||
self.ratewpm = ratewpm
|
||||
self.stability = stability
|
||||
self.similarity = similarity
|
||||
self.style = style
|
||||
@@ -2053,6 +2058,7 @@ public struct TalkSpeakParams: Codable, Sendable {
|
||||
self.seed = seed
|
||||
self.normalize = normalize
|
||||
self.language = language
|
||||
self.latencytier = latencytier
|
||||
}
|
||||
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
@@ -2061,6 +2067,7 @@ public struct TalkSpeakParams: Codable, Sendable {
|
||||
case modelid = "modelId"
|
||||
case outputformat = "outputFormat"
|
||||
case speed
|
||||
case ratewpm = "rateWpm"
|
||||
case stability
|
||||
case similarity
|
||||
case style
|
||||
@@ -2068,6 +2075,7 @@ public struct TalkSpeakParams: Codable, Sendable {
|
||||
case seed
|
||||
case normalize
|
||||
case language
|
||||
case latencytier = "latencyTier"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ private extension NSLock {
|
||||
|
||||
private final class FakeGatewayWebSocketTask: WebSocketTasking, @unchecked Sendable {
|
||||
private let lock = NSLock()
|
||||
private let helloAuth: [String: Any]?
|
||||
private var _state: URLSessionTask.State = .suspended
|
||||
private var connectRequestId: String?
|
||||
private var connectAuth: [String: Any]?
|
||||
@@ -20,6 +21,10 @@ private final class FakeGatewayWebSocketTask: WebSocketTasking, @unchecked Senda
|
||||
private var pendingReceiveHandler:
|
||||
(@Sendable (Result<URLSessionWebSocketTask.Message, Error>) -> Void)?
|
||||
|
||||
init(helloAuth: [String: Any]? = nil) {
|
||||
self.helloAuth = helloAuth
|
||||
}
|
||||
|
||||
var state: URLSessionTask.State {
|
||||
get { self.lock.withLock { self._state } }
|
||||
set { self.lock.withLock { self._state = newValue } }
|
||||
@@ -79,11 +84,11 @@ private final class FakeGatewayWebSocketTask: WebSocketTasking, @unchecked Senda
|
||||
for _ in 0..<50 {
|
||||
let id = self.lock.withLock { self.connectRequestId }
|
||||
if let id {
|
||||
return .data(Self.connectOkData(id: id))
|
||||
return .data(Self.connectOkData(id: id, auth: self.helloAuth))
|
||||
}
|
||||
try await Task.sleep(nanoseconds: 1_000_000)
|
||||
}
|
||||
return .data(Self.connectOkData(id: "connect"))
|
||||
return .data(Self.connectOkData(id: "connect", auth: self.helloAuth))
|
||||
}
|
||||
|
||||
func receive(
|
||||
@@ -110,8 +115,8 @@ private final class FakeGatewayWebSocketTask: WebSocketTasking, @unchecked Senda
|
||||
return (try? JSONSerialization.data(withJSONObject: frame)) ?? Data()
|
||||
}
|
||||
|
||||
private static func connectOkData(id: String) -> Data {
|
||||
let payload: [String: Any] = [
|
||||
private static func connectOkData(id: String, auth: [String: Any]? = nil) -> Data {
|
||||
var payload: [String: Any] = [
|
||||
"type": "hello-ok",
|
||||
"protocol": 2,
|
||||
"server": [
|
||||
@@ -137,6 +142,9 @@ private final class FakeGatewayWebSocketTask: WebSocketTasking, @unchecked Senda
|
||||
"tickIntervalMs": 30_000,
|
||||
],
|
||||
]
|
||||
if let auth {
|
||||
payload["auth"] = auth
|
||||
}
|
||||
let frame: [String: Any] = [
|
||||
"type": "res",
|
||||
"id": id,
|
||||
@@ -149,9 +157,14 @@ private final class FakeGatewayWebSocketTask: WebSocketTasking, @unchecked Senda
|
||||
|
||||
private final class FakeGatewayWebSocketSession: WebSocketSessioning, @unchecked Sendable {
|
||||
private let lock = NSLock()
|
||||
private let helloAuth: [String: Any]?
|
||||
private var tasks: [FakeGatewayWebSocketTask] = []
|
||||
private var makeCount = 0
|
||||
|
||||
init(helloAuth: [String: Any]? = nil) {
|
||||
self.helloAuth = helloAuth
|
||||
}
|
||||
|
||||
func snapshotMakeCount() -> Int {
|
||||
self.lock.withLock { self.makeCount }
|
||||
}
|
||||
@@ -164,7 +177,7 @@ private final class FakeGatewayWebSocketSession: WebSocketSessioning, @unchecked
|
||||
_ = url
|
||||
return self.lock.withLock {
|
||||
self.makeCount += 1
|
||||
let task = FakeGatewayWebSocketTask()
|
||||
let task = FakeGatewayWebSocketTask(helloAuth: self.helloAuth)
|
||||
self.tasks.append(task)
|
||||
return WebSocketTaskBox(task: task)
|
||||
}
|
||||
@@ -177,6 +190,7 @@ private actor SeqGapProbe {
|
||||
func value() -> Bool { self.saw }
|
||||
}
|
||||
|
||||
@Suite(.serialized)
|
||||
struct GatewayNodeSessionTests {
|
||||
@Test
|
||||
func scannedSetupCodePrefersBootstrapAuthOverStoredDeviceToken() async throws {
|
||||
@@ -234,6 +248,210 @@ struct GatewayNodeSessionTests {
|
||||
await gateway.disconnect()
|
||||
}
|
||||
|
||||
@Test
|
||||
func bootstrapHelloStoresAdditionalDeviceTokens() async throws {
|
||||
let tempDir = FileManager.default.temporaryDirectory
|
||||
.appendingPathComponent(UUID().uuidString, isDirectory: true)
|
||||
try FileManager.default.createDirectory(at: tempDir, withIntermediateDirectories: true)
|
||||
let previousStateDir = ProcessInfo.processInfo.environment["OPENCLAW_STATE_DIR"]
|
||||
setenv("OPENCLAW_STATE_DIR", tempDir.path, 1)
|
||||
defer {
|
||||
if let previousStateDir {
|
||||
setenv("OPENCLAW_STATE_DIR", previousStateDir, 1)
|
||||
} else {
|
||||
unsetenv("OPENCLAW_STATE_DIR")
|
||||
}
|
||||
try? FileManager.default.removeItem(at: tempDir)
|
||||
}
|
||||
|
||||
let identity = DeviceIdentityStore.loadOrCreate()
|
||||
let session = FakeGatewayWebSocketSession(helloAuth: [
|
||||
"deviceToken": "node-device-token",
|
||||
"role": "node",
|
||||
"scopes": [],
|
||||
"issuedAtMs": 1000,
|
||||
"deviceTokens": [
|
||||
[
|
||||
"deviceToken": "operator-device-token",
|
||||
"role": "operator",
|
||||
"scopes": [
|
||||
"node.exec",
|
||||
"operator.admin",
|
||||
"operator.approvals",
|
||||
"operator.pairing",
|
||||
"operator.read",
|
||||
"operator.talk.secrets",
|
||||
"operator.write",
|
||||
],
|
||||
"issuedAtMs": 1001,
|
||||
],
|
||||
],
|
||||
])
|
||||
let gateway = GatewayNodeSession()
|
||||
let options = GatewayConnectOptions(
|
||||
role: "node",
|
||||
scopes: [],
|
||||
caps: [],
|
||||
commands: [],
|
||||
permissions: [:],
|
||||
clientId: "openclaw-ios-test",
|
||||
clientMode: "node",
|
||||
clientDisplayName: "iOS Test",
|
||||
includeDeviceIdentity: true)
|
||||
|
||||
try await gateway.connect(
|
||||
url: URL(string: "wss://example.invalid")!,
|
||||
token: nil,
|
||||
bootstrapToken: "fresh-bootstrap-token",
|
||||
password: nil,
|
||||
connectOptions: options,
|
||||
sessionBox: WebSocketSessionBox(session: session),
|
||||
onConnected: {},
|
||||
onDisconnected: { _ in },
|
||||
onInvoke: { req in
|
||||
BridgeInvokeResponse(id: req.id, ok: true, payloadJSON: nil, error: nil)
|
||||
})
|
||||
|
||||
let nodeEntry = try #require(DeviceAuthStore.loadToken(deviceId: identity.deviceId, role: "node"))
|
||||
let operatorEntry = try #require(DeviceAuthStore.loadToken(deviceId: identity.deviceId, role: "operator"))
|
||||
#expect(nodeEntry.token == "node-device-token")
|
||||
#expect(nodeEntry.scopes == [])
|
||||
#expect(operatorEntry.token == "operator-device-token")
|
||||
#expect(operatorEntry.scopes == [
|
||||
"operator.approvals",
|
||||
"operator.read",
|
||||
"operator.talk.secrets",
|
||||
"operator.write",
|
||||
])
|
||||
|
||||
await gateway.disconnect()
|
||||
}
|
||||
|
||||
@Test
|
||||
func nonBootstrapHelloStoresPrimaryDeviceTokenButNotAdditionalBootstrapTokens() async throws {
|
||||
let tempDir = FileManager.default.temporaryDirectory
|
||||
.appendingPathComponent(UUID().uuidString, isDirectory: true)
|
||||
try FileManager.default.createDirectory(at: tempDir, withIntermediateDirectories: true)
|
||||
let previousStateDir = ProcessInfo.processInfo.environment["OPENCLAW_STATE_DIR"]
|
||||
setenv("OPENCLAW_STATE_DIR", tempDir.path, 1)
|
||||
defer {
|
||||
if let previousStateDir {
|
||||
setenv("OPENCLAW_STATE_DIR", previousStateDir, 1)
|
||||
} else {
|
||||
unsetenv("OPENCLAW_STATE_DIR")
|
||||
}
|
||||
try? FileManager.default.removeItem(at: tempDir)
|
||||
}
|
||||
|
||||
let identity = DeviceIdentityStore.loadOrCreate()
|
||||
let session = FakeGatewayWebSocketSession(helloAuth: [
|
||||
"deviceToken": "server-node-token",
|
||||
"role": "node",
|
||||
"scopes": [],
|
||||
"deviceTokens": [
|
||||
[
|
||||
"deviceToken": "server-operator-token",
|
||||
"role": "operator",
|
||||
"scopes": ["operator.admin"],
|
||||
],
|
||||
],
|
||||
])
|
||||
let gateway = GatewayNodeSession()
|
||||
let options = GatewayConnectOptions(
|
||||
role: "node",
|
||||
scopes: [],
|
||||
caps: [],
|
||||
commands: [],
|
||||
permissions: [:],
|
||||
clientId: "openclaw-ios-test",
|
||||
clientMode: "node",
|
||||
clientDisplayName: "iOS Test",
|
||||
includeDeviceIdentity: true)
|
||||
|
||||
try await gateway.connect(
|
||||
url: URL(string: "wss://example.invalid")!,
|
||||
token: "shared-token",
|
||||
bootstrapToken: nil,
|
||||
password: nil,
|
||||
connectOptions: options,
|
||||
sessionBox: WebSocketSessionBox(session: session),
|
||||
onConnected: {},
|
||||
onDisconnected: { _ in },
|
||||
onInvoke: { req in
|
||||
BridgeInvokeResponse(id: req.id, ok: true, payloadJSON: nil, error: nil)
|
||||
})
|
||||
|
||||
let nodeEntry = try #require(DeviceAuthStore.loadToken(deviceId: identity.deviceId, role: "node"))
|
||||
#expect(nodeEntry.token == "server-node-token")
|
||||
#expect(nodeEntry.scopes == [])
|
||||
#expect(DeviceAuthStore.loadToken(deviceId: identity.deviceId, role: "operator") == nil)
|
||||
|
||||
await gateway.disconnect()
|
||||
}
|
||||
|
||||
@Test
|
||||
func untrustedBootstrapHelloDoesNotPersistBootstrapHandoffTokens() async throws {
|
||||
let tempDir = FileManager.default.temporaryDirectory
|
||||
.appendingPathComponent(UUID().uuidString, isDirectory: true)
|
||||
try FileManager.default.createDirectory(at: tempDir, withIntermediateDirectories: true)
|
||||
let previousStateDir = ProcessInfo.processInfo.environment["OPENCLAW_STATE_DIR"]
|
||||
setenv("OPENCLAW_STATE_DIR", tempDir.path, 1)
|
||||
defer {
|
||||
if let previousStateDir {
|
||||
setenv("OPENCLAW_STATE_DIR", previousStateDir, 1)
|
||||
} else {
|
||||
unsetenv("OPENCLAW_STATE_DIR")
|
||||
}
|
||||
try? FileManager.default.removeItem(at: tempDir)
|
||||
}
|
||||
|
||||
let identity = DeviceIdentityStore.loadOrCreate()
|
||||
let session = FakeGatewayWebSocketSession(helloAuth: [
|
||||
"deviceToken": "untrusted-node-token",
|
||||
"role": "node",
|
||||
"scopes": [],
|
||||
"deviceTokens": [
|
||||
[
|
||||
"deviceToken": "untrusted-operator-token",
|
||||
"role": "operator",
|
||||
"scopes": [
|
||||
"operator.approvals",
|
||||
"operator.read",
|
||||
],
|
||||
],
|
||||
],
|
||||
])
|
||||
let gateway = GatewayNodeSession()
|
||||
let options = GatewayConnectOptions(
|
||||
role: "node",
|
||||
scopes: [],
|
||||
caps: [],
|
||||
commands: [],
|
||||
permissions: [:],
|
||||
clientId: "openclaw-ios-test",
|
||||
clientMode: "node",
|
||||
clientDisplayName: "iOS Test",
|
||||
includeDeviceIdentity: true)
|
||||
|
||||
try await gateway.connect(
|
||||
url: URL(string: "ws://example.invalid")!,
|
||||
token: nil,
|
||||
bootstrapToken: "fresh-bootstrap-token",
|
||||
password: nil,
|
||||
connectOptions: options,
|
||||
sessionBox: WebSocketSessionBox(session: session),
|
||||
onConnected: {},
|
||||
onDisconnected: { _ in },
|
||||
onInvoke: { req in
|
||||
BridgeInvokeResponse(id: req.id, ok: true, payloadJSON: nil, error: nil)
|
||||
})
|
||||
|
||||
#expect(DeviceAuthStore.loadToken(deviceId: identity.deviceId, role: "node") == nil)
|
||||
#expect(DeviceAuthStore.loadToken(deviceId: identity.deviceId, role: "operator") == nil)
|
||||
|
||||
await gateway.disconnect()
|
||||
}
|
||||
|
||||
@Test
|
||||
func normalizeCanvasHostUrlPreservesExplicitSecureCanvasPort() {
|
||||
let normalized = canonicalizeCanvasHostUrl(
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import XCTest
|
||||
@testable import OpenClawKit
|
||||
|
||||
@MainActor
|
||||
final class TalkSystemSpeechSynthesizerTests: XCTestCase {
|
||||
func testWatchdogTimeoutDefaultsToLatinProfile() {
|
||||
let timeout = TalkSystemSpeechSynthesizer.watchdogTimeoutSeconds(
|
||||
|
||||
@@ -1,14 +1,21 @@
|
||||
# Generated Docs Artifacts
|
||||
|
||||
These baseline artifacts are generated from the repo-owned OpenClaw config schema and bundled channel/plugin metadata.
|
||||
SHA-256 hash files are the tracked drift-detection artifacts. The full JSON
|
||||
baselines are generated locally (gitignored) for inspection only.
|
||||
|
||||
- Do not edit `config-baseline.json` by hand.
|
||||
- Do not edit `config-baseline.core.json` by hand.
|
||||
- Do not edit `config-baseline.channel.json` by hand.
|
||||
- Do not edit `config-baseline.plugin.json` by hand.
|
||||
- Do not edit `plugin-sdk-api-baseline.json` by hand.
|
||||
- Do not edit `plugin-sdk-api-baseline.jsonl` by hand.
|
||||
- Regenerate config baseline artifacts with `pnpm config:docs:gen`.
|
||||
- Validate config baseline artifacts in CI or locally with `pnpm config:docs:check`.
|
||||
- Regenerate Plugin SDK API baseline artifacts with `pnpm plugin-sdk:api:gen`.
|
||||
- Validate Plugin SDK API baseline artifacts in CI or locally with `pnpm plugin-sdk:api:check`.
|
||||
**Tracked (committed to git):**
|
||||
|
||||
- `config-baseline.sha256` — hashes of config baseline JSON artifacts.
|
||||
- `plugin-sdk-api-baseline.sha256` — hashes of Plugin SDK API baseline artifacts.
|
||||
|
||||
**Local only (gitignored):**
|
||||
|
||||
- `config-baseline.json`, `config-baseline.core.json`, `config-baseline.channel.json`, `config-baseline.plugin.json`
|
||||
- `plugin-sdk-api-baseline.json`, `plugin-sdk-api-baseline.jsonl`
|
||||
|
||||
Do not edit any of these files by hand.
|
||||
|
||||
- Regenerate config baseline: `pnpm config:docs:gen`
|
||||
- Validate config baseline: `pnpm config:docs:check`
|
||||
- Regenerate Plugin SDK API baseline: `pnpm plugin-sdk:api:gen`
|
||||
- Validate Plugin SDK API baseline: `pnpm plugin-sdk:api:check`
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
4
docs/.generated/config-baseline.sha256
Normal file
4
docs/.generated/config-baseline.sha256
Normal file
@@ -0,0 +1,4 @@
|
||||
20a882f9991e17310013471756ac7ec62c272e29490daeede9c0901bd51c0e69 config-baseline.json
|
||||
8ba6e5c959d5fc3eee9e6c5d1d8f764f164052f4207c0352bb39e2a7dbad64a8 config-baseline.core.json
|
||||
ca6d1fa8a3507566979ea2da2b88a6a7ae49d650f3ebd3eee14a22ed18e5be89 config-baseline.channel.json
|
||||
17fd37605bf6cb087932ec2ebcfa9dd22e669fa6b8b93081ab2deac9d24821c5 config-baseline.plugin.json
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
docs/.generated/plugin-sdk-api-baseline.sha256
Normal file
2
docs/.generated/plugin-sdk-api-baseline.sha256
Normal file
@@ -0,0 +1,2 @@
|
||||
cbffdf76d6a7254d8b2d3a601e1206d7b6c835bc44f170d4038bc711a35ef756 plugin-sdk-api-baseline.json
|
||||
fe026bf3ba1e3b55f6c0b560d76940f3c301d8f593d6f0f6dcc4625745c76d31 plugin-sdk-api-baseline.jsonl
|
||||
@@ -47,6 +47,38 @@
|
||||
"source": "Quick Start",
|
||||
"target": "快速开始"
|
||||
},
|
||||
{
|
||||
"source": "Chutes",
|
||||
"target": "Chutes"
|
||||
},
|
||||
{
|
||||
"source": "Qwen",
|
||||
"target": "Qwen"
|
||||
},
|
||||
{
|
||||
"source": "Feishu",
|
||||
"target": "Feishu"
|
||||
},
|
||||
{
|
||||
"source": "Mattermost",
|
||||
"target": "Mattermost"
|
||||
},
|
||||
{
|
||||
"source": "BytePlus (International)",
|
||||
"target": "BytePlus(国际版)"
|
||||
},
|
||||
{
|
||||
"source": "Anthropic (API + Claude CLI)",
|
||||
"target": "Anthropic(API + Claude CLI)"
|
||||
},
|
||||
{
|
||||
"source": "Moonshot AI",
|
||||
"target": "Moonshot AI"
|
||||
},
|
||||
{
|
||||
"source": "Additional bundled variants",
|
||||
"target": "其他内置变体"
|
||||
},
|
||||
{
|
||||
"source": "Diffs",
|
||||
"target": "Diffs"
|
||||
@@ -143,6 +175,10 @@
|
||||
"source": "Network model",
|
||||
"target": "网络模型"
|
||||
},
|
||||
{
|
||||
"source": "Bridge protocol (legacy nodes, historical)",
|
||||
"target": "Bridge protocol(旧版节点,历史参考)"
|
||||
},
|
||||
{
|
||||
"source": "Doctor",
|
||||
"target": "Doctor"
|
||||
@@ -151,6 +187,10 @@
|
||||
"source": "Polls",
|
||||
"target": "投票"
|
||||
},
|
||||
{
|
||||
"source": "QQ Bot",
|
||||
"target": "QQ Bot"
|
||||
},
|
||||
{
|
||||
"source": "Release Policy",
|
||||
"target": "发布策略"
|
||||
@@ -199,6 +239,14 @@
|
||||
"source": "CLI",
|
||||
"target": "CLI"
|
||||
},
|
||||
{
|
||||
"source": "/cli/gateway",
|
||||
"target": "/cli/gateway"
|
||||
},
|
||||
{
|
||||
"source": "/gateway#multiple-gateways-same-host",
|
||||
"target": "/gateway#multiple-gateways-same-host"
|
||||
},
|
||||
{
|
||||
"source": "install sanity",
|
||||
"target": "安装完整性检查"
|
||||
|
||||
3
docs/assets/sponsors/github-light.svg
Normal file
3
docs/assets/sponsors/github-light.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#111827" aria-hidden="true">
|
||||
<path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 829 B |
3
docs/assets/sponsors/github.svg
Normal file
3
docs/assets/sponsors/github.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#fff" aria-hidden="true">
|
||||
<path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 826 B |
@@ -17,13 +17,15 @@ This document defines the canonical credential eligibility and resolution semant
|
||||
|
||||
The goal is to keep selection-time and runtime behavior aligned.
|
||||
|
||||
## Stable Reason Codes
|
||||
## Stable Probe Reason Codes
|
||||
|
||||
- `ok`
|
||||
- `excluded_by_auth_order`
|
||||
- `missing_credential`
|
||||
- `invalid_expires`
|
||||
- `expired`
|
||||
- `unresolved_ref`
|
||||
- `no_model`
|
||||
|
||||
## Token Credentials
|
||||
|
||||
@@ -44,6 +46,24 @@ Token credentials (`type: "token"`) support inline `token` and/or `tokenRef`.
|
||||
2. For eligible profiles, token material may be resolved from inline value or `tokenRef`.
|
||||
3. Unresolvable refs produce `unresolved_ref` in `models status --probe` output.
|
||||
|
||||
## Explicit Auth Order Filtering
|
||||
|
||||
- When `auth.order.<provider>` or the auth-store order override is set for a
|
||||
provider, `models status --probe` only probes profile ids that remain in the
|
||||
resolved auth order for that provider.
|
||||
- A stored profile for that provider that is omitted from the explicit order is
|
||||
not silently tried later. Probe output reports it with
|
||||
`reasonCode: excluded_by_auth_order` and the detail
|
||||
`Excluded by auth.order for this provider.`
|
||||
|
||||
## Probe Target Resolution
|
||||
|
||||
- Probe targets can come from auth profiles, environment credentials, or
|
||||
`models.json`.
|
||||
- If a provider has credentials but OpenClaw cannot resolve a probeable model
|
||||
candidate for it, `models status --probe` reports `status: no_model` with
|
||||
`reasonCode: no_model`.
|
||||
|
||||
## OAuth SecretRef Policy Guard
|
||||
|
||||
- SecretRef input is for static credentials only.
|
||||
|
||||
@@ -36,6 +36,17 @@ openclaw cron runs --id <job-id>
|
||||
- Jobs persist at `~/.openclaw/cron/jobs.json` so restarts do not lose schedules.
|
||||
- All cron executions create [background task](/automation/tasks) records.
|
||||
- One-shot jobs (`--at`) auto-delete after success by default.
|
||||
- Isolated cron runs best-effort close tracked browser tabs/processes for their `cron:<jobId>` session when the run completes, so detached browser automation does not leave orphaned processes behind.
|
||||
- Isolated cron runs also guard against stale acknowledgement replies. If the
|
||||
first result is just an interim status update (`on it`, `pulling everything
|
||||
together`, and similar hints) and no descendant subagent run is still
|
||||
responsible for the final answer, OpenClaw re-prompts once for the actual
|
||||
result before delivery.
|
||||
|
||||
Task reconciliation for cron is runtime-owned: an active cron task stays live while the
|
||||
cron runtime still tracks that job as running, even if an old child session row still exists.
|
||||
Once the runtime stops owning the job and the 5-minute grace window expires, maintenance can
|
||||
mark the task `lost`.
|
||||
|
||||
## Schedule types
|
||||
|
||||
@@ -60,6 +71,12 @@ Recurring top-of-hour expressions are automatically staggered by up to 5 minutes
|
||||
|
||||
**Main session** jobs enqueue a system event and optionally wake the heartbeat (`--wake now` or `--wake next-heartbeat`). **Isolated** jobs run a dedicated agent turn with a fresh session. **Custom sessions** (`session:xxx`) persist context across runs, enabling workflows like daily standups that build on previous summaries.
|
||||
|
||||
For isolated jobs, runtime teardown now includes best-effort browser cleanup for that cron session. Cleanup failures are ignored so the actual cron result still wins.
|
||||
|
||||
When isolated cron runs orchestrate subagents, delivery also prefers the final
|
||||
descendant output over stale parent interim text. If descendants are still
|
||||
running, OpenClaw suppresses that partial parent update instead of announcing it.
|
||||
|
||||
### Payload options for isolated jobs
|
||||
|
||||
- `--message`: prompt text (required for isolated)
|
||||
@@ -67,6 +84,29 @@ Recurring top-of-hour expressions are automatically staggered by up to 5 minutes
|
||||
- `--light-context`: skip workspace bootstrap file injection
|
||||
- `--tools exec,read`: restrict which tools the job can use
|
||||
|
||||
`--model` uses the selected allowed model for that job. If the requested model
|
||||
is not allowed, cron logs a warning and falls back to the job's agent/default
|
||||
model selection instead. Configured fallback chains still apply, but a plain
|
||||
model override with no explicit per-job fallback list no longer appends the
|
||||
agent primary as a hidden extra retry target.
|
||||
|
||||
Model-selection precedence for isolated jobs is:
|
||||
|
||||
1. Gmail hook model override (when the run came from Gmail and that override is allowed)
|
||||
2. Per-job payload `model`
|
||||
3. Stored cron session model override
|
||||
4. Agent/default model selection
|
||||
|
||||
Fast mode follows the resolved live selection too. If the selected model config
|
||||
has `params.fastMode`, isolated cron uses that by default. A stored session
|
||||
`fastMode` override still wins over config in either direction.
|
||||
|
||||
If an isolated run hits a live model-switch handoff, cron retries with the
|
||||
switched provider/model and persists that live selection before retrying. When
|
||||
the switch also carries a new auth profile, cron persists that auth profile
|
||||
override too. Retries are bounded: after the initial attempt plus 2 switch
|
||||
retries, cron aborts instead of looping forever.
|
||||
|
||||
## Delivery and output
|
||||
|
||||
| Mode | What happens |
|
||||
@@ -77,6 +117,22 @@ Recurring top-of-hour expressions are automatically staggered by up to 5 minutes
|
||||
|
||||
Use `--announce --channel telegram --to "-1001234567890"` for channel delivery. For Telegram forum topics, use `-1001234567890:topic:123`. Slack/Discord/Mattermost targets should use explicit prefixes (`channel:<id>`, `user:<id>`).
|
||||
|
||||
For cron-owned isolated jobs, the runner owns the final delivery path. The
|
||||
agent is prompted to return a plain-text summary, and that summary is then sent
|
||||
through `announce`, `webhook`, or kept internal for `none`. `--no-deliver`
|
||||
does not hand delivery back to the agent; it keeps the run internal.
|
||||
|
||||
If the original task explicitly says to message some external recipient, the
|
||||
agent should note who/where that message should go in its output instead of
|
||||
trying to send it directly.
|
||||
|
||||
Failure notifications follow a separate destination path:
|
||||
|
||||
- `cron.failureDestination` sets a global default for failure notifications.
|
||||
- `job.delivery.failureDestination` overrides that per job.
|
||||
- If neither is set and the job already delivers via `announce`, failure notifications now fall back to that primary announce target.
|
||||
- `delivery.failureDestination` is only supported on `sessionTarget="isolated"` jobs unless the primary delivery mode is `webhook`.
|
||||
|
||||
## CLI examples
|
||||
|
||||
One-shot reminder (main session):
|
||||
@@ -163,7 +219,7 @@ Run an isolated agent turn:
|
||||
curl -X POST http://127.0.0.1:18789/hooks/agent \
|
||||
-H 'Authorization: Bearer SECRET' \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{"message":"Summarize inbox","name":"Email","model":"openai/gpt-5.2-mini"}'
|
||||
-d '{"message":"Summarize inbox","name":"Email","model":"openai/gpt-5.4-mini"}'
|
||||
```
|
||||
|
||||
Fields: `message` (required), `name`, `agentId`, `wakeMode`, `deliver`, `channel`, `to`, `model`, `thinking`, `timeoutSeconds`.
|
||||
@@ -176,8 +232,10 @@ Custom hook names are resolved via `hooks.mappings` in config. Mappings can tran
|
||||
|
||||
- Keep hook endpoints behind loopback, tailnet, or trusted reverse proxy.
|
||||
- Use a dedicated hook token; do not reuse gateway auth tokens.
|
||||
- Keep `hooks.path` on a dedicated subpath; `/` is rejected.
|
||||
- Set `hooks.allowedAgentIds` to limit explicit `agentId` routing.
|
||||
- Keep `hooks.allowRequestSessionKey=false` unless you require caller-selected sessions.
|
||||
- If you enable `hooks.allowRequestSessionKey`, also set `hooks.allowedSessionKeyPrefixes` to constrain allowed session key shapes.
|
||||
- Hook payloads are wrapped with safety boundaries by default.
|
||||
|
||||
## Gmail PubSub integration
|
||||
@@ -265,6 +323,17 @@ openclaw cron add --name "Ops sweep" --cron "0 6 * * *" --session isolated --mes
|
||||
openclaw cron edit <jobId> --clear-agent
|
||||
```
|
||||
|
||||
Model override note:
|
||||
|
||||
- `openclaw cron add|edit --model ...` changes the job's selected model.
|
||||
- If the model is allowed, that exact provider/model reaches the isolated agent
|
||||
run.
|
||||
- If it is not allowed, cron warns and falls back to the job's agent/default
|
||||
model selection.
|
||||
- Configured fallback chains still apply, but a plain `--model` override with
|
||||
no explicit per-job fallback list no longer falls through to the agent
|
||||
primary as a silent extra retry target.
|
||||
|
||||
## Configuration
|
||||
|
||||
```json5
|
||||
@@ -313,13 +382,19 @@ openclaw doctor
|
||||
- Check `cron.enabled` and `OPENCLAW_SKIP_CRON` env var.
|
||||
- Confirm the Gateway is running continuously.
|
||||
- For `cron` schedules, verify timezone (`--tz`) vs the host timezone.
|
||||
- `reason: not-due` in run output means manual run called without `--force`.
|
||||
- `reason: not-due` in run output means manual run was checked with `openclaw cron run <jobId> --due` and the job was not due yet.
|
||||
|
||||
### Cron fired but no delivery
|
||||
|
||||
- Delivery mode is `none` means no external message is expected.
|
||||
- Delivery target missing/invalid (`channel`/`to`) means outbound was skipped.
|
||||
- Channel auth errors (`unauthorized`, `Forbidden`) mean delivery was blocked by credentials.
|
||||
- If the isolated run returns only the silent token (`NO_REPLY` / `no_reply`),
|
||||
OpenClaw suppresses direct outbound delivery and also suppresses the fallback
|
||||
queued summary path, so nothing is posted back to chat.
|
||||
- For cron-owned isolated jobs, do not expect the agent to use the message tool
|
||||
as a fallback. The runner owns final delivery; `--no-deliver` keeps it
|
||||
internal instead of allowing a direct send.
|
||||
|
||||
### Timezone gotchas
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ See [Hooks](/automation/hooks).
|
||||
|
||||
### Heartbeat
|
||||
|
||||
Heartbeat is a periodic main-session turn (default every 30 minutes). It batches multiple checks (inbox, calendar, notifications) in one agent turn with full session context. Heartbeat turns do not create task records. Use `HEARTBEAT.md` to define what the agent checks.
|
||||
Heartbeat is a periodic main-session turn (default every 30 minutes). It batches multiple checks (inbox, calendar, notifications) in one agent turn with full session context. Heartbeat turns do not create task records. Use `HEARTBEAT.md` for a small checklist, or a `tasks:` block when you want due-only periodic checks inside heartbeat itself. Empty heartbeat files skip as `empty-heartbeat-file`; due-only task mode skips as `no-tasks-due`.
|
||||
|
||||
See [Heartbeat](/gateway/heartbeat).
|
||||
|
||||
|
||||
@@ -25,6 +25,14 @@ Not every agent run creates a task. Heartbeat turns and normal interactive chat
|
||||
- Tasks are **records**, not schedulers — cron and heartbeat decide _when_ work runs, tasks track _what happened_.
|
||||
- ACP, subagents, all cron jobs, and CLI operations create tasks. Heartbeat turns do not.
|
||||
- Each task moves through `queued → running → terminal` (succeeded, failed, timed_out, cancelled, or lost).
|
||||
- Cron tasks stay live while the cron runtime still owns the job; chat-backed CLI tasks stay live only while their owning run context is still active.
|
||||
- Completion is push-driven: detached work can notify directly or wake the
|
||||
requester session/heartbeat when it finishes, so status polling loops are
|
||||
usually the wrong shape.
|
||||
- Isolated cron runs and subagent completions best-effort clean up tracked browser tabs/processes for their child session before final cleanup bookkeeping.
|
||||
- Isolated cron delivery suppresses stale interim parent replies while
|
||||
descendant subagent work is still draining, and it prefers final descendant
|
||||
output when that arrives before delivery.
|
||||
- Completion notifications are delivered directly to a channel or queued for the next heartbeat.
|
||||
- `openclaw tasks list` shows all tasks; `openclaw tasks audit` surfaces issues.
|
||||
- Terminal records are kept for 7 days, then automatically pruned.
|
||||
@@ -50,6 +58,15 @@ openclaw tasks notify <lookup> state_changes
|
||||
|
||||
# Run a health audit
|
||||
openclaw tasks audit
|
||||
|
||||
# Preview or apply maintenance
|
||||
openclaw tasks maintenance
|
||||
openclaw tasks maintenance --apply
|
||||
|
||||
# Inspect TaskFlow state
|
||||
openclaw tasks flow list
|
||||
openclaw tasks flow show <lookup>
|
||||
openclaw tasks flow cancel <lookup>
|
||||
```
|
||||
|
||||
## What creates a task
|
||||
@@ -91,15 +108,22 @@ stateDiagram-v2
|
||||
| `failed` | Completed with an error |
|
||||
| `timed_out` | Exceeded the configured timeout |
|
||||
| `cancelled` | Stopped by the operator via `openclaw tasks cancel` |
|
||||
| `lost` | Backing child session disappeared (detected after a 5-minute grace period) |
|
||||
| `lost` | The runtime lost authoritative backing state after a 5-minute grace period |
|
||||
|
||||
Transitions happen automatically — when the associated agent run ends, the task status updates to match.
|
||||
|
||||
`lost` is runtime-aware:
|
||||
|
||||
- ACP tasks: backing ACP child session metadata disappeared.
|
||||
- Subagent tasks: backing child session disappeared from the target agent store.
|
||||
- Cron tasks: the cron runtime no longer tracks the job as active.
|
||||
- CLI tasks: isolated child-session tasks use the child session; chat-backed CLI tasks use the live run context instead, so lingering channel/group/direct session rows do not keep them alive.
|
||||
|
||||
## Delivery and notifications
|
||||
|
||||
When a task reaches a terminal state, OpenClaw notifies you. There are two delivery paths:
|
||||
|
||||
**Direct delivery** — if the task has a channel target (the `requesterOrigin`), the completion message goes straight to that channel (Telegram, Discord, Slack, etc.).
|
||||
**Direct delivery** — if the task has a channel target (the `requesterOrigin`), the completion message goes straight to that channel (Telegram, Discord, Slack, etc.). For subagent completions, OpenClaw also preserves bound thread/topic routing when available and can fill a missing `to` / account from the requester session's stored route (`lastChannel` / `lastTo` / `lastAccountId`) before giving up on direct delivery.
|
||||
|
||||
**Session-queued delivery** — if direct delivery fails or no origin is set, the update is queued as a system event in the requester's session and surfaces on the next heartbeat.
|
||||
|
||||
@@ -107,6 +131,10 @@ When a task reaches a terminal state, OpenClaw notifies you. There are two deliv
|
||||
Task completion triggers an immediate heartbeat wake so you see the result quickly — you do not have to wait for the next scheduled heartbeat tick.
|
||||
</Tip>
|
||||
|
||||
That means the usual workflow is push-based: start detached work once, then let
|
||||
the runtime wake or notify you on completion. Poll task state only when you
|
||||
need debugging, intervention, or an explicit audit.
|
||||
|
||||
### Notification policies
|
||||
|
||||
Control how much you hear about each task:
|
||||
@@ -167,11 +195,47 @@ Surfaces operational issues. Findings also appear in `openclaw status` when issu
|
||||
| ------------------------- | -------- | ----------------------------------------------------- |
|
||||
| `stale_queued` | warn | Queued for more than 10 minutes |
|
||||
| `stale_running` | error | Running for more than 30 minutes |
|
||||
| `lost` | error | Backing session is gone |
|
||||
| `lost` | error | Runtime-backed task ownership disappeared |
|
||||
| `delivery_failed` | warn | Delivery failed and notify policy is not `silent` |
|
||||
| `missing_cleanup` | warn | Terminal task with no cleanup timestamp |
|
||||
| `inconsistent_timestamps` | warn | Timeline violation (for example ended before started) |
|
||||
|
||||
### `tasks maintenance`
|
||||
|
||||
```bash
|
||||
openclaw tasks maintenance [--json]
|
||||
openclaw tasks maintenance --apply [--json]
|
||||
```
|
||||
|
||||
Use this to preview or apply reconciliation, cleanup stamping, and pruning for
|
||||
tasks and Task Flow state.
|
||||
|
||||
Reconciliation is runtime-aware:
|
||||
|
||||
- ACP/subagent tasks check their backing child session.
|
||||
- Cron tasks check whether the cron runtime still owns the job.
|
||||
- Chat-backed CLI tasks check the owning live run context, not just the chat session row.
|
||||
|
||||
Completion cleanup is also runtime-aware:
|
||||
|
||||
- Subagent completion best-effort closes tracked browser tabs/processes for the child session before announce cleanup continues.
|
||||
- Isolated cron completion best-effort closes tracked browser tabs/processes for the cron session before the run fully tears down.
|
||||
- Isolated cron delivery waits out descendant subagent follow-up when needed and
|
||||
suppresses stale parent acknowledgement text instead of announcing it.
|
||||
- Subagent completion delivery prefers the latest visible assistant text; if that is empty it falls back to sanitized latest tool/toolResult text, and timeout-only tool-call runs can collapse to a short partial-progress summary.
|
||||
- Cleanup failures do not mask the real task outcome.
|
||||
|
||||
### `tasks flow list|show|cancel`
|
||||
|
||||
```bash
|
||||
openclaw tasks flow list [--status <status>] [--json]
|
||||
openclaw tasks flow show <lookup> [--json]
|
||||
openclaw tasks flow cancel <lookup>
|
||||
```
|
||||
|
||||
Use these when the orchestrating Task Flow is the thing you care about rather
|
||||
than one individual background task record.
|
||||
|
||||
## Chat task board (`/tasks`)
|
||||
|
||||
Use `/tasks` in any chat session to see background tasks linked to that session. The board shows
|
||||
@@ -216,7 +280,7 @@ The registry loads into memory at gateway start and syncs writes to SQLite for d
|
||||
|
||||
A sweeper runs every **60 seconds** and handles three things:
|
||||
|
||||
1. **Reconciliation** — checks if active tasks' backing sessions still exist. If a child session has been gone for more than 5 minutes, the task is marked `lost`.
|
||||
1. **Reconciliation** — checks whether active tasks still have authoritative runtime backing. ACP/subagent tasks use child-session state, cron tasks use active-job ownership, and chat-backed CLI tasks use the owning run context. If that backing state is gone for more than 5 minutes, the task is marked `lost`.
|
||||
2. **Cleanup stamping** — sets a `cleanupAfter` timestamp on terminal tasks (endedAt + 7 days).
|
||||
3. **Pruning** — deletes records past their `cleanupAfter` date.
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ OpenClaw supports Brave Search API as a `web_search` provider.
|
||||
config: {
|
||||
webSearch: {
|
||||
apiKey: "BRAVE_API_KEY_HERE",
|
||||
mode: "web", // or "llm-context"
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -46,6 +47,11 @@ OpenClaw supports Brave Search API as a `web_search` provider.
|
||||
Provider-specific Brave search settings now live under `plugins.entries.brave.config.webSearch.*`.
|
||||
Legacy `tools.web.search.apiKey` still loads through the compatibility shim, but it is no longer the canonical config path.
|
||||
|
||||
`webSearch.mode` controls the Brave transport:
|
||||
|
||||
- `web` (default): normal Brave web search with titles, URLs, and snippets
|
||||
- `llm-context`: Brave LLM Context API with pre-extracted text chunks and sources for grounding
|
||||
|
||||
## Tool parameters
|
||||
|
||||
| Parameter | Description |
|
||||
@@ -54,6 +60,7 @@ Legacy `tools.web.search.apiKey` still loads through the compatibility shim, but
|
||||
| `count` | Number of results to return (1-10, default: 5) |
|
||||
| `country` | 2-letter ISO country code (e.g., "US", "DE") |
|
||||
| `language` | ISO 639-1 language code for search results (e.g., "en", "de", "fr") |
|
||||
| `search_lang` | Brave search-language code (e.g., `en`, `en-gb`, `zh-hans`) |
|
||||
| `ui_lang` | ISO language code for UI elements |
|
||||
| `freshness` | Time filter: `day` (24h), `week`, `month`, or `year` |
|
||||
| `date_after` | Only results published after this date (YYYY-MM-DD) |
|
||||
@@ -88,6 +95,9 @@ await web_search({
|
||||
- OpenClaw uses the Brave **Search** plan. If you have a legacy subscription (e.g. the original Free plan with 2,000 queries/month), it remains valid but does not include newer features like LLM Context or higher rate limits.
|
||||
- Each Brave plan includes **\$5/month in free credit** (renewing). The Search plan costs \$5 per 1,000 requests, so the credit covers 1,000 queries/month. Set your usage limit in the Brave dashboard to avoid unexpected charges. See the [Brave API portal](https://brave.com/search/api/) for current plans.
|
||||
- The Search plan includes the LLM Context endpoint and AI inference rights. Storing results to train or tune models requires a plan with explicit storage rights. See the Brave [Terms of Service](https://api-dashboard.search.brave.com/terms-of-service).
|
||||
- `llm-context` mode returns grounded source entries instead of the normal web-search snippet shape.
|
||||
- `llm-context` mode does not support `ui_lang`, `freshness`, `date_after`, or `date_before`.
|
||||
- `ui_lang` must include a region subtag like `en-US`.
|
||||
- Results are cached for 15 minutes by default (configurable via `cacheTtlMinutes`).
|
||||
|
||||
See [Web tools](/tools/web) for the full web_search configuration.
|
||||
|
||||
@@ -11,6 +11,11 @@ title: "BlueBubbles"
|
||||
|
||||
Status: bundled plugin that talks to the BlueBubbles macOS server over HTTP. **Recommended for iMessage integration** due to its richer API and easier setup compared to the legacy imsg channel.
|
||||
|
||||
## Bundled plugin
|
||||
|
||||
Current OpenClaw releases bundle BlueBubbles, so normal packaged builds do not
|
||||
need a separate `openclaw plugins install` step.
|
||||
|
||||
## Overview
|
||||
|
||||
- Runs on macOS via the BlueBubbles helper app ([bluebubbles.app](https://bluebubbles.app)).
|
||||
@@ -404,9 +409,9 @@ Prefer `chat_guid` for stable routing:
|
||||
|
||||
## Security
|
||||
|
||||
- Webhook requests are authenticated by comparing `guid`/`password` query params or headers against `channels.bluebubbles.password`. Requests from `localhost` are also accepted.
|
||||
- Webhook requests are authenticated by comparing `guid`/`password` query params or headers against `channels.bluebubbles.password`.
|
||||
- Keep the API password and webhook endpoint secret (treat them like credentials).
|
||||
- Localhost trust means a same-host reverse proxy can unintentionally bypass the password. If you proxy the gateway, require auth at the proxy and configure `gateway.trustedProxies`. See [Gateway security](/gateway/security#reverse-proxy-configuration).
|
||||
- There is no localhost bypass for BlueBubbles webhook auth. If you proxy webhook traffic, keep the BlueBubbles password on the request end-to-end. `gateway.trustedProxies` does not replace `channels.bluebubbles.password` here. See [Gateway security](/gateway/security#reverse-proxy-configuration).
|
||||
- Enable HTTPS + firewall rules on the BlueBubbles server if exposing it outside your LAN.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
@@ -944,21 +944,24 @@ Default slash command settings:
|
||||
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Exec approvals in Discord">
|
||||
Discord supports button-based exec approvals in DMs and can optionally post approval prompts in the originating channel.
|
||||
<Accordion title="Approvals in Discord">
|
||||
Discord supports button-based approval handling in DMs and can optionally post approval prompts in the originating channel.
|
||||
|
||||
Config path:
|
||||
|
||||
- `channels.discord.execApprovals.enabled`
|
||||
- `channels.discord.execApprovals.approvers` (optional; falls back to owner IDs inferred from `allowFrom` and explicit DM `defaultTo` when possible)
|
||||
- `channels.discord.execApprovals.approvers` (optional; falls back to `commands.ownerAllowFrom` when possible)
|
||||
- `channels.discord.execApprovals.target` (`dm` | `channel` | `both`, default: `dm`)
|
||||
- `agentFilter`, `sessionFilter`, `cleanupAfterResolve`
|
||||
|
||||
Discord auto-enables native exec approvals when `enabled` is unset or `"auto"` and at least one approver can be resolved, either from `execApprovals.approvers` or from the account's existing owner config (`allowFrom`, legacy `dm.allowFrom`, or explicit DM `defaultTo`). Set `enabled: false` to disable Discord as a native approval client explicitly.
|
||||
Discord auto-enables native exec approvals when `enabled` is unset or `"auto"` and at least one approver can be resolved, either from `execApprovals.approvers` or from `commands.ownerAllowFrom`. Discord does not infer exec approvers from channel `allowFrom`, legacy `dm.allowFrom`, or direct-message `defaultTo`. Set `enabled: false` to disable Discord as a native approval client explicitly.
|
||||
|
||||
When `target` is `channel` or `both`, the approval prompt is visible in the channel. Only resolved approvers can use the buttons; other users receive an ephemeral denial. Approval prompts include the command text, so only enable channel delivery in trusted channels. If the channel ID cannot be derived from the session key, OpenClaw falls back to DM delivery.
|
||||
|
||||
Discord also renders the shared approval buttons used by other chat channels. The native Discord adapter mainly adds approver DM routing and channel fanout.
|
||||
When those buttons are present, they are the primary approval UX; OpenClaw
|
||||
should only include a manual `/approve` command when the tool result says
|
||||
chat approvals are unavailable or manual approval is the only path.
|
||||
|
||||
Gateway auth for this handler uses the same shared credential resolution contract as other Gateway clients:
|
||||
|
||||
@@ -967,7 +970,16 @@ Default slash command settings:
|
||||
- remote-mode support via `gateway.remote.*` when applicable
|
||||
- URL overrides are override-safe: CLI overrides do not reuse implicit credentials, and env overrides use env credentials only
|
||||
|
||||
Exec approvals expire after 30 minutes by default. If approvals fail with unknown approval IDs, verify approver resolution and feature enablement.
|
||||
Approval resolution behavior:
|
||||
|
||||
- IDs prefixed with `plugin:` resolve through `plugin.approval.resolve`.
|
||||
- Other IDs resolve through `exec.approval.resolve`.
|
||||
- Discord does not do an extra exec-to-plugin fallback hop here; the id
|
||||
prefix decides which gateway method it calls.
|
||||
|
||||
Exec approvals expire after 30 minutes by default. If approvals fail with
|
||||
unknown approval IDs, verify approver resolution, feature enablement, and
|
||||
that the delivered approval id kind matches the pending request.
|
||||
|
||||
Related docs: [Exec approvals](/tools/exec-approvals)
|
||||
|
||||
|
||||
@@ -764,7 +764,8 @@ When the agent handles a Drive comment event, it receives:
|
||||
- the comment thread context for in-thread replies
|
||||
|
||||
After making document edits, the agent is guided to use `feishu_drive.reply_comment` to notify the
|
||||
commenter and then output `NO_REPLY` to avoid duplicate sends.
|
||||
commenter and then output the exact silent token `NO_REPLY` / `no_reply` to
|
||||
avoid duplicate sends.
|
||||
|
||||
## Runtime action surface
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ Note: `agents.list[].groupChat.mentionPatterns` is now used by Telegram/Discord/
|
||||
|
||||
## Current implementation (2025-12-03)
|
||||
|
||||
- Activation modes: `mention` (default) or `always`. `mention` requires a ping (real WhatsApp @-mentions via `mentionedJids`, safe regex patterns, or the bot’s E.164 anywhere in the text). `always` wakes the agent on every message but it should reply only when it can add meaningful value; otherwise it returns the silent token `NO_REPLY`. Defaults can be set in config (`channels.whatsapp.groups`) and overridden per group via `/activation`. When `channels.whatsapp.groups` is set, it also acts as a group allowlist (include `"*"` to allow all).
|
||||
- Activation modes: `mention` (default) or `always`. `mention` requires a ping (real WhatsApp @-mentions via `mentionedJids`, safe regex patterns, or the bot’s E.164 anywhere in the text). `always` wakes the agent on every message but it should reply only when it can add meaningful value; otherwise it returns the exact silent token `NO_REPLY` / `no_reply`. Defaults can be set in config (`channels.whatsapp.groups`) and overridden per group via `/activation`. When `channels.whatsapp.groups` is set, it also acts as a group allowlist (include `"*"` to allow all).
|
||||
- Group policy: `channels.whatsapp.groupPolicy` controls whether group messages are accepted (`open|disabled|allowlist`). `allowlist` uses `channels.whatsapp.groupAllowFrom` (fallback: explicit `channels.whatsapp.allowFrom`). Default is `allowlist` (blocked until you add senders).
|
||||
- Per-group sessions: session keys look like `agent:<agentId>:whatsapp:group:<jid>` so commands such as `/verbose on` or `/think high` (sent as standalone messages) are scoped to that group; personal DM state is untouched. Heartbeats are skipped for group threads.
|
||||
- Context injection: **pending-only** group messages (default 50) that _did not_ trigger a run are prefixed under `[Chat messages since your last reply - for context]`, with the triggering line under `[Current message - respond to this]`. Messages already in the session are not re-injected.
|
||||
|
||||
@@ -13,31 +13,31 @@ Text is supported everywhere; media and reactions vary by channel.
|
||||
|
||||
## Supported channels
|
||||
|
||||
- [BlueBubbles](/channels/bluebubbles) — **Recommended for iMessage**; uses the BlueBubbles macOS server REST API with full feature support (edit, unsend, effects, reactions, group management — edit currently broken on macOS 26 Tahoe).
|
||||
- [BlueBubbles](/channels/bluebubbles) — **Recommended for iMessage**; uses the BlueBubbles macOS server REST API with full feature support (bundled plugin; edit, unsend, effects, reactions, group management — edit currently broken on macOS 26 Tahoe).
|
||||
- [Discord](/channels/discord) — Discord Bot API + Gateway; supports servers, channels, and DMs.
|
||||
- [Feishu](/channels/feishu) — Feishu/Lark bot via WebSocket (plugin, installed separately).
|
||||
- [Feishu](/channels/feishu) — Feishu/Lark bot via WebSocket (bundled plugin).
|
||||
- [Google Chat](/channels/googlechat) — Google Chat API app via HTTP webhook.
|
||||
- [iMessage (legacy)](/channels/imessage) — Legacy macOS integration via imsg CLI (deprecated, use BlueBubbles for new setups).
|
||||
- [IRC](/channels/irc) — Classic IRC servers; channels + DMs with pairing/allowlist controls.
|
||||
- [LINE](/channels/line) — LINE Messaging API bot (plugin, installed separately).
|
||||
- [Matrix](/channels/matrix) — Matrix protocol (plugin, installed separately).
|
||||
- [Mattermost](/channels/mattermost) — Bot API + WebSocket; channels, groups, DMs (plugin, installed separately).
|
||||
- [Microsoft Teams](/channels/msteams) — Bot Framework; enterprise support (plugin, installed separately).
|
||||
- [Nextcloud Talk](/channels/nextcloud-talk) — Self-hosted chat via Nextcloud Talk (plugin, installed separately).
|
||||
- [Nostr](/channels/nostr) — Decentralized DMs via NIP-04 (plugin, installed separately).
|
||||
- [QQ Bot](/channels/qqbot) — QQ Bot API; private chat, group chat, and rich media.
|
||||
- [LINE](/channels/line) — LINE Messaging API bot (bundled plugin).
|
||||
- [Matrix](/channels/matrix) — Matrix protocol (bundled plugin).
|
||||
- [Mattermost](/channels/mattermost) — Bot API + WebSocket; channels, groups, DMs (bundled plugin).
|
||||
- [Microsoft Teams](/channels/msteams) — Bot Framework; enterprise support (bundled plugin).
|
||||
- [Nextcloud Talk](/channels/nextcloud-talk) — Self-hosted chat via Nextcloud Talk (bundled plugin).
|
||||
- [Nostr](/channels/nostr) — Decentralized DMs via NIP-04 (bundled plugin).
|
||||
- [QQ Bot](/channels/qqbot) — QQ Bot API; private chat, group chat, and rich media (bundled plugin).
|
||||
- [Signal](/channels/signal) — signal-cli; privacy-focused.
|
||||
- [Slack](/channels/slack) — Bolt SDK; workspace apps.
|
||||
- [Synology Chat](/channels/synology-chat) — Synology NAS Chat via outgoing+incoming webhooks (plugin, installed separately).
|
||||
- [Synology Chat](/channels/synology-chat) — Synology NAS Chat via outgoing+incoming webhooks (bundled plugin).
|
||||
- [Telegram](/channels/telegram) — Bot API via grammY; supports groups.
|
||||
- [Tlon](/channels/tlon) — Urbit-based messenger (plugin, installed separately).
|
||||
- [Twitch](/channels/twitch) — Twitch chat via IRC connection (plugin, installed separately).
|
||||
- [Tlon](/channels/tlon) — Urbit-based messenger (bundled plugin).
|
||||
- [Twitch](/channels/twitch) — Twitch chat via IRC connection (bundled plugin).
|
||||
- [Voice Call](/plugins/voice-call) — Telephony via Plivo or Twilio (plugin, installed separately).
|
||||
- [WebChat](/web/webchat) — Gateway WebChat UI over WebSocket.
|
||||
- [WeChat](https://www.npmjs.com/package/@tencent-weixin/openclaw-weixin) — Tencent iLink Bot plugin via QR login; private chats only.
|
||||
- [WhatsApp](/channels/whatsapp) — Most popular; uses Baileys and requires QR pairing.
|
||||
- [Zalo](/channels/zalo) — Zalo Bot API; Vietnam's popular messenger (plugin, installed separately).
|
||||
- [Zalo Personal](/channels/zalouser) — Zalo personal account via QR login (plugin, installed separately).
|
||||
- [Zalo](/channels/zalo) — Zalo Bot API; Vietnam's popular messenger (bundled plugin).
|
||||
- [Zalo Personal](/channels/zalouser) — Zalo personal account via QR login (bundled plugin).
|
||||
|
||||
## Notes
|
||||
|
||||
|
||||
@@ -7,19 +7,23 @@ read_when:
|
||||
title: LINE
|
||||
---
|
||||
|
||||
# LINE (plugin)
|
||||
# LINE
|
||||
|
||||
LINE connects to OpenClaw via the LINE Messaging API. The plugin runs as a webhook
|
||||
receiver on the gateway and uses your channel access token + channel secret for
|
||||
authentication.
|
||||
|
||||
Status: supported via plugin. Direct messages, group chats, media, locations, Flex
|
||||
Status: bundled plugin. Direct messages, group chats, media, locations, Flex
|
||||
messages, template messages, and quick replies are supported. Reactions and threads
|
||||
are not supported.
|
||||
|
||||
## Plugin required
|
||||
## Bundled plugin
|
||||
|
||||
Install the LINE plugin:
|
||||
LINE ships as a bundled plugin in current OpenClaw releases, so normal
|
||||
packaged builds do not need a separate install.
|
||||
|
||||
If you are on an older build or a custom install that excludes LINE, install it
|
||||
manually:
|
||||
|
||||
```bash
|
||||
openclaw plugins install @openclaw/line
|
||||
|
||||
@@ -6,14 +6,18 @@ read_when:
|
||||
title: "Matrix"
|
||||
---
|
||||
|
||||
# Matrix (plugin)
|
||||
# Matrix
|
||||
|
||||
Matrix is the Matrix channel plugin for OpenClaw.
|
||||
Matrix is the Matrix bundled channel plugin for OpenClaw.
|
||||
It uses the official `matrix-js-sdk` and supports DMs, rooms, threads, media, reactions, polls, location, and E2EE.
|
||||
|
||||
## Plugin required
|
||||
## Bundled plugin
|
||||
|
||||
Matrix is a plugin and is not bundled with core OpenClaw.
|
||||
Matrix ships as a bundled plugin in current OpenClaw releases, so normal
|
||||
packaged builds do not need a separate install.
|
||||
|
||||
If you are on an older build or a custom install that excludes Matrix, install
|
||||
it manually:
|
||||
|
||||
Install from npm:
|
||||
|
||||
@@ -31,7 +35,9 @@ See [Plugins](/tools/plugin) for plugin behavior and install rules.
|
||||
|
||||
## Setup
|
||||
|
||||
1. Install the plugin.
|
||||
1. Ensure the Matrix plugin is available.
|
||||
- Current packaged OpenClaw releases already bundle it.
|
||||
- Older/custom installs can add it manually with the commands above.
|
||||
2. Create a Matrix account on your homeserver.
|
||||
3. Configure `channels.matrix` with either:
|
||||
- `homeserver` + `accessToken`, or
|
||||
@@ -319,7 +325,9 @@ Verbose restore diagnostics:
|
||||
openclaw matrix verify backup restore --verbose
|
||||
```
|
||||
|
||||
Delete the current server backup and create a fresh backup baseline:
|
||||
Delete the current server backup and create a fresh backup baseline. If the stored
|
||||
backup key cannot be loaded cleanly, this reset can also recreate secret storage so
|
||||
future cold starts can load the new backup key:
|
||||
|
||||
```bash
|
||||
openclaw matrix verify backup reset --yes
|
||||
@@ -366,8 +374,11 @@ If the homeserver requires interactive auth to upload cross-signing keys, OpenCl
|
||||
|
||||
Use `--force-reset-cross-signing` only when you intentionally want to discard the current cross-signing identity and create a new one.
|
||||
|
||||
If you intentionally want to discard the current room-key backup and start a new backup baseline for future messages, use `openclaw matrix verify backup reset --yes`.
|
||||
Do this only when you accept that unrecoverable old encrypted history will stay unavailable.
|
||||
If you intentionally want to discard the current room-key backup and start a new
|
||||
backup baseline for future messages, use `openclaw matrix verify backup reset --yes`.
|
||||
Do this only when you accept that unrecoverable old encrypted history will stay
|
||||
unavailable and that OpenClaw may recreate secret storage if the current backup
|
||||
secret cannot be loaded safely.
|
||||
|
||||
### Fresh backup baseline
|
||||
|
||||
@@ -656,6 +667,12 @@ Matrix can act as an exec approval client for a Matrix account.
|
||||
|
||||
Approvers must be Matrix user IDs such as `@owner:example.org`. Matrix auto-enables native exec approvals when `enabled` is unset or `"auto"` and at least one approver can be resolved, either from `execApprovals.approvers` or from `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 exec approval fallback policy.
|
||||
|
||||
Native Matrix routing is exec-only today:
|
||||
|
||||
- `channels.matrix.execApprovals.*` controls native DM/channel routing for exec approvals only.
|
||||
- Plugin approvals still use shared same-chat `/approve` plus any configured `approvals.plugin` forwarding.
|
||||
- Matrix can still reuse `channels.matrix.dm.allowFrom` for plugin-approval authorization when it can infer approvers safely, but it does not expose a separate native plugin-approval DM/channel fanout path.
|
||||
|
||||
Delivery rules:
|
||||
|
||||
- `target: "dm"` sends approval prompts to approver DMs
|
||||
@@ -666,7 +683,7 @@ Matrix uses text approval prompts today. Approvers resolve them with `/approve <
|
||||
|
||||
Only resolved approvers can approve or deny. 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 surface is transport only: room/DM routing and message send/update/delete behavior.
|
||||
Matrix approval prompts reuse the shared core approval planner. The Matrix-specific native surface is transport only for exec approvals: room/DM routing and message send/update/delete behavior.
|
||||
|
||||
Per-account override:
|
||||
|
||||
@@ -708,6 +725,7 @@ Top-level `channels.matrix` values act as defaults for named accounts unless an
|
||||
You can scope inherited room entries to one Matrix account with `groups.<room>.account` (or legacy `rooms.<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.
|
||||
Set `defaultAccount` when you want OpenClaw to prefer one named Matrix account for implicit routing, probing, and CLI operations.
|
||||
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.
|
||||
|
||||
@@ -6,15 +6,19 @@ read_when:
|
||||
title: "Mattermost"
|
||||
---
|
||||
|
||||
# Mattermost (plugin)
|
||||
# Mattermost
|
||||
|
||||
Status: supported via plugin (bot token + WebSocket events). Channels, groups, and DMs are supported.
|
||||
Status: bundled plugin (bot token + WebSocket events). Channels, groups, and DMs are supported.
|
||||
Mattermost is a self-hostable team messaging platform; see the official site at
|
||||
[mattermost.com](https://mattermost.com) for product details and downloads.
|
||||
|
||||
## Plugin required
|
||||
## Bundled plugin
|
||||
|
||||
Mattermost ships as a plugin and is not bundled with the core install.
|
||||
Mattermost ships as a bundled plugin in current OpenClaw releases, so normal
|
||||
packaged builds do not need a separate install.
|
||||
|
||||
If you are on an older build or a custom install that excludes Mattermost,
|
||||
install it manually:
|
||||
|
||||
Install via CLI (npm registry):
|
||||
|
||||
@@ -28,14 +32,13 @@ Local checkout (when running from a git repo):
|
||||
openclaw plugins install ./path/to/local/mattermost-plugin
|
||||
```
|
||||
|
||||
If you choose Mattermost during setup and a git checkout is detected,
|
||||
OpenClaw will offer the local install path automatically.
|
||||
|
||||
Details: [Plugins](/tools/plugin)
|
||||
|
||||
## Quick setup
|
||||
|
||||
1. Install the Mattermost plugin.
|
||||
1. Ensure the Mattermost plugin is available.
|
||||
- Current packaged OpenClaw releases already bundle it.
|
||||
- Older/custom installs can add it manually with the commands above.
|
||||
2. Create a Mattermost bot account and copy the **bot token**.
|
||||
3. Copy the Mattermost **base URL** (e.g., `https://chat.example.com`).
|
||||
4. Configure OpenClaw and start the gateway.
|
||||
@@ -82,7 +85,10 @@ Notes:
|
||||
- If `callbackUrl` is omitted, OpenClaw derives one from gateway host/port + `callbackPath`.
|
||||
- For multi-account setups, `commands` can be set at the top level or under
|
||||
`channels.mattermost.accounts.<id>.commands` (account values override top-level fields).
|
||||
- Command callbacks are validated with per-command tokens and fail closed when token checks fail.
|
||||
- Command callbacks are validated with the per-command tokens returned by
|
||||
Mattermost when OpenClaw registers `oc_*` commands.
|
||||
- Slash callbacks fail closed when registration failed, startup was partial, or
|
||||
the callback token does not match one of the registered commands.
|
||||
- Reachability requirement: the callback endpoint must be reachable from the Mattermost server.
|
||||
- Do not set `callbackUrl` to `localhost` unless Mattermost runs on the same host/network namespace as OpenClaw.
|
||||
- Do not set `callbackUrl` to your Mattermost base URL unless that URL reverse-proxies `/api/channels/mattermost/command` to OpenClaw.
|
||||
@@ -170,10 +176,28 @@ Notes:
|
||||
|
||||
- Default: `channels.mattermost.groupPolicy = "allowlist"` (mention-gated).
|
||||
- Allowlist senders with `channels.mattermost.groupAllowFrom` (user IDs recommended).
|
||||
- Per-channel mention overrides live under `channels.mattermost.groups.<channelId>.requireMention`
|
||||
or `channels.mattermost.groups["*"].requireMention` for a default.
|
||||
- `@username` matching is mutable and only enabled when `channels.mattermost.dangerouslyAllowNameMatching: true`.
|
||||
- Open channels: `channels.mattermost.groupPolicy="open"` (mention-gated).
|
||||
- Runtime note: if `channels.mattermost` is completely missing, runtime falls back to `groupPolicy="allowlist"` for group checks (even if `channels.defaults.groupPolicy` is set).
|
||||
|
||||
Example:
|
||||
|
||||
```json5
|
||||
{
|
||||
channels: {
|
||||
mattermost: {
|
||||
groupPolicy: "open",
|
||||
groups: {
|
||||
"*": { requireMention: true },
|
||||
"team-channel-id": { requireMention: false },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
## Targets for outbound delivery
|
||||
|
||||
Use these target formats with `openclaw message send` or cron/webhooks:
|
||||
@@ -418,6 +442,19 @@ Mattermost supports multiple accounts under `channels.mattermost.accounts`:
|
||||
- No replies in channels: ensure the bot is in the channel and mention it (oncall), use a trigger prefix (onchar), or set `chatmode: "onmessage"`.
|
||||
- Auth errors: check the bot token, base URL, and whether the account is enabled.
|
||||
- Multi-account issues: env vars only apply to the `default` account.
|
||||
- Native slash commands return `Unauthorized: invalid command token.`: OpenClaw
|
||||
did not accept the callback token. Typical causes:
|
||||
- slash command registration failed or only partially completed at startup
|
||||
- the callback is hitting the wrong gateway/account
|
||||
- Mattermost still has old commands pointing at a previous callback target
|
||||
- the gateway restarted without reactivating slash commands
|
||||
- If native slash commands stop working, check logs for
|
||||
`mattermost: failed to register slash commands` or
|
||||
`mattermost: native slash commands enabled but no commands could be registered`.
|
||||
- If `callbackUrl` is omitted and logs warn that the callback resolved to
|
||||
`http://127.0.0.1:18789/...`, that URL is probably only reachable when
|
||||
Mattermost runs on the same host/network namespace as OpenClaw. Set an
|
||||
explicit externally reachable `commands.callbackUrl` instead.
|
||||
- Buttons appear as white boxes: the agent may be sending malformed button data. Check that each button has both `text` and `callback_data` fields.
|
||||
- Buttons render but clicks do nothing: verify `AllowedUntrustedInternalConnections` in Mattermost server config includes `127.0.0.1 localhost`, and that `EnablePostActionIntegration` is `true` in ServiceSettings.
|
||||
- Buttons return 404 on click: the button `id` likely contains hyphens or underscores. Mattermost's action router breaks on non-alphanumeric IDs. Use `[a-zA-Z0-9]` only.
|
||||
|
||||
@@ -5,7 +5,7 @@ read_when:
|
||||
title: "Microsoft Teams"
|
||||
---
|
||||
|
||||
# Microsoft Teams (plugin)
|
||||
# Microsoft Teams
|
||||
|
||||
> "Abandon all hope, ye who enter here."
|
||||
|
||||
@@ -13,15 +13,13 @@ Updated: 2026-01-21
|
||||
|
||||
Status: text + DM attachments are supported; channel/group file sending requires `sharePointSiteId` + Graph permissions (see [Sending files in group chats](#sending-files-in-group-chats)). Polls are sent via Adaptive Cards. Message actions expose explicit `upload-file` for file-first sends.
|
||||
|
||||
## Plugin required
|
||||
## Bundled plugin
|
||||
|
||||
Microsoft Teams ships as a plugin and is not bundled with the core install.
|
||||
Microsoft Teams ships as a bundled plugin in current OpenClaw releases, so no
|
||||
separate install is required in the normal packaged build.
|
||||
|
||||
**Breaking change (2026.1.15):** Microsoft Teams moved out of core. If you use it, you must install the plugin.
|
||||
|
||||
Explainable: keeps core installs lighter and lets Microsoft Teams dependencies update independently.
|
||||
|
||||
Install via CLI (npm registry):
|
||||
If you are on an older build or a custom install that excludes bundled Teams,
|
||||
install it manually:
|
||||
|
||||
```bash
|
||||
openclaw plugins install @openclaw/msteams
|
||||
@@ -33,14 +31,13 @@ Local checkout (when running from a git repo):
|
||||
openclaw plugins install ./path/to/local/msteams-plugin
|
||||
```
|
||||
|
||||
If you choose Teams during setup and a git checkout is detected,
|
||||
OpenClaw will offer the local install path automatically.
|
||||
|
||||
Details: [Plugins](/tools/plugin)
|
||||
|
||||
## Quick setup (beginner)
|
||||
|
||||
1. Install the Microsoft Teams plugin.
|
||||
1. Ensure the Microsoft Teams plugin is available.
|
||||
- Current packaged OpenClaw releases already bundle it.
|
||||
- Older/custom installs can add it manually with the commands above.
|
||||
2. Create an **Azure Bot** (App ID + client secret + tenant ID).
|
||||
3. Configure OpenClaw with those credentials.
|
||||
4. Expose `/api/messages` (port 3978 by default) via a public URL or tunnel.
|
||||
@@ -141,7 +138,9 @@ Example:
|
||||
|
||||
## How it works
|
||||
|
||||
1. Install the Microsoft Teams plugin.
|
||||
1. Ensure the Microsoft Teams plugin is available.
|
||||
- Current packaged OpenClaw releases already bundle it.
|
||||
- Older/custom installs can add it manually with the commands above.
|
||||
2. Create an **Azure Bot** (App ID + secret + tenant ID).
|
||||
3. Build a **Teams app package** that references the bot and includes the RSC permissions below.
|
||||
4. Upload/install the Teams app into a team (or personal scope for DMs).
|
||||
@@ -240,9 +239,11 @@ This is often easier than hand-editing JSON manifests.
|
||||
|
||||
## Setup (minimal text-only)
|
||||
|
||||
1. **Install the Microsoft Teams plugin**
|
||||
- From npm: `openclaw plugins install @openclaw/msteams`
|
||||
- From a local checkout: `openclaw plugins install ./path/to/local/msteams-plugin`
|
||||
1. **Ensure the Microsoft Teams plugin is available**
|
||||
- Current packaged OpenClaw releases already bundle it.
|
||||
- Older/custom installs can add it manually:
|
||||
- From npm: `openclaw plugins install @openclaw/msteams`
|
||||
- From a local checkout: `openclaw plugins install ./path/to/local/msteams-plugin`
|
||||
|
||||
2. **Bot registration**
|
||||
- Create an Azure Bot (see above) and note:
|
||||
@@ -284,7 +285,7 @@ This is often easier than hand-editing JSON manifests.
|
||||
- `https://<host>:3978/api/messages` (or your chosen path/port).
|
||||
|
||||
6. **Run the gateway**
|
||||
- The Teams channel starts automatically when the plugin is installed and `msteams` config exists with credentials.
|
||||
- The Teams channel starts automatically when the bundled or manually installed plugin is available and `msteams` config exists with credentials.
|
||||
|
||||
## Member info action
|
||||
|
||||
|
||||
@@ -5,13 +5,17 @@ read_when:
|
||||
title: "Nextcloud Talk"
|
||||
---
|
||||
|
||||
# Nextcloud Talk (plugin)
|
||||
# Nextcloud Talk
|
||||
|
||||
Status: supported via plugin (webhook bot). Direct messages, rooms, reactions, and markdown messages are supported.
|
||||
Status: bundled plugin (webhook bot). Direct messages, rooms, reactions, and markdown messages are supported.
|
||||
|
||||
## Plugin required
|
||||
## Bundled plugin
|
||||
|
||||
Nextcloud Talk ships as a plugin and is not bundled with the core install.
|
||||
Nextcloud Talk ships as a bundled plugin in current OpenClaw releases, so
|
||||
normal packaged builds do not need a separate install.
|
||||
|
||||
If you are on an older build or a custom install that excludes Nextcloud Talk,
|
||||
install it manually:
|
||||
|
||||
Install via CLI (npm registry):
|
||||
|
||||
@@ -25,14 +29,13 @@ Local checkout (when running from a git repo):
|
||||
openclaw plugins install ./path/to/local/nextcloud-talk-plugin
|
||||
```
|
||||
|
||||
If you choose Nextcloud Talk during setup and a git checkout is detected,
|
||||
OpenClaw will offer the local install path automatically.
|
||||
|
||||
Details: [Plugins](/tools/plugin)
|
||||
|
||||
## Quick setup (beginner)
|
||||
|
||||
1. Install the Nextcloud Talk plugin.
|
||||
1. Ensure the Nextcloud Talk plugin is available.
|
||||
- Current packaged OpenClaw releases already bundle it.
|
||||
- Older/custom installs can add it manually with the commands above.
|
||||
2. On your Nextcloud server, create a bot:
|
||||
|
||||
```bash
|
||||
|
||||
@@ -8,25 +8,20 @@ title: "Nostr"
|
||||
|
||||
# Nostr
|
||||
|
||||
**Status:** Optional plugin (disabled by default).
|
||||
**Status:** Optional bundled plugin (disabled by default until configured).
|
||||
|
||||
Nostr is a decentralized protocol for social networking. This channel enables OpenClaw to receive and respond to encrypted direct messages (DMs) via NIP-04.
|
||||
|
||||
## Install (on demand)
|
||||
## Bundled plugin
|
||||
|
||||
### Onboarding (recommended)
|
||||
Current OpenClaw releases ship Nostr as a bundled plugin, so normal packaged
|
||||
builds do not need a separate install.
|
||||
|
||||
- Onboarding (`openclaw onboard`) and `openclaw channels add` list optional channel plugins.
|
||||
- Selecting Nostr prompts you to install the plugin on demand.
|
||||
### Older/custom installs
|
||||
|
||||
Install defaults:
|
||||
|
||||
- **Dev channel + git checkout available:** uses the local plugin path.
|
||||
- **Stable/Beta:** downloads from npm.
|
||||
|
||||
You can always override the choice in the prompt.
|
||||
|
||||
### Manual install
|
||||
- Onboarding (`openclaw onboard`) and `openclaw channels add` still surface
|
||||
Nostr from the shared channel catalog.
|
||||
- If your build excludes bundled Nostr, install it manually.
|
||||
|
||||
```bash
|
||||
openclaw plugins install @openclaw/nostr
|
||||
|
||||
@@ -77,6 +77,15 @@ The setup code is a base64-encoded JSON payload that contains:
|
||||
- `url`: the Gateway WebSocket URL (`ws://...` or `wss://...`)
|
||||
- `bootstrapToken`: a short-lived single-device bootstrap token used for the initial pairing handshake
|
||||
|
||||
That bootstrap token carries the built-in pairing bootstrap profile:
|
||||
|
||||
- primary handed-off `node` token stays `scopes: []`
|
||||
- any handed-off `operator` token stays bounded to the bootstrap allowlist:
|
||||
`operator.approvals`, `operator.read`, `operator.talk.secrets`, `operator.write`
|
||||
- bootstrap scope checks are role-prefixed, not one flat scope pool:
|
||||
operator scope entries only satisfy operator requests, and non-operator roles
|
||||
must still request scopes under their own role prefix
|
||||
|
||||
Treat the setup code like a password while it is valid.
|
||||
|
||||
### Approve a node device
|
||||
@@ -100,8 +109,11 @@ Stored under `~/.openclaw/devices/`:
|
||||
|
||||
### Notes
|
||||
|
||||
- The legacy `node.pair.*` API (CLI: `openclaw nodes pending/approve`) is a
|
||||
- The legacy `node.pair.*` API (CLI: `openclaw nodes pending|approve|reject|rename`) is a
|
||||
separate gateway-owned pairing store. WS nodes still require device pairing.
|
||||
- The pairing record is the durable source of truth for approved roles. Active
|
||||
device tokens stay bounded to that approved role set; a stray token entry
|
||||
outside the approved roles does not create new access.
|
||||
|
||||
## Related docs
|
||||
|
||||
|
||||
99
docs/channels/qa-channel.md
Normal file
99
docs/channels/qa-channel.md
Normal file
@@ -0,0 +1,99 @@
|
||||
---
|
||||
title: "QA Channel"
|
||||
summary: "Synthetic Slack-class channel plugin for deterministic OpenClaw QA scenarios"
|
||||
read_when:
|
||||
- You are wiring the synthetic QA transport into a local or CI test run
|
||||
- You need the bundled qa-channel config surface
|
||||
- You are iterating on end-to-end QA automation
|
||||
---
|
||||
|
||||
# QA Channel
|
||||
|
||||
`qa-channel` is a bundled synthetic message transport for automated OpenClaw QA.
|
||||
|
||||
It is not a production channel. It exists to exercise the same channel plugin
|
||||
boundary used by real transports while keeping state deterministic and fully
|
||||
inspectable.
|
||||
|
||||
## What it does today
|
||||
|
||||
- Slack-class target grammar:
|
||||
- `dm:<user>`
|
||||
- `channel:<room>`
|
||||
- `thread:<room>/<thread>`
|
||||
- HTTP-backed synthetic bus for:
|
||||
- inbound message injection
|
||||
- outbound transcript capture
|
||||
- thread creation
|
||||
- reactions
|
||||
- edits
|
||||
- deletes
|
||||
- search and read actions
|
||||
- Bundled host-side self-check runner that writes a Markdown report
|
||||
|
||||
## Config
|
||||
|
||||
```json
|
||||
{
|
||||
"channels": {
|
||||
"qa-channel": {
|
||||
"baseUrl": "http://127.0.0.1:43123",
|
||||
"botUserId": "openclaw",
|
||||
"botDisplayName": "OpenClaw QA",
|
||||
"allowFrom": ["*"],
|
||||
"pollTimeoutMs": 1000
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Supported account keys:
|
||||
|
||||
- `baseUrl`
|
||||
- `botUserId`
|
||||
- `botDisplayName`
|
||||
- `pollTimeoutMs`
|
||||
- `allowFrom`
|
||||
- `defaultTo`
|
||||
- `actions.messages`
|
||||
- `actions.reactions`
|
||||
- `actions.search`
|
||||
- `actions.threads`
|
||||
|
||||
## Runner
|
||||
|
||||
Current vertical slice:
|
||||
|
||||
```bash
|
||||
pnpm qa:e2e
|
||||
```
|
||||
|
||||
This now routes through the bundled `qa-lab` extension. It starts the in-repo
|
||||
QA bus, boots the bundled `qa-channel` runtime slice, runs a deterministic
|
||||
self-check, and writes a Markdown report under `.artifacts/qa-e2e/`.
|
||||
|
||||
Private debugger UI:
|
||||
|
||||
```bash
|
||||
pnpm qa:lab:build
|
||||
pnpm openclaw qa ui
|
||||
```
|
||||
|
||||
That launches the private QA debugger at a local URL, separate from the
|
||||
shipped Control UI bundle.
|
||||
|
||||
## Scope
|
||||
|
||||
Current scope is intentionally narrow:
|
||||
|
||||
- bus + plugin transport
|
||||
- threaded routing grammar
|
||||
- channel-owned message actions
|
||||
- Markdown reporting
|
||||
|
||||
Follow-up work will add:
|
||||
|
||||
- Dockerized OpenClaw orchestration
|
||||
- provider/model matrix execution
|
||||
- richer scenario discovery
|
||||
- OpenClaw-native orchestration later
|
||||
@@ -13,13 +13,13 @@ QQ Bot connects to OpenClaw via the official QQ Bot API (WebSocket gateway). The
|
||||
plugin supports C2C private chat, group @messages, and guild channel messages with
|
||||
rich media (images, voice, video, files).
|
||||
|
||||
Status: bundled channel plugin. Direct messages, group chats, guild channels, and
|
||||
Status: bundled plugin. Direct messages, group chats, guild channels, and
|
||||
media are supported. Reactions and threads are not supported.
|
||||
|
||||
## Bundled with OpenClaw
|
||||
## Bundled plugin
|
||||
|
||||
Current OpenClaw installs bundle QQ Bot. You do not need a separate
|
||||
`openclaw plugins install` step for normal setup.
|
||||
Current OpenClaw releases bundle QQ Bot, so normal packaged builds do not need
|
||||
a separate `openclaw plugins install` step.
|
||||
|
||||
## Setup
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ signal-cli -a +<BOT_PHONE_NUMBER> verify <VERIFICATION_CODE>
|
||||
|
||||
```bash
|
||||
# If you run the gateway as a user systemd service:
|
||||
systemctl --user restart openclaw-gateway
|
||||
systemctl --user restart openclaw-gateway.service
|
||||
|
||||
# Then verify:
|
||||
openclaw doctor
|
||||
|
||||
@@ -120,275 +120,6 @@ openclaw gateway
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Token model
|
||||
|
||||
- `botToken` + `appToken` are required for Socket Mode.
|
||||
- HTTP mode requires `botToken` + `signingSecret`.
|
||||
- Config tokens override env fallback.
|
||||
- `SLACK_BOT_TOKEN` / `SLACK_APP_TOKEN` env fallback applies only to the default account.
|
||||
- `userToken` (`xoxp-...`) is config-only (no env fallback) and defaults to read-only behavior (`userTokenReadOnly: true`).
|
||||
- Optional: add `chat:write.customize` if you want outgoing messages to use the active agent identity (custom `username` and icon). `icon_emoji` uses `:emoji_name:` syntax.
|
||||
|
||||
<Tip>
|
||||
For actions/directory reads, user token can be preferred when configured. For writes, bot token remains preferred; user-token writes are only allowed when `userTokenReadOnly: false` and bot token is unavailable.
|
||||
</Tip>
|
||||
|
||||
## Access control and routing
|
||||
|
||||
<Tabs>
|
||||
<Tab title="DM policy">
|
||||
`channels.slack.dmPolicy` controls DM access (legacy: `channels.slack.dm.policy`):
|
||||
|
||||
- `pairing` (default)
|
||||
- `allowlist`
|
||||
- `open` (requires `channels.slack.allowFrom` to include `"*"`; legacy: `channels.slack.dm.allowFrom`)
|
||||
- `disabled`
|
||||
|
||||
DM flags:
|
||||
|
||||
- `dm.enabled` (default true)
|
||||
- `channels.slack.allowFrom` (preferred)
|
||||
- `dm.allowFrom` (legacy)
|
||||
- `dm.groupEnabled` (group DMs default false)
|
||||
- `dm.groupChannels` (optional MPIM allowlist)
|
||||
|
||||
Multi-account precedence:
|
||||
|
||||
- `channels.slack.accounts.default.allowFrom` applies only to the `default` account.
|
||||
- Named accounts inherit `channels.slack.allowFrom` when their own `allowFrom` is unset.
|
||||
- Named accounts do not inherit `channels.slack.accounts.default.allowFrom`.
|
||||
|
||||
Pairing in DMs uses `openclaw pairing approve slack <code>`.
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab title="Channel policy">
|
||||
`channels.slack.groupPolicy` controls channel handling:
|
||||
|
||||
- `open`
|
||||
- `allowlist`
|
||||
- `disabled`
|
||||
|
||||
Channel allowlist lives under `channels.slack.channels` and should use stable channel IDs.
|
||||
|
||||
Runtime note: if `channels.slack` is completely missing (env-only setup), runtime falls back to `groupPolicy="allowlist"` and logs a warning (even if `channels.defaults.groupPolicy` is set).
|
||||
|
||||
Name/ID resolution:
|
||||
|
||||
- channel allowlist entries and DM allowlist entries are resolved at startup when token access allows
|
||||
- unresolved channel-name entries are kept as configured but ignored for routing by default
|
||||
- inbound authorization and channel routing are ID-first by default; direct username/slug matching requires `channels.slack.dangerouslyAllowNameMatching: true`
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab title="Mentions and channel users">
|
||||
Channel messages are mention-gated by default.
|
||||
|
||||
Mention sources:
|
||||
|
||||
- explicit app mention (`<@botId>`)
|
||||
- mention regex patterns (`agents.list[].groupChat.mentionPatterns`, fallback `messages.groupChat.mentionPatterns`)
|
||||
- implicit reply-to-bot thread behavior
|
||||
|
||||
Per-channel controls (`channels.slack.channels.<id>`; names only via startup resolution or `dangerouslyAllowNameMatching`):
|
||||
|
||||
- `requireMention`
|
||||
- `users` (allowlist)
|
||||
- `allowBots`
|
||||
- `skills`
|
||||
- `systemPrompt`
|
||||
- `tools`, `toolsBySender`
|
||||
- `toolsBySender` key format: `id:`, `e164:`, `username:`, `name:`, or `"*"` wildcard
|
||||
(legacy unprefixed keys still map to `id:` only)
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Commands and slash behavior
|
||||
|
||||
- Native command auto-mode is **off** for Slack (`commands.native: "auto"` does not enable Slack native commands).
|
||||
- Enable native Slack command handlers with `channels.slack.commands.native: true` (or global `commands.native: true`).
|
||||
- When native commands are enabled, register matching slash commands in Slack (`/<command>` names), with one exception:
|
||||
- register `/agentstatus` for the status command (Slack reserves `/status`)
|
||||
- If native commands are not enabled, you can run a single configured slash command via `channels.slack.slashCommand`.
|
||||
- Native arg menus now adapt their rendering strategy:
|
||||
- up to 5 options: button blocks
|
||||
- 6-100 options: static select menu
|
||||
- more than 100 options: external select with async option filtering when interactivity options handlers are available
|
||||
- if encoded option values exceed Slack limits, the flow falls back to buttons
|
||||
- For long option payloads, Slash command argument menus use a confirm dialog before dispatching a selected value.
|
||||
|
||||
## Interactive replies
|
||||
|
||||
Slack can render agent-authored interactive reply controls, but this feature is disabled by default.
|
||||
|
||||
Enable it globally:
|
||||
|
||||
```json5
|
||||
{
|
||||
channels: {
|
||||
slack: {
|
||||
capabilities: {
|
||||
interactiveReplies: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
Or enable it for one Slack account only:
|
||||
|
||||
```json5
|
||||
{
|
||||
channels: {
|
||||
slack: {
|
||||
accounts: {
|
||||
ops: {
|
||||
capabilities: {
|
||||
interactiveReplies: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
When enabled, agents can emit Slack-only reply directives:
|
||||
|
||||
- `[[slack_buttons: Approve:approve, Reject:reject]]`
|
||||
- `[[slack_select: Choose a target | Canary:canary, Production:production]]`
|
||||
|
||||
These directives compile into Slack Block Kit and route clicks or selections back through the existing Slack interaction event path.
|
||||
|
||||
Notes:
|
||||
|
||||
- This is Slack-specific UI. Other channels do not translate Slack Block Kit directives into their own button systems.
|
||||
- The interactive callback values are OpenClaw-generated opaque tokens, not raw agent-authored values.
|
||||
- If generated interactive blocks would exceed Slack Block Kit limits, OpenClaw falls back to the original text reply instead of sending an invalid blocks payload.
|
||||
|
||||
Default slash command settings:
|
||||
|
||||
- `enabled: false`
|
||||
- `name: "openclaw"`
|
||||
- `sessionPrefix: "slack:slash"`
|
||||
- `ephemeral: true`
|
||||
|
||||
Slash sessions use isolated keys:
|
||||
|
||||
- `agent:<agentId>:slack:slash:<userId>`
|
||||
|
||||
and still route command execution against the target conversation session (`CommandTargetSessionKey`).
|
||||
|
||||
## Threading, sessions, and reply tags
|
||||
|
||||
- DMs route as `direct`; channels as `channel`; MPIMs as `group`.
|
||||
- With default `session.dmScope=main`, Slack DMs collapse to agent main session.
|
||||
- Channel sessions: `agent:<agentId>:slack:channel:<channelId>`.
|
||||
- Thread replies can create thread session suffixes (`:thread:<threadTs>`) when applicable.
|
||||
- `channels.slack.thread.historyScope` default is `thread`; `thread.inheritParent` default is `false`.
|
||||
- `channels.slack.thread.initialHistoryLimit` controls how many existing thread messages are fetched when a new thread session starts (default `20`; set `0` to disable).
|
||||
|
||||
Reply threading controls:
|
||||
|
||||
- `channels.slack.replyToMode`: `off|first|all` (default `off`)
|
||||
- `channels.slack.replyToModeByChatType`: per `direct|group|channel`
|
||||
- legacy fallback for direct chats: `channels.slack.dm.replyToMode`
|
||||
|
||||
Manual reply tags are supported:
|
||||
|
||||
- `[[reply_to_current]]`
|
||||
- `[[reply_to:<id>]]`
|
||||
|
||||
Note: `replyToMode="off"` disables **all** reply threading in Slack, including explicit `[[reply_to_*]]` tags. This differs from Telegram, where explicit tags are still honored in `"off"` mode. The difference reflects the platform threading models: Slack threads hide messages from the channel, while Telegram replies remain visible in the main chat flow.
|
||||
|
||||
## Media, chunking, and delivery
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="Inbound attachments">
|
||||
Slack file attachments are downloaded from Slack-hosted private URLs (token-authenticated request flow) and written to the media store when fetch succeeds and size limits permit.
|
||||
|
||||
Runtime inbound size cap defaults to `20MB` unless overridden by `channels.slack.mediaMaxMb`.
|
||||
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Outbound text and files">
|
||||
- text chunks use `channels.slack.textChunkLimit` (default 4000)
|
||||
- `channels.slack.chunkMode="newline"` enables paragraph-first splitting
|
||||
- file sends use Slack upload APIs and can include thread replies (`thread_ts`)
|
||||
- outbound media cap follows `channels.slack.mediaMaxMb` when configured; otherwise channel sends use MIME-kind defaults from media pipeline
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Delivery targets">
|
||||
Preferred explicit targets:
|
||||
|
||||
- `user:<id>` for DMs
|
||||
- `channel:<id>` for channels
|
||||
|
||||
Slack DMs are opened via Slack conversation APIs when sending to user targets.
|
||||
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## Actions and gates
|
||||
|
||||
Slack actions are controlled by `channels.slack.actions.*`.
|
||||
|
||||
Available action groups in current Slack tooling:
|
||||
|
||||
| Group | Default |
|
||||
| ---------- | ------- |
|
||||
| messages | enabled |
|
||||
| reactions | enabled |
|
||||
| pins | enabled |
|
||||
| memberInfo | enabled |
|
||||
| emojiList | enabled |
|
||||
|
||||
Current Slack message actions include `send`, `upload-file`, `download-file`, `read`, `edit`, `delete`, `pin`, `unpin`, `list-pins`, `member-info`, and `emoji-list`.
|
||||
|
||||
## Events and operational behavior
|
||||
|
||||
- Message edits/deletes/thread broadcasts are mapped into system events.
|
||||
- Reaction add/remove events are mapped into system events.
|
||||
- Member join/leave, channel created/renamed, and pin add/remove events are mapped into system events.
|
||||
- Assistant thread status updates (for "is typing..." indicators in threads) use `assistant.threads.setStatus` and require bot scope `assistant:write`.
|
||||
- `channel_id_changed` can migrate channel config keys when `configWrites` is enabled.
|
||||
- Channel topic/purpose metadata is treated as untrusted context and can be injected into routing context.
|
||||
- Thread starter and initial thread-history context seeding are filtered by configured sender allowlists when applicable.
|
||||
- Block actions and modal interactions emit structured `Slack interaction: ...` system events with rich payload fields:
|
||||
- block actions: selected values, labels, picker values, and `workflow_*` metadata
|
||||
- modal `view_submission` and `view_closed` events with routed channel metadata and form inputs
|
||||
|
||||
## Ack reactions
|
||||
|
||||
`ackReaction` sends an acknowledgement emoji while OpenClaw is processing an inbound message.
|
||||
|
||||
Resolution order:
|
||||
|
||||
- `channels.slack.accounts.<accountId>.ackReaction`
|
||||
- `channels.slack.ackReaction`
|
||||
- `messages.ackReaction`
|
||||
- agent identity emoji fallback (`agents.list[].identity.emoji`, else "👀")
|
||||
|
||||
Notes:
|
||||
|
||||
- Slack expects shortcodes (for example `"eyes"`).
|
||||
- Use `""` to disable the reaction for the Slack account or globally.
|
||||
|
||||
## Typing reaction fallback
|
||||
|
||||
`typingReaction` adds a temporary reaction to the inbound Slack message while OpenClaw is processing a reply, then removes it when the run finishes. This is a useful fallback when Slack native assistant typing is unavailable, especially in DMs.
|
||||
|
||||
Resolution order:
|
||||
|
||||
- `channels.slack.accounts.<accountId>.typingReaction`
|
||||
- `channels.slack.typingReaction`
|
||||
|
||||
Notes:
|
||||
|
||||
- Slack expects shortcodes (for example `"hourglass_flowing_sand"`).
|
||||
- The reaction is best-effort and cleanup is attempted automatically after the reply or failure path completes.
|
||||
|
||||
## Manifest and scope checklist
|
||||
|
||||
<AccordionGroup>
|
||||
@@ -483,11 +214,320 @@ Notes:
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## Token model
|
||||
|
||||
- `botToken` + `appToken` are required for Socket Mode.
|
||||
- HTTP mode requires `botToken` + `signingSecret`.
|
||||
- `botToken`, `appToken`, `signingSecret`, and `userToken` accept plaintext
|
||||
strings or SecretRef objects.
|
||||
- Config tokens override env fallback.
|
||||
- `SLACK_BOT_TOKEN` / `SLACK_APP_TOKEN` env fallback applies only to the default account.
|
||||
- `userToken` (`xoxp-...`) is config-only (no env fallback) and defaults to read-only behavior (`userTokenReadOnly: true`).
|
||||
- Optional: add `chat:write.customize` if you want outgoing messages to use the active agent identity (custom `username` and icon). `icon_emoji` uses `:emoji_name:` syntax.
|
||||
|
||||
Status snapshot behavior:
|
||||
|
||||
- Slack account inspection tracks per-credential `*Source` and `*Status`
|
||||
fields (`botToken`, `appToken`, `signingSecret`, `userToken`).
|
||||
- Status is `available`, `configured_unavailable`, or `missing`.
|
||||
- `configured_unavailable` means the account is configured through SecretRef
|
||||
or another non-inline secret source, but the current command/runtime path
|
||||
could not resolve the actual value.
|
||||
- In HTTP mode, `signingSecretStatus` is included; in Socket Mode, the
|
||||
required pair is `botTokenStatus` + `appTokenStatus`.
|
||||
|
||||
<Tip>
|
||||
For actions/directory reads, user token can be preferred when configured. For writes, bot token remains preferred; user-token writes are only allowed when `userTokenReadOnly: false` and bot token is unavailable.
|
||||
</Tip>
|
||||
|
||||
## Actions and gates
|
||||
|
||||
Slack actions are controlled by `channels.slack.actions.*`.
|
||||
|
||||
Available action groups in current Slack tooling:
|
||||
|
||||
| Group | Default |
|
||||
| ---------- | ------- |
|
||||
| messages | enabled |
|
||||
| reactions | enabled |
|
||||
| pins | enabled |
|
||||
| memberInfo | enabled |
|
||||
| emojiList | enabled |
|
||||
|
||||
Current Slack message actions include `send`, `upload-file`, `download-file`, `read`, `edit`, `delete`, `pin`, `unpin`, `list-pins`, `member-info`, and `emoji-list`.
|
||||
|
||||
## Access control and routing
|
||||
|
||||
<Tabs>
|
||||
<Tab title="DM policy">
|
||||
`channels.slack.dmPolicy` controls DM access (legacy: `channels.slack.dm.policy`):
|
||||
|
||||
- `pairing` (default)
|
||||
- `allowlist`
|
||||
- `open` (requires `channels.slack.allowFrom` to include `"*"`; legacy: `channels.slack.dm.allowFrom`)
|
||||
- `disabled`
|
||||
|
||||
DM flags:
|
||||
|
||||
- `dm.enabled` (default true)
|
||||
- `channels.slack.allowFrom` (preferred)
|
||||
- `dm.allowFrom` (legacy)
|
||||
- `dm.groupEnabled` (group DMs default false)
|
||||
- `dm.groupChannels` (optional MPIM allowlist)
|
||||
|
||||
Multi-account precedence:
|
||||
|
||||
- `channels.slack.accounts.default.allowFrom` applies only to the `default` account.
|
||||
- Named accounts inherit `channels.slack.allowFrom` when their own `allowFrom` is unset.
|
||||
- Named accounts do not inherit `channels.slack.accounts.default.allowFrom`.
|
||||
|
||||
Pairing in DMs uses `openclaw pairing approve slack <code>`.
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab title="Channel policy">
|
||||
`channels.slack.groupPolicy` controls channel handling:
|
||||
|
||||
- `open`
|
||||
- `allowlist`
|
||||
- `disabled`
|
||||
|
||||
Channel allowlist lives under `channels.slack.channels` and should use stable channel IDs.
|
||||
|
||||
Runtime note: if `channels.slack` is completely missing (env-only setup), runtime falls back to `groupPolicy="allowlist"` and logs a warning (even if `channels.defaults.groupPolicy` is set).
|
||||
|
||||
Name/ID resolution:
|
||||
|
||||
- channel allowlist entries and DM allowlist entries are resolved at startup when token access allows
|
||||
- unresolved channel-name entries are kept as configured but ignored for routing by default
|
||||
- inbound authorization and channel routing are ID-first by default; direct username/slug matching requires `channels.slack.dangerouslyAllowNameMatching: true`
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab title="Mentions and channel users">
|
||||
Channel messages are mention-gated by default.
|
||||
|
||||
Mention sources:
|
||||
|
||||
- explicit app mention (`<@botId>`)
|
||||
- mention regex patterns (`agents.list[].groupChat.mentionPatterns`, fallback `messages.groupChat.mentionPatterns`)
|
||||
- implicit reply-to-bot thread behavior
|
||||
|
||||
Per-channel controls (`channels.slack.channels.<id>`; names only via startup resolution or `dangerouslyAllowNameMatching`):
|
||||
|
||||
- `requireMention`
|
||||
- `users` (allowlist)
|
||||
- `allowBots`
|
||||
- `skills`
|
||||
- `systemPrompt`
|
||||
- `tools`, `toolsBySender`
|
||||
- `toolsBySender` key format: `id:`, `e164:`, `username:`, `name:`, or `"*"` wildcard
|
||||
(legacy unprefixed keys still map to `id:` only)
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Threading, sessions, and reply tags
|
||||
|
||||
- DMs route as `direct`; channels as `channel`; MPIMs as `group`.
|
||||
- With default `session.dmScope=main`, Slack DMs collapse to agent main session.
|
||||
- Channel sessions: `agent:<agentId>:slack:channel:<channelId>`.
|
||||
- Thread replies can create thread session suffixes (`:thread:<threadTs>`) when applicable.
|
||||
- `channels.slack.thread.historyScope` default is `thread`; `thread.inheritParent` default is `false`.
|
||||
- `channels.slack.thread.initialHistoryLimit` controls how many existing thread messages are fetched when a new thread session starts (default `20`; set `0` to disable).
|
||||
|
||||
Reply threading controls:
|
||||
|
||||
- `channels.slack.replyToMode`: `off|first|all` (default `off`)
|
||||
- `channels.slack.replyToModeByChatType`: per `direct|group|channel`
|
||||
- legacy fallback for direct chats: `channels.slack.dm.replyToMode`
|
||||
|
||||
Manual reply tags are supported:
|
||||
|
||||
- `[[reply_to_current]]`
|
||||
- `[[reply_to:<id>]]`
|
||||
|
||||
Note: `replyToMode="off"` disables **all** reply threading in Slack, including explicit `[[reply_to_*]]` tags. This differs from Telegram, where explicit tags are still honored in `"off"` mode. The difference reflects the platform threading models: Slack threads hide messages from the channel, while Telegram replies remain visible in the main chat flow.
|
||||
|
||||
## Ack reactions
|
||||
|
||||
`ackReaction` sends an acknowledgement emoji while OpenClaw is processing an inbound message.
|
||||
|
||||
Resolution order:
|
||||
|
||||
- `channels.slack.accounts.<accountId>.ackReaction`
|
||||
- `channels.slack.ackReaction`
|
||||
- `messages.ackReaction`
|
||||
- agent identity emoji fallback (`agents.list[].identity.emoji`, else "👀")
|
||||
|
||||
Notes:
|
||||
|
||||
- Slack expects shortcodes (for example `"eyes"`).
|
||||
- Use `""` to disable the reaction for the Slack account or globally.
|
||||
|
||||
## Text streaming
|
||||
|
||||
`channels.slack.streaming` controls live preview behavior:
|
||||
|
||||
- `off`: disable live preview streaming.
|
||||
- `partial` (default): replace preview text with the latest partial output.
|
||||
- `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`).
|
||||
|
||||
- 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.
|
||||
- Media and non-text payloads fall back to normal delivery.
|
||||
- If streaming fails mid-reply, OpenClaw falls back to normal delivery for remaining payloads.
|
||||
|
||||
Use draft preview instead of Slack native text streaming:
|
||||
|
||||
```json5
|
||||
{
|
||||
channels: {
|
||||
slack: {
|
||||
streaming: "partial",
|
||||
nativeStreaming: false,
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
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`.
|
||||
|
||||
## Typing reaction fallback
|
||||
|
||||
`typingReaction` adds a temporary reaction to the inbound Slack message while OpenClaw is processing a reply, then removes it when the run finishes. This is most useful outside of thread replies, which use a default "is typing..." status indicator.
|
||||
|
||||
Resolution order:
|
||||
|
||||
- `channels.slack.accounts.<accountId>.typingReaction`
|
||||
- `channels.slack.typingReaction`
|
||||
|
||||
Notes:
|
||||
|
||||
- Slack expects shortcodes (for example `"hourglass_flowing_sand"`).
|
||||
- The reaction is best-effort and cleanup is attempted automatically after the reply or failure path completes.
|
||||
|
||||
## Media, chunking, and delivery
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="Inbound attachments">
|
||||
Slack file attachments are downloaded from Slack-hosted private URLs (token-authenticated request flow) and written to the media store when fetch succeeds and size limits permit.
|
||||
|
||||
Runtime inbound size cap defaults to `20MB` unless overridden by `channels.slack.mediaMaxMb`.
|
||||
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Outbound text and files">
|
||||
- text chunks use `channels.slack.textChunkLimit` (default 4000)
|
||||
- `channels.slack.chunkMode="newline"` enables paragraph-first splitting
|
||||
- file sends use Slack upload APIs and can include thread replies (`thread_ts`)
|
||||
- outbound media cap follows `channels.slack.mediaMaxMb` when configured; otherwise channel sends use MIME-kind defaults from media pipeline
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Delivery targets">
|
||||
Preferred explicit targets:
|
||||
|
||||
- `user:<id>` for DMs
|
||||
- `channel:<id>` for channels
|
||||
|
||||
Slack DMs are opened via Slack conversation APIs when sending to user targets.
|
||||
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## Commands and slash behavior
|
||||
|
||||
- Native command auto-mode is **off** for Slack (`commands.native: "auto"` does not enable Slack native commands).
|
||||
- Enable native Slack command handlers with `channels.slack.commands.native: true` (or global `commands.native: true`).
|
||||
- When native commands are enabled, register matching slash commands in Slack (`/<command>` names), with one exception:
|
||||
- register `/agentstatus` for the status command (Slack reserves `/status`)
|
||||
- If native commands are not enabled, you can run a single configured slash command via `channels.slack.slashCommand`.
|
||||
- Native arg menus now adapt their rendering strategy:
|
||||
- up to 5 options: button blocks
|
||||
- 6-100 options: static select menu
|
||||
- more than 100 options: external select with async option filtering when interactivity options handlers are available
|
||||
- if encoded option values exceed Slack limits, the flow falls back to buttons
|
||||
- For long option payloads, Slash command argument menus use a confirm dialog before dispatching a selected value.
|
||||
|
||||
Default slash command settings:
|
||||
|
||||
- `enabled: false`
|
||||
- `name: "openclaw"`
|
||||
- `sessionPrefix: "slack:slash"`
|
||||
- `ephemeral: true`
|
||||
|
||||
Slash sessions use isolated keys:
|
||||
|
||||
- `agent:<agentId>:slack:slash:<userId>`
|
||||
|
||||
and still route command execution against the target conversation session (`CommandTargetSessionKey`).
|
||||
|
||||
## Interactive replies
|
||||
|
||||
Slack can render agent-authored interactive reply controls, but this feature is disabled by default.
|
||||
|
||||
Enable it globally:
|
||||
|
||||
```json5
|
||||
{
|
||||
channels: {
|
||||
slack: {
|
||||
capabilities: {
|
||||
interactiveReplies: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
Or enable it for one Slack account only:
|
||||
|
||||
```json5
|
||||
{
|
||||
channels: {
|
||||
slack: {
|
||||
accounts: {
|
||||
ops: {
|
||||
capabilities: {
|
||||
interactiveReplies: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
When enabled, agents can emit Slack-only reply directives:
|
||||
|
||||
- `[[slack_buttons: Approve:approve, Reject:reject]]`
|
||||
- `[[slack_select: Choose a target | Canary:canary, Production:production]]`
|
||||
|
||||
These directives compile into Slack Block Kit and route clicks or selections back through the existing Slack interaction event path.
|
||||
|
||||
Notes:
|
||||
|
||||
- This is Slack-specific UI. Other channels do not translate Slack Block Kit directives into their own button systems.
|
||||
- The interactive callback values are OpenClaw-generated opaque tokens, not raw agent-authored values.
|
||||
- If generated interactive blocks would exceed Slack Block Kit limits, OpenClaw falls back to the original text reply instead of sending an invalid blocks payload.
|
||||
|
||||
## Exec approvals in Slack
|
||||
|
||||
Exec approval prompts can route natively through Slack using interactive buttons and interactions, instead of falling back to the Web UI or terminal. Approver authorization is enforced: only users identified as approvers can approve or deny requests through Slack.
|
||||
Slack can act as a native approval client with interactive buttons and interactions, instead of falling back to the Web UI or terminal.
|
||||
|
||||
- Exec approvals use `channels.slack.execApprovals.*` for native DM/channel routing.
|
||||
- Plugin approvals can still resolve through the same Slack-native button surface when the request already lands in Slack and the approval id kind is `plugin:`.
|
||||
- Approver authorization is still enforced: only users identified as approvers can approve or deny requests through Slack.
|
||||
|
||||
This uses the same shared approval button surface as other channels. When `interactivity` is enabled in your Slack app settings, approval prompts render as Block Kit buttons directly in the conversation.
|
||||
When those buttons are present, they are the primary approval UX; OpenClaw
|
||||
should only include a manual `/approve` command when the tool result says chat
|
||||
approvals are unavailable or manual approval is the only path.
|
||||
|
||||
Config path:
|
||||
|
||||
@@ -527,11 +567,40 @@ opt into origin-chat delivery:
|
||||
}
|
||||
```
|
||||
|
||||
Shared `approvals.exec` forwarding is separate. Use it only when approval prompts must also route
|
||||
to other chats or explicit out-of-band targets.
|
||||
Shared `approvals.exec` forwarding is separate. Use it only when exec approval prompts must also
|
||||
route to other chats or explicit out-of-band targets. Shared `approvals.plugin` forwarding is also
|
||||
separate; Slack-native buttons can still resolve plugin approvals when those requests already land
|
||||
in Slack.
|
||||
|
||||
Same-chat `/approve` also works in Slack channels and DMs that already support commands. See [Exec approvals](/tools/exec-approvals) for the full approval forwarding model.
|
||||
|
||||
## Events and operational behavior
|
||||
|
||||
- Message edits/deletes/thread broadcasts are mapped into system events.
|
||||
- Reaction add/remove events are mapped into system events.
|
||||
- Member join/leave, channel created/renamed, and pin add/remove events are mapped into system events.
|
||||
- `channel_id_changed` can migrate channel config keys when `configWrites` is enabled.
|
||||
- Channel topic/purpose metadata is treated as untrusted context and can be injected into routing context.
|
||||
- Thread starter and initial thread-history context seeding are filtered by configured sender allowlists when applicable.
|
||||
- Block actions and modal interactions emit structured `Slack interaction: ...` system events with rich payload fields:
|
||||
- block actions: selected values, labels, picker values, and `workflow_*` metadata
|
||||
- modal `view_submission` and `view_closed` events with routed channel metadata and form inputs
|
||||
|
||||
## Configuration reference pointers
|
||||
|
||||
Primary reference:
|
||||
|
||||
- [Configuration reference - Slack](/gateway/configuration-reference#slack)
|
||||
|
||||
High-signal Slack fields:
|
||||
- mode/auth: `mode`, `botToken`, `appToken`, `signingSecret`, `webhookPath`, `accounts.*`
|
||||
- DM access: `dm.enabled`, `dmPolicy`, `allowFrom` (legacy: `dm.policy`, `dm.allowFrom`), `dm.groupEnabled`, `dm.groupChannels`
|
||||
- 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`
|
||||
- ops/features: `configWrites`, `commands.native`, `slashCommand.*`, `actions.*`, `userToken`, `userTokenReadOnly`
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
<AccordionGroup>
|
||||
@@ -568,6 +637,12 @@ openclaw pairing list slack
|
||||
|
||||
<Accordion title="Socket mode not connecting">
|
||||
Validate bot + app tokens and Socket Mode enablement in Slack app settings.
|
||||
|
||||
If `openclaw channels status --probe --json` shows `botTokenStatus` or
|
||||
`appTokenStatus: "configured_unavailable"`, the Slack account is
|
||||
configured but the current runtime could not resolve the SecretRef-backed
|
||||
value.
|
||||
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="HTTP mode not receiving events">
|
||||
@@ -578,6 +653,10 @@ openclaw pairing list slack
|
||||
- Slack Request URLs (Events + Interactivity + Slash Commands)
|
||||
- unique `webhookPath` per HTTP account
|
||||
|
||||
If `signingSecretStatus: "configured_unavailable"` appears in account
|
||||
snapshots, the HTTP account is configured but the current runtime could not
|
||||
resolve the SecretRef-backed signing secret.
|
||||
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Native/slash commands not firing">
|
||||
@@ -591,62 +670,6 @@ openclaw pairing list slack
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## Text streaming
|
||||
|
||||
OpenClaw supports Slack native text streaming via the Agents and AI Apps API.
|
||||
|
||||
`channels.slack.streaming` controls live preview behavior:
|
||||
|
||||
- `off`: disable live preview streaming.
|
||||
- `partial` (default): replace preview text with the latest partial output.
|
||||
- `block`: append chunked preview updates.
|
||||
- `progress`: show progress status text while generating, then send final text.
|
||||
|
||||
`channels.slack.nativeStreaming` controls Slack's native streaming API (`chat.startStream` / `chat.appendStream` / `chat.stopStream`) when `streaming` is `partial` (default: `true`).
|
||||
|
||||
Disable native Slack streaming (keep draft preview behavior):
|
||||
|
||||
```yaml
|
||||
channels:
|
||||
slack:
|
||||
streaming: partial
|
||||
nativeStreaming: false
|
||||
```
|
||||
|
||||
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`.
|
||||
|
||||
### Requirements
|
||||
|
||||
1. Enable **Agents and AI Apps** in your Slack app settings.
|
||||
2. Ensure the app has the `assistant:write` scope.
|
||||
3. A reply thread must be available for that message. Thread selection still follows `replyToMode`.
|
||||
|
||||
### Behavior
|
||||
|
||||
- First text chunk starts a stream (`chat.startStream`).
|
||||
- Later text chunks append to the same stream (`chat.appendStream`).
|
||||
- End of reply finalizes stream (`chat.stopStream`).
|
||||
- Media and non-text payloads fall back to normal delivery.
|
||||
- If streaming fails mid-reply, OpenClaw falls back to normal delivery for remaining payloads.
|
||||
|
||||
## Configuration reference pointers
|
||||
|
||||
Primary reference:
|
||||
|
||||
- [Configuration reference - Slack](/gateway/configuration-reference#slack)
|
||||
|
||||
High-signal Slack fields:
|
||||
- mode/auth: `mode`, `botToken`, `appToken`, `signingSecret`, `webhookPath`, `accounts.*`
|
||||
- DM access: `dm.enabled`, `dmPolicy`, `allowFrom` (legacy: `dm.policy`, `dm.allowFrom`), `dm.groupEnabled`, `dm.groupChannels`
|
||||
- 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`
|
||||
- ops/features: `configWrites`, `commands.native`, `slashCommand.*`, `actions.*`, `userToken`, `userTokenReadOnly`
|
||||
|
||||
## Related
|
||||
|
||||
- [Pairing](/channels/pairing)
|
||||
|
||||
@@ -6,15 +6,19 @@ read_when:
|
||||
title: "Synology Chat"
|
||||
---
|
||||
|
||||
# Synology Chat (plugin)
|
||||
# Synology Chat
|
||||
|
||||
Status: supported via plugin as a direct-message channel using Synology Chat webhooks.
|
||||
Status: bundled plugin direct-message channel using Synology Chat webhooks.
|
||||
The plugin accepts inbound messages from Synology Chat outgoing webhooks and sends replies
|
||||
through a Synology Chat incoming webhook.
|
||||
|
||||
## Plugin required
|
||||
## Bundled plugin
|
||||
|
||||
Synology Chat is plugin-based and not part of the default core channel install.
|
||||
Synology Chat ships as a bundled plugin in current OpenClaw releases, so normal
|
||||
packaged builds do not need a separate install.
|
||||
|
||||
If you are on an older build or a custom install that excludes Synology Chat,
|
||||
install it manually:
|
||||
|
||||
Install from a local checkout:
|
||||
|
||||
@@ -26,7 +30,9 @@ Details: [Plugins](/tools/plugin)
|
||||
|
||||
## Quick setup
|
||||
|
||||
1. Install and enable the Synology Chat plugin.
|
||||
1. Ensure the Synology Chat plugin is available.
|
||||
- Current packaged OpenClaw releases already bundle it.
|
||||
- Older/custom installs can add it manually from a source checkout with the command above.
|
||||
- `openclaw onboard` now shows Synology Chat in the same channel setup list as `openclaw channels add`.
|
||||
- Non-interactive setup: `openclaw channels add --channel synology-chat --token <token> --url <incoming-webhook-url>`
|
||||
2. In Synology Chat integrations:
|
||||
@@ -40,6 +46,17 @@ Details: [Plugins](/tools/plugin)
|
||||
- Direct: `openclaw channels add --channel synology-chat --token <token> --url <incoming-webhook-url>`
|
||||
5. Restart gateway and send a DM to the Synology Chat bot.
|
||||
|
||||
Webhook auth details:
|
||||
|
||||
- OpenClaw accepts the outgoing webhook token from `body.token`, then
|
||||
`?token=...`, then headers.
|
||||
- Accepted header forms:
|
||||
- `x-synology-token`
|
||||
- `x-webhook-token`
|
||||
- `x-openclaw-token`
|
||||
- `Authorization: Bearer <token>`
|
||||
- Empty or missing tokens fail closed.
|
||||
|
||||
Minimal config:
|
||||
|
||||
```json5
|
||||
@@ -137,10 +154,28 @@ but duplicate exact paths are still rejected fail-closed. Prefer explicit per-ac
|
||||
- Keep `token` secret and rotate it if leaked.
|
||||
- Keep `allowInsecureSsl: false` unless you explicitly trust a self-signed local NAS cert.
|
||||
- Inbound webhook requests are token-verified and rate-limited per sender.
|
||||
- Invalid token checks use constant-time secret comparison and fail closed.
|
||||
- Prefer `dmPolicy: "allowlist"` for production.
|
||||
- Keep `dangerouslyAllowNameMatching` off unless you explicitly need legacy username-based reply delivery.
|
||||
- Keep `dangerouslyAllowInheritedWebhookPath` off unless you explicitly accept shared-path routing risk in a multi-account setup.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- `Missing required fields (token, user_id, text)`:
|
||||
- the outgoing webhook payload is missing one of the required fields
|
||||
- if Synology sends the token in headers, make sure the gateway/proxy preserves those headers
|
||||
- `Invalid token`:
|
||||
- the outgoing webhook secret does not match `channels.synology-chat.token`
|
||||
- the request is hitting the wrong account/webhook path
|
||||
- a reverse proxy stripped the token header before the request reached OpenClaw
|
||||
- `Rate limit exceeded`:
|
||||
- too many invalid token attempts from the same source can temporarily lock that source out
|
||||
- authenticated senders also have a separate per-user message rate limit
|
||||
- `Allowlist is empty. Configure allowedUserIds or use dmPolicy=open.`:
|
||||
- `dmPolicy="allowlist"` is enabled but no users are configured
|
||||
- `User not authorized`:
|
||||
- the sender's numeric `user_id` is not in `allowedUserIds`
|
||||
|
||||
## Related
|
||||
|
||||
- [Channels Overview](/channels) — all supported channels
|
||||
|
||||
@@ -358,6 +358,8 @@ curl "https://api.telegram.org/bot<bot_token>/getUpdates"
|
||||
- `/pair approve` when there is only one pending request
|
||||
- `/pair approve latest` for most recent
|
||||
|
||||
The setup code carries a short-lived bootstrap token. Built-in bootstrap handoff keeps the primary node token at `scopes: []`; any handed-off operator token stays bounded to `operator.approvals`, `operator.read`, `operator.talk.secrets`, and `operator.write`. Bootstrap scope checks are role-prefixed, so that operator allowlist only satisfies operator requests; non-operator roles still need scopes under their own role prefix.
|
||||
|
||||
If a device retries with changed auth details (for example role/scopes/public key), the previous pending request is superseded and the new request uses a different `requestId`. Re-run `/pair pending` before approving.
|
||||
|
||||
More details: [Pairing](/channels/pairing#pair-via-telegram-recommended-for-ios).
|
||||
@@ -821,6 +823,9 @@ openclaw message poll --channel telegram --target -1001234567890:topic:42 \
|
||||
Approvers must be numeric Telegram user IDs. Telegram auto-enables native exec approvals when `enabled` is unset or `"auto"` and at least one approver can be resolved, either from `execApprovals.approvers` or from the account's numeric owner config (`allowFrom` and direct-message `defaultTo`). Set `enabled: false` to disable Telegram as a native approval client explicitly. Approval requests otherwise fall back to other configured approval routes or the exec approval fallback policy.
|
||||
|
||||
Telegram also renders the shared approval buttons used by other chat channels. The native Telegram adapter mainly adds approver DM routing, channel/topic fanout, and typing hints before delivery.
|
||||
When those buttons are present, they are the primary approval UX; OpenClaw
|
||||
should only include a manual `/approve` command when the tool result says
|
||||
chat approvals are unavailable or manual approval is the only path.
|
||||
|
||||
Delivery rules:
|
||||
|
||||
@@ -830,6 +835,16 @@ openclaw message poll --channel telegram --target -1001234567890:topic:42 \
|
||||
|
||||
Only resolved approvers can approve or deny. Non-approvers cannot use `/approve` and cannot use Telegram approval buttons.
|
||||
|
||||
Approval resolution behavior:
|
||||
|
||||
- IDs prefixed with `plugin:` always resolve through plugin approvals.
|
||||
- Other approval IDs try `exec.approval.resolve` first.
|
||||
- If Telegram is also authorized for plugin approvals and the gateway says
|
||||
the exec approval is unknown/expired, Telegram retries once through
|
||||
`plugin.approval.resolve`.
|
||||
- Real exec approval denials/errors do not silently fall through to plugin
|
||||
approval resolution.
|
||||
|
||||
Channel delivery shows the command text in the chat, so only enable `channel` or `both` in trusted groups/topics. When the prompt lands in a forum topic, OpenClaw preserves the topic for both the approval prompt and the post-approval follow-up. Exec approvals expire after 30 minutes by default.
|
||||
|
||||
Inline approval buttons also depend on `channels.telegram.capabilities.inlineButtons` allowing the target surface (`dm`, `group`, or `all`).
|
||||
|
||||
@@ -5,18 +5,22 @@ read_when:
|
||||
title: "Tlon"
|
||||
---
|
||||
|
||||
# Tlon (plugin)
|
||||
# Tlon
|
||||
|
||||
Tlon is a decentralized messenger built on Urbit. OpenClaw connects to your Urbit ship and can
|
||||
respond to DMs and group chat messages. Group replies require an @ mention by default and can
|
||||
be further restricted via allowlists.
|
||||
|
||||
Status: supported via plugin. DMs, group mentions, thread replies, rich text formatting, and
|
||||
Status: bundled plugin. DMs, group mentions, thread replies, rich text formatting, and
|
||||
image uploads are supported. Reactions and polls are not yet supported.
|
||||
|
||||
## Plugin required
|
||||
## Bundled plugin
|
||||
|
||||
Tlon ships as a plugin and is not bundled with the core install.
|
||||
Tlon ships as a bundled plugin in current OpenClaw releases, so normal packaged
|
||||
builds do not need a separate install.
|
||||
|
||||
If you are on an older build or a custom install that excludes Tlon, install it
|
||||
manually:
|
||||
|
||||
Install via CLI (npm registry):
|
||||
|
||||
@@ -34,7 +38,9 @@ Details: [Plugins](/tools/plugin)
|
||||
|
||||
## Setup
|
||||
|
||||
1. Install the Tlon plugin.
|
||||
1. Ensure the Tlon plugin is available.
|
||||
- Current packaged OpenClaw releases already bundle it.
|
||||
- Older/custom installs can add it manually with the commands above.
|
||||
2. Gather your ship URL and login code.
|
||||
3. Configure `channels.tlon`.
|
||||
4. Restart the gateway.
|
||||
|
||||
@@ -26,7 +26,7 @@ Healthy baseline:
|
||||
|
||||
- `Runtime: running`
|
||||
- `RPC probe: ok`
|
||||
- Channel probe shows connected/ready
|
||||
- Channel probe shows transport connected and, where supported, `works` or `audit ok`
|
||||
|
||||
## WhatsApp
|
||||
|
||||
@@ -70,11 +70,11 @@ Full troubleshooting: [/channels/discord#troubleshooting](/channels/discord#trou
|
||||
|
||||
### Slack failure signatures
|
||||
|
||||
| Symptom | Fastest check | Fix |
|
||||
| -------------------------------------- | ----------------------------------------- | ------------------------------------------------- |
|
||||
| Socket mode connected but no responses | `openclaw channels status --probe` | Verify app token + bot token and required scopes. |
|
||||
| DMs blocked | `openclaw pairing list slack` | Approve pairing or relax DM policy. |
|
||||
| Channel message ignored | Check `groupPolicy` and channel allowlist | Allow the channel or switch policy to `open`. |
|
||||
| Symptom | Fastest check | Fix |
|
||||
| -------------------------------------- | ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Socket mode connected but no responses | `openclaw channels status --probe` | Verify app token + bot token and required scopes; watch for `botTokenStatus` / `appTokenStatus = configured_unavailable` on SecretRef-backed setups. |
|
||||
| DMs blocked | `openclaw pairing list slack` | Approve pairing or relax DM policy. |
|
||||
| Channel message ignored | Check `groupPolicy` and channel allowlist | Allow the channel or switch policy to `open`. |
|
||||
|
||||
Full troubleshooting: [/channels/slack#troubleshooting](/channels/slack#troubleshooting)
|
||||
|
||||
|
||||
@@ -5,13 +5,17 @@ read_when:
|
||||
title: "Twitch"
|
||||
---
|
||||
|
||||
# Twitch (plugin)
|
||||
# Twitch
|
||||
|
||||
Twitch chat support via IRC connection. OpenClaw connects as a Twitch user (bot account) to receive and send messages in channels.
|
||||
|
||||
## Plugin required
|
||||
## Bundled plugin
|
||||
|
||||
Twitch ships as a plugin and is not bundled with the core install.
|
||||
Twitch ships as a bundled plugin in current OpenClaw releases, so normal
|
||||
packaged builds do not need a separate install.
|
||||
|
||||
If you are on an older build or a custom install that excludes Twitch, install
|
||||
it manually:
|
||||
|
||||
Install via CLI (npm registry):
|
||||
|
||||
@@ -29,17 +33,20 @@ Details: [Plugins](/tools/plugin)
|
||||
|
||||
## Quick setup (beginner)
|
||||
|
||||
1. Create a dedicated Twitch account for the bot (or use an existing account).
|
||||
2. Generate credentials: [Twitch Token Generator](https://twitchtokengenerator.com/)
|
||||
1. Ensure the Twitch plugin is available.
|
||||
- Current packaged OpenClaw releases already bundle it.
|
||||
- Older/custom installs can add it manually with the commands above.
|
||||
2. Create a dedicated Twitch account for the bot (or use an existing account).
|
||||
3. Generate credentials: [Twitch Token Generator](https://twitchtokengenerator.com/)
|
||||
- Select **Bot Token**
|
||||
- Verify scopes `chat:read` and `chat:write` are selected
|
||||
- Copy the **Client ID** and **Access Token**
|
||||
3. Find your Twitch user ID: [https://www.streamweasels.com/tools/convert-twitch-username-to-user-id/](https://www.streamweasels.com/tools/convert-twitch-username-to-user-id/)
|
||||
4. Configure the token:
|
||||
4. Find your Twitch user ID: [https://www.streamweasels.com/tools/convert-twitch-username-to-user-id/](https://www.streamweasels.com/tools/convert-twitch-username-to-user-id/)
|
||||
5. Configure the token:
|
||||
- Env: `OPENCLAW_TWITCH_ACCESS_TOKEN=...` (default account only)
|
||||
- Or config: `channels.twitch.accessToken`
|
||||
- If both are set, config takes precedence (env fallback is default-account only).
|
||||
5. Start the gateway.
|
||||
6. Start the gateway.
|
||||
|
||||
**⚠️ Important:** Add access control (`allowFrom` or `allowedRoles`) to prevent unauthorized users from triggering the bot. `requireMention` defaults to `true`.
|
||||
|
||||
|
||||
@@ -9,20 +9,23 @@ title: "Zalo"
|
||||
|
||||
Status: experimental. DMs are supported. The [Capabilities](#capabilities) section below reflects current Marketplace-bot behavior.
|
||||
|
||||
## Plugin required
|
||||
## Bundled plugin
|
||||
|
||||
Zalo ships as a plugin and is not bundled with the core install.
|
||||
Zalo ships as a bundled plugin in current OpenClaw releases, so normal packaged
|
||||
builds do not need a separate install.
|
||||
|
||||
If you are on an older build or a custom install that excludes Zalo, install it
|
||||
manually:
|
||||
|
||||
- Install via CLI: `openclaw plugins install @openclaw/zalo`
|
||||
- Or select **Zalo** during setup and confirm the install prompt
|
||||
- Or from a source checkout: `openclaw plugins install ./path/to/local/zalo-plugin`
|
||||
- Details: [Plugins](/tools/plugin)
|
||||
|
||||
## Quick setup (beginner)
|
||||
|
||||
1. Install the Zalo plugin:
|
||||
- From a source checkout: `openclaw plugins install ./path/to/local/zalo-plugin`
|
||||
- From npm (if published): `openclaw plugins install @openclaw/zalo`
|
||||
- Or pick **Zalo** in setup and confirm the install prompt
|
||||
1. Ensure the Zalo plugin is available.
|
||||
- Current packaged OpenClaw releases already bundle it.
|
||||
- Older/custom installs can add it manually with the commands above.
|
||||
2. Set the token:
|
||||
- Env: `ZALO_BOT_TOKEN=...`
|
||||
- Or config: `channels.zalo.accounts.default.botToken: "..."`.
|
||||
|
||||
@@ -12,9 +12,13 @@ Status: experimental. This integration automates a **personal Zalo account** via
|
||||
|
||||
> **Warning:** This is an unofficial integration and may result in account suspension/ban. Use at your own risk.
|
||||
|
||||
## Plugin required
|
||||
## Bundled plugin
|
||||
|
||||
Zalo Personal ships as a plugin and is not bundled with the core install.
|
||||
Zalo Personal ships as a bundled plugin in current OpenClaw releases, so normal
|
||||
packaged builds do not need a separate install.
|
||||
|
||||
If you are on an older build or a custom install that excludes Zalo Personal,
|
||||
install it manually:
|
||||
|
||||
- Install via CLI: `openclaw plugins install @openclaw/zalouser`
|
||||
- Or from a source checkout: `openclaw plugins install ./path/to/local/zalouser-plugin`
|
||||
@@ -24,7 +28,9 @@ No external `zca`/`openzca` CLI binary is required.
|
||||
|
||||
## Quick setup (beginner)
|
||||
|
||||
1. Install the plugin (see above).
|
||||
1. Ensure the Zalo Personal plugin is available.
|
||||
- Current packaged OpenClaw releases already bundle it.
|
||||
- Older/custom installs can add it manually with the commands above.
|
||||
2. Login (QR, on the Gateway machine):
|
||||
- `openclaw channels login --channel zalouser`
|
||||
- Scan the QR code with the Zalo mobile app.
|
||||
|
||||
59
docs/ci.md
59
docs/ci.md
@@ -12,46 +12,55 @@ The CI runs on every push to `main` and every pull request. It uses smart scopin
|
||||
|
||||
## Job Overview
|
||||
|
||||
| Job | Purpose | When it runs |
|
||||
| ----------------- | ------------------------------------------------------------------------- | ------------------------------------------------ |
|
||||
| `preflight` | Docs scope, change scope, key scan, workflow audit, prod dependency audit | Always; node-based audit only on non-doc changes |
|
||||
| `docs-scope` | Detect docs-only changes | Always |
|
||||
| `changed-scope` | Detect which areas changed (node/macos/android/windows) | Non-doc changes |
|
||||
| `check` | TypeScript types, lint, format | Non-docs, node changes |
|
||||
| `check-docs` | Markdown lint + broken link check | Docs changed |
|
||||
| `secrets` | Detect leaked secrets | Always |
|
||||
| `build-artifacts` | Build dist once, share with `release-check` | Pushes to `main`, node changes |
|
||||
| `release-check` | Validate npm pack contents | Pushes to `main` after build |
|
||||
| `checks` | Node tests + protocol check on PRs; Bun compat on push | Non-docs, node changes |
|
||||
| `compat-node22` | Minimum supported Node runtime compatibility | Pushes to `main`, node changes |
|
||||
| `checks-windows` | Windows-specific tests | Non-docs, windows-relevant changes |
|
||||
| `macos` | Swift lint/build/test + TS tests | PRs with macos changes |
|
||||
| `android` | Gradle build + tests | Non-docs, android changes |
|
||||
| Job | Purpose | When it runs |
|
||||
| ------------------------ | ---------------------------------------------------------------------------------------- | ----------------------------------- |
|
||||
| `preflight` | Detect docs-only changes, changed scopes, changed extensions, and build the CI manifest | Always on non-draft pushes and PRs |
|
||||
| `security-fast` | Private key detection, workflow audit via `zizmor`, production dependency audit | Always on non-draft pushes and PRs |
|
||||
| `build-artifacts` | Build `dist/` and the Control UI once, upload reusable artifacts for downstream jobs | Node-relevant changes |
|
||||
| `checks-fast-core` | Fast Linux correctness lanes such as bundled/plugin-contract/protocol checks | Node-relevant changes |
|
||||
| `checks-fast-extensions` | Aggregate the extension shard lanes after `checks-fast-extensions-shard` completes | Node-relevant changes |
|
||||
| `extension-fast` | Focused tests for only the changed bundled plugins | When extension changes are detected |
|
||||
| `check` | Main local gate in CI: `pnpm check` plus `pnpm build:strict-smoke` | Node-relevant changes |
|
||||
| `check-additional` | Architecture and boundary guards plus the gateway watch regression harness | Node-relevant changes |
|
||||
| `build-smoke` | Built-CLI smoke tests and startup-memory smoke | Node-relevant changes |
|
||||
| `checks` | Heavier Linux Node lanes: full tests, channel tests, and push-only Node 22 compatibility | Node-relevant changes |
|
||||
| `check-docs` | Docs formatting, lint, and broken-link checks | Docs changed |
|
||||
| `skills-python` | Ruff + pytest for Python-backed skills | Python-skill-relevant changes |
|
||||
| `checks-windows` | Windows-specific test lanes | Windows-relevant changes |
|
||||
| `macos-node` | macOS TypeScript test lane using the shared built artifacts | macOS-relevant changes |
|
||||
| `macos-swift` | Swift lint, build, and tests for the macOS app | macOS-relevant changes |
|
||||
| `android` | Android build and test matrix | Android-relevant changes |
|
||||
|
||||
## Fail-Fast Order
|
||||
|
||||
Jobs are ordered so cheap checks fail before expensive ones run:
|
||||
|
||||
1. `docs-scope` + `changed-scope` + `check` + `secrets` (parallel, cheap gates first)
|
||||
2. PRs: `checks` (Linux Node test split into 2 shards), `checks-windows`, `macos`, `android`
|
||||
3. Pushes to `main`: `build-artifacts` + `release-check` + Bun compat + `compat-node22`
|
||||
1. `preflight` decides which lanes exist at all. The `docs-scope` and `changed-scope` logic are steps inside this job, not standalone jobs.
|
||||
2. `security-fast`, `check`, `check-additional`, `check-docs`, and `skills-python` fail quickly without waiting on the heavier artifact and platform matrix jobs.
|
||||
3. `build-artifacts` overlaps with the fast Linux lanes so downstream consumers can start as soon as the shared build is ready.
|
||||
4. Heavier platform and runtime lanes fan out after that: `checks-fast-core`, `checks-fast-extensions`, `extension-fast`, `checks`, `checks-windows`, `macos-node`, `macos-swift`, and `android`.
|
||||
|
||||
Scope logic lives in `scripts/ci-changed-scope.mjs` and is covered by unit tests in `src/scripts/ci-changed-scope.test.ts`.
|
||||
The same shared scope module also drives the separate `install-smoke` workflow through a narrower `changed-smoke` gate, so Docker/install smoke only runs for install, packaging, and container-relevant changes.
|
||||
The separate `install-smoke` workflow reuses the same scope script through its own `preflight` job. It computes `run_install_smoke` from the narrower changed-smoke signal, so Docker/install smoke only runs for install, packaging, and container-relevant changes.
|
||||
|
||||
On pushes, the `checks` matrix adds the push-only `compat-node22` lane. On pull requests, that lane is skipped and the matrix stays focused on the normal test/channel lanes.
|
||||
|
||||
## Runners
|
||||
|
||||
| Runner | Jobs |
|
||||
| -------------------------------- | ------------------------------------------ |
|
||||
| `blacksmith-16vcpu-ubuntu-2404` | Most Linux jobs, including scope detection |
|
||||
| `blacksmith-32vcpu-windows-2025` | `checks-windows` |
|
||||
| `macos-latest` | `macos`, `ios` |
|
||||
| Runner | Jobs |
|
||||
| -------------------------------- | ---------------------------------------------------------------------------------------------------- |
|
||||
| `blacksmith-16vcpu-ubuntu-2404` | `preflight`, `security-fast`, `build-artifacts`, Linux checks, docs checks, Python skills, `android` |
|
||||
| `blacksmith-32vcpu-windows-2025` | `checks-windows` |
|
||||
| `macos-latest` | `macos-node`, `macos-swift` |
|
||||
|
||||
## Local Equivalents
|
||||
|
||||
```bash
|
||||
pnpm check # types + lint + format
|
||||
pnpm build:strict-smoke
|
||||
pnpm test:gateway:watch-regression
|
||||
pnpm test # vitest tests
|
||||
pnpm test:channels
|
||||
pnpm check:docs # docs format + lint + broken links
|
||||
pnpm release:check # validate npm pack
|
||||
pnpm build # build dist when CI artifact/build-smoke lanes matter
|
||||
```
|
||||
|
||||
@@ -21,6 +21,24 @@ If you want an external MCP client to talk directly to OpenClaw channel
|
||||
conversations instead of hosting an ACP harness session, use
|
||||
[`openclaw mcp serve`](/cli/mcp) instead.
|
||||
|
||||
## What this is not
|
||||
|
||||
This page is often confused with ACP harness sessions.
|
||||
|
||||
`openclaw acp` means:
|
||||
|
||||
- OpenClaw acts as an ACP server
|
||||
- an IDE or ACP client connects to OpenClaw
|
||||
- OpenClaw forwards that work into a Gateway session
|
||||
|
||||
This is different from [ACP Agents](/tools/acp-agents), where OpenClaw runs an
|
||||
external harness such as Codex or Claude Code through `acpx`.
|
||||
|
||||
Quick rule:
|
||||
|
||||
- editor/client wants to talk ACP to OpenClaw: use `openclaw acp`
|
||||
- OpenClaw should launch Codex/Claude/Gemini as an ACP harness: use `/acp spawn` and [ACP Agents](/tools/acp-agents)
|
||||
|
||||
## Compatibility Matrix
|
||||
|
||||
| ACP area | Status | Notes |
|
||||
@@ -275,6 +293,7 @@ Learn more about session keys at [/concepts/session](/concepts/session).
|
||||
- `--require-existing`: fail if the session key/label does not exist.
|
||||
- `--reset-session`: reset the session key before first use.
|
||||
- `--no-prefix-cwd`: do not prefix prompts with the working directory.
|
||||
- `--provenance <off|meta|meta+receipt>`: include ACP provenance metadata or receipts.
|
||||
- `--verbose, -v`: verbose logging to stderr.
|
||||
|
||||
Security note:
|
||||
|
||||
@@ -10,20 +10,48 @@ title: "agent"
|
||||
Run an agent turn via the Gateway (use `--local` for embedded).
|
||||
Use `--agent <id>` to target a configured agent directly.
|
||||
|
||||
Pass at least one session selector:
|
||||
|
||||
- `--to <dest>`
|
||||
- `--session-id <id>`
|
||||
- `--agent <id>`
|
||||
|
||||
Related:
|
||||
|
||||
- Agent send tool: [Agent send](/tools/agent-send)
|
||||
|
||||
## Options
|
||||
|
||||
- `-m, --message <text>`: required message body
|
||||
- `-t, --to <dest>`: recipient used to derive the session key
|
||||
- `--session-id <id>`: explicit session id
|
||||
- `--agent <id>`: agent id; overrides routing bindings
|
||||
- `--thinking <off|minimal|low|medium|high|xhigh>`: agent thinking level
|
||||
- `--verbose <on|off>`: persist verbose level for the session
|
||||
- `--channel <channel>`: delivery channel; omit to use the main session channel
|
||||
- `--reply-to <target>`: delivery target override
|
||||
- `--reply-channel <channel>`: delivery channel override
|
||||
- `--reply-account <id>`: delivery account override
|
||||
- `--local`: run the embedded agent directly (after plugin registry preload)
|
||||
- `--deliver`: send the reply back to the selected channel/target
|
||||
- `--timeout <seconds>`: override agent timeout (default 600 or config value)
|
||||
- `--json`: output JSON
|
||||
|
||||
## Examples
|
||||
|
||||
```bash
|
||||
openclaw agent --to +15555550123 --message "status update" --deliver
|
||||
openclaw agent --agent ops --message "Summarize logs"
|
||||
openclaw agent --session-id 1234 --message "Summarize inbox" --thinking medium
|
||||
openclaw agent --to +15555550123 --message "Trace logs" --verbose on --json
|
||||
openclaw agent --agent ops --message "Generate report" --deliver --reply-channel slack --reply-to "#reports"
|
||||
openclaw agent --agent ops --message "Run locally" --local
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
- Gateway mode falls back to the embedded agent when the Gateway request fails. Use `--local` to force embedded execution up front.
|
||||
- `--local` still preloads the plugin registry first, so plugin-provided providers, tools, and channels stay available during embedded runs.
|
||||
- `--channel`, `--reply-channel`, and `--reply-account` affect reply delivery, not session routing.
|
||||
- When this command triggers `models.json` regeneration, SecretRef-managed provider credentials are persisted as non-secret markers (for example env var names, `secretref-env:ENV_VAR_NAME`, or `secretref-managed`), not resolved secret plaintext.
|
||||
- Marker writes are source-authoritative: OpenClaw persists markers from the active source config snapshot, not from resolved runtime secret values.
|
||||
|
||||
@@ -19,7 +19,9 @@ Related:
|
||||
|
||||
```bash
|
||||
openclaw agents list
|
||||
openclaw agents list --bindings
|
||||
openclaw agents add work --workspace ~/.openclaw/workspace-work
|
||||
openclaw agents add ops --workspace ~/.openclaw/workspace-ops --bind telegram:ops --non-interactive
|
||||
openclaw agents bindings
|
||||
openclaw agents bind --agent work --bind telegram:ops
|
||||
openclaw agents unbind --agent work --bind telegram:ops
|
||||
@@ -53,6 +55,8 @@ openclaw agents bind --agent work --bind telegram:ops --bind discord:guild-a
|
||||
|
||||
If you omit `accountId` (`--bind <channel>`), OpenClaw resolves it from channel defaults and plugin setup hooks when available.
|
||||
|
||||
If you omit `--agent` for `bind` or `unbind`, OpenClaw targets the current default agent.
|
||||
|
||||
### Binding scope behavior
|
||||
|
||||
- A binding without `accountId` matches the channel default account only.
|
||||
@@ -78,6 +82,75 @@ openclaw agents unbind --agent work --bind telegram:ops
|
||||
openclaw agents unbind --agent work --all
|
||||
```
|
||||
|
||||
`unbind` accepts either `--all` or one or more `--bind` values, not both.
|
||||
|
||||
## Command surface
|
||||
|
||||
### `agents`
|
||||
|
||||
Running `openclaw agents` with no subcommand is equivalent to `openclaw agents list`.
|
||||
|
||||
### `agents list`
|
||||
|
||||
Options:
|
||||
|
||||
- `--json`
|
||||
- `--bindings`: include full routing rules, not only per-agent counts/summaries
|
||||
|
||||
### `agents add [name]`
|
||||
|
||||
Options:
|
||||
|
||||
- `--workspace <dir>`
|
||||
- `--model <id>`
|
||||
- `--agent-dir <dir>`
|
||||
- `--bind <channel[:accountId]>` (repeatable)
|
||||
- `--non-interactive`
|
||||
- `--json`
|
||||
|
||||
Notes:
|
||||
|
||||
- Passing any explicit add flags switches the command into the non-interactive path.
|
||||
- Non-interactive mode requires both an agent name and `--workspace`.
|
||||
- `main` is reserved and cannot be used as the new agent id.
|
||||
|
||||
### `agents bindings`
|
||||
|
||||
Options:
|
||||
|
||||
- `--agent <id>`
|
||||
- `--json`
|
||||
|
||||
### `agents bind`
|
||||
|
||||
Options:
|
||||
|
||||
- `--agent <id>` (defaults to the current default agent)
|
||||
- `--bind <channel[:accountId]>` (repeatable)
|
||||
- `--json`
|
||||
|
||||
### `agents unbind`
|
||||
|
||||
Options:
|
||||
|
||||
- `--agent <id>` (defaults to the current default agent)
|
||||
- `--bind <channel[:accountId]>` (repeatable)
|
||||
- `--all`
|
||||
- `--json`
|
||||
|
||||
### `agents delete <id>`
|
||||
|
||||
Options:
|
||||
|
||||
- `--force`
|
||||
- `--json`
|
||||
|
||||
Notes:
|
||||
|
||||
- `main` cannot be deleted.
|
||||
- Without `--force`, interactive confirmation is required.
|
||||
- Workspace, agent state, and session transcript directories are moved to Trash, not hard-deleted.
|
||||
|
||||
## Identity files
|
||||
|
||||
Each agent workspace can include an `IDENTITY.md` at the workspace root:
|
||||
@@ -96,6 +169,24 @@ Avatar paths resolve relative to the workspace root.
|
||||
- `emoji`
|
||||
- `avatar` (workspace-relative path, http(s) URL, or data URI)
|
||||
|
||||
Options:
|
||||
|
||||
- `--agent <id>`
|
||||
- `--workspace <dir>`
|
||||
- `--identity-file <path>`
|
||||
- `--from-identity`
|
||||
- `--name <name>`
|
||||
- `--theme <theme>`
|
||||
- `--emoji <emoji>`
|
||||
- `--avatar <value>`
|
||||
- `--json`
|
||||
|
||||
Notes:
|
||||
|
||||
- `--agent` or `--workspace` can be used to select the target agent.
|
||||
- If you rely on `--workspace` and multiple agents share that workspace, the command fails and asks you to pass `--agent`.
|
||||
- When no explicit identity fields are provided, the command reads identity data from `IDENTITY.md`.
|
||||
|
||||
Load from `IDENTITY.md`:
|
||||
|
||||
```bash
|
||||
|
||||
@@ -11,6 +11,8 @@ title: "approvals"
|
||||
Manage exec approvals for the **local host**, **gateway host**, or a **node host**.
|
||||
By default, commands target the local approvals file on disk. Use `--gateway` to target the gateway, or `--node` to target a specific node.
|
||||
|
||||
Alias: `openclaw exec-approvals`
|
||||
|
||||
Related:
|
||||
|
||||
- Exec approvals: [Exec approvals](/tools/exec-approvals)
|
||||
@@ -41,10 +43,15 @@ Precedence is intentional:
|
||||
|
||||
```bash
|
||||
openclaw approvals set --file ./exec-approvals.json
|
||||
openclaw approvals set --stdin <<'EOF'
|
||||
{ version: 1, defaults: { security: "full", ask: "off" } }
|
||||
EOF
|
||||
openclaw approvals set --node <id|name|ip> --file ./exec-approvals.json
|
||||
openclaw approvals set --gateway --file ./exec-approvals.json
|
||||
```
|
||||
|
||||
`set` accepts JSON5, not only strict JSON. Use either `--file` or `--stdin`, not both.
|
||||
|
||||
## "Never prompt" / YOLO example
|
||||
|
||||
For a host that should never stop on exec approvals, set the host approvals defaults to `full` + `off`:
|
||||
@@ -103,6 +110,24 @@ openclaw approvals allowlist add --agent "*" "/usr/bin/uname"
|
||||
openclaw approvals allowlist remove "~/Projects/**/bin/rg"
|
||||
```
|
||||
|
||||
## Common options
|
||||
|
||||
`get`, `set`, and `allowlist add|remove` all support:
|
||||
|
||||
- `--node <id|name|ip>`
|
||||
- `--gateway`
|
||||
- shared node RPC options: `--url`, `--token`, `--timeout`, `--json`
|
||||
|
||||
Targeting notes:
|
||||
|
||||
- no target flags means the local approvals file on disk
|
||||
- `--gateway` targets the gateway host approvals file
|
||||
- `--node` targets one node host after resolving id, name, IP, or id prefix
|
||||
|
||||
`allowlist add|remove` also supports:
|
||||
|
||||
- `--agent <id>` (defaults to `*`)
|
||||
|
||||
## Notes
|
||||
|
||||
- `--node` uses the same resolver as `openclaw nodes` (id, name, ip, or id prefix).
|
||||
|
||||
@@ -8,7 +8,7 @@ title: "backup"
|
||||
|
||||
# `openclaw backup`
|
||||
|
||||
Create a local backup archive for OpenClaw state, config, credentials, sessions, and optionally workspaces.
|
||||
Create a local backup archive for OpenClaw state, config, auth profiles, channel/provider credentials, sessions, and optionally workspaces.
|
||||
|
||||
```bash
|
||||
openclaw backup create
|
||||
@@ -37,12 +37,19 @@ openclaw backup verify ./2026-03-09T00-00-00.000Z-openclaw-backup.tar.gz
|
||||
|
||||
- The state directory returned by OpenClaw's local state resolver, usually `~/.openclaw`
|
||||
- The active config file path
|
||||
- The OAuth / credentials directory
|
||||
- The resolved `credentials/` directory when it exists outside the state directory
|
||||
- Workspace directories discovered from the current config, unless you pass `--no-include-workspace`
|
||||
|
||||
If you use `--only-config`, OpenClaw skips state, credentials, and workspace discovery and archives only the active config file path.
|
||||
Model auth profiles are already part of the state directory under
|
||||
`agents/<agentId>/agent/auth-profiles.json`, so they are normally covered by the
|
||||
state backup entry.
|
||||
|
||||
OpenClaw canonicalizes paths before building the archive. If config, credentials, or a workspace already live inside the state directory, they are not duplicated as separate top-level backup sources. Missing paths are skipped.
|
||||
If you use `--only-config`, OpenClaw skips state, credentials-directory, and workspace discovery and archives only the active config file path.
|
||||
|
||||
OpenClaw canonicalizes paths before building the archive. If config, the
|
||||
credentials directory, or a workspace already live inside the state directory,
|
||||
they are not duplicated as separate top-level backup sources. Missing paths are
|
||||
skipped.
|
||||
|
||||
The archive payload stores file contents from those source trees, and the embedded `manifest.json` records the resolved absolute source paths plus the archive layout used for each asset.
|
||||
|
||||
@@ -56,7 +63,8 @@ If you still want a partial backup in that situation, rerun:
|
||||
openclaw backup create --no-include-workspace
|
||||
```
|
||||
|
||||
That keeps state, config, and credentials in scope while skipping workspace discovery entirely.
|
||||
That keeps state, config, and the external credentials directory in scope while
|
||||
skipping workspace discovery entirely.
|
||||
|
||||
If you only need a copy of the config file itself, `--only-config` also works when the config is malformed because it does not rely on parsing the config for workspace discovery.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
summary: "CLI reference for `openclaw browser` (profiles, tabs, actions, Chrome MCP, and CDP)"
|
||||
summary: "CLI reference for `openclaw browser` (lifecycle, profiles, tabs, actions, state, and debugging)"
|
||||
read_when:
|
||||
- You use `openclaw browser` and want examples for common tasks
|
||||
- You want to control a browser running on another machine via a node host
|
||||
@@ -9,7 +9,7 @@ title: "browser"
|
||||
|
||||
# `openclaw browser`
|
||||
|
||||
Manage OpenClaw’s browser control server and run browser actions (tabs, snapshots, screenshots, navigation, clicks, typing).
|
||||
Manage OpenClaw's browser control surface and run browser actions (lifecycle, profiles, tabs, snapshots, screenshots, navigation, input, state emulation, and debugging).
|
||||
|
||||
Related:
|
||||
|
||||
@@ -20,6 +20,7 @@ Related:
|
||||
- `--url <gatewayWsUrl>`: Gateway WebSocket URL (defaults to config).
|
||||
- `--token <token>`: Gateway token (if required).
|
||||
- `--timeout <ms>`: request timeout (ms).
|
||||
- `--expect-final`: wait for a final Gateway response.
|
||||
- `--browser-profile <name>`: choose a browser profile (default from config).
|
||||
- `--json`: machine-readable output (where supported).
|
||||
|
||||
@@ -32,6 +33,23 @@ openclaw browser --browser-profile openclaw open https://example.com
|
||||
openclaw browser --browser-profile openclaw snapshot
|
||||
```
|
||||
|
||||
## Lifecycle
|
||||
|
||||
```bash
|
||||
openclaw browser status
|
||||
openclaw browser start
|
||||
openclaw browser stop
|
||||
openclaw browser --browser-profile openclaw reset-profile
|
||||
```
|
||||
|
||||
Notes:
|
||||
|
||||
- For `attachOnly` and remote CDP profiles, `openclaw browser stop` closes the
|
||||
active control session and clears temporary emulation overrides even when
|
||||
OpenClaw did not launch the browser process itself.
|
||||
- For local managed profiles, `openclaw browser stop` stops the spawned browser
|
||||
process.
|
||||
|
||||
## If the command is missing
|
||||
|
||||
If `openclaw browser` is an unknown command, check `plugins.allow` in
|
||||
@@ -65,6 +83,7 @@ Profiles are named browser routing configs. In practice:
|
||||
openclaw browser profiles
|
||||
openclaw browser create-profile --name work --color "#FF5A36"
|
||||
openclaw browser create-profile --name chrome-live --driver existing-session
|
||||
openclaw browser create-profile --name remote --cdp-url https://browser-host.example.com
|
||||
openclaw browser delete-profile --name work
|
||||
```
|
||||
|
||||
@@ -78,6 +97,9 @@ openclaw browser --browser-profile work tabs
|
||||
|
||||
```bash
|
||||
openclaw browser tabs
|
||||
openclaw browser tab new
|
||||
openclaw browser tab select 2
|
||||
openclaw browser tab close 2
|
||||
openclaw browser open https://docs.openclaw.ai
|
||||
openclaw browser focus <targetId>
|
||||
openclaw browser close <targetId>
|
||||
@@ -95,14 +117,81 @@ Screenshot:
|
||||
|
||||
```bash
|
||||
openclaw browser screenshot
|
||||
openclaw browser screenshot --full-page
|
||||
openclaw browser screenshot --ref e12
|
||||
```
|
||||
|
||||
Notes:
|
||||
|
||||
- `--full-page` is for page captures only; it cannot be combined with `--ref`
|
||||
or `--element`.
|
||||
- `existing-session` / `user` profiles support page screenshots and `--ref`
|
||||
screenshots from snapshot output, but not CSS `--element` screenshots.
|
||||
|
||||
Navigate/click/type (ref-based UI automation):
|
||||
|
||||
```bash
|
||||
openclaw browser navigate https://example.com
|
||||
openclaw browser click <ref>
|
||||
openclaw browser type <ref> "hello"
|
||||
openclaw browser press Enter
|
||||
openclaw browser hover <ref>
|
||||
openclaw browser scrollintoview <ref>
|
||||
openclaw browser drag <startRef> <endRef>
|
||||
openclaw browser select <ref> OptionA OptionB
|
||||
openclaw browser fill --fields '[{"ref":"1","value":"Ada"}]'
|
||||
openclaw browser wait --text "Done"
|
||||
openclaw browser evaluate --fn '(el) => el.textContent' --ref <ref>
|
||||
```
|
||||
|
||||
File + dialog helpers:
|
||||
|
||||
```bash
|
||||
openclaw browser upload /tmp/openclaw/uploads/file.pdf --ref <ref>
|
||||
openclaw browser waitfordownload
|
||||
openclaw browser download <ref> report.pdf
|
||||
openclaw browser dialog --accept
|
||||
```
|
||||
|
||||
## State and storage
|
||||
|
||||
Viewport + emulation:
|
||||
|
||||
```bash
|
||||
openclaw browser resize 1280 720
|
||||
openclaw browser set viewport 1280 720
|
||||
openclaw browser set offline on
|
||||
openclaw browser set media dark
|
||||
openclaw browser set timezone Europe/London
|
||||
openclaw browser set locale en-GB
|
||||
openclaw browser set geo 51.5074 -0.1278 --accuracy 25
|
||||
openclaw browser set device "iPhone 14"
|
||||
openclaw browser set headers '{"x-test":"1"}'
|
||||
openclaw browser set credentials myuser mypass
|
||||
```
|
||||
|
||||
Cookies + storage:
|
||||
|
||||
```bash
|
||||
openclaw browser cookies
|
||||
openclaw browser cookies set session abc123 --url https://example.com
|
||||
openclaw browser cookies clear
|
||||
openclaw browser storage local get
|
||||
openclaw browser storage local set token abc123
|
||||
openclaw browser storage session clear
|
||||
```
|
||||
|
||||
## Debugging
|
||||
|
||||
```bash
|
||||
openclaw browser console --level error
|
||||
openclaw browser pdf
|
||||
openclaw browser responsebody "**/api"
|
||||
openclaw browser highlight <ref>
|
||||
openclaw browser errors --clear
|
||||
openclaw browser requests --filter api
|
||||
openclaw browser trace start
|
||||
openclaw browser trace stop --out trace.zip
|
||||
```
|
||||
|
||||
## Existing Chrome via MCP
|
||||
@@ -118,6 +207,23 @@ openclaw browser --browser-profile chrome-live tabs
|
||||
|
||||
This path is host-only. For Docker, headless servers, Browserless, or other remote setups, use a CDP profile instead.
|
||||
|
||||
Current existing-session limits:
|
||||
|
||||
- snapshot-driven actions use refs, not CSS selectors
|
||||
- `click` is left-click only
|
||||
- `type` does not support `slowly=true`
|
||||
- `press` does not support `delayMs`
|
||||
- `hover`, `scrollintoview`, `drag`, `select`, `fill`, and `evaluate` reject
|
||||
per-call timeout overrides
|
||||
- `select` supports one value only
|
||||
- `wait --load networkidle` is not supported
|
||||
- file uploads require `--ref` / `--input-ref`, do not support CSS
|
||||
`--element`, and currently support one file at a time
|
||||
- dialog hooks do not support `--timeout`
|
||||
- screenshots support page captures and `--ref`, but not CSS `--element`
|
||||
- `responsebody`, download interception, PDF export, and batch actions still
|
||||
require a managed browser or raw CDP profile
|
||||
|
||||
## Remote browser control (node host proxy)
|
||||
|
||||
If the Gateway runs on a different machine than the browser, run a **node host** on the machine that has Chrome/Brave/Edge/Chromium. The Gateway will proxy browser actions to that node (no separate browser control server required).
|
||||
|
||||
@@ -26,6 +26,19 @@ openclaw channels resolve --channel slack "#general" "@jane"
|
||||
openclaw channels logs --channel all
|
||||
```
|
||||
|
||||
## Status / capabilities / resolve / logs
|
||||
|
||||
- `channels status`: `--probe`, `--timeout <ms>`, `--json`
|
||||
- `channels capabilities`: `--channel <name>`, `--account <id>` (only with `--channel`), `--target <dest>`, `--timeout <ms>`, `--json`
|
||||
- `channels resolve`: `<entries...>`, `--channel <name>`, `--account <id>`, `--kind <auto|user|group>`, `--json`
|
||||
- `channels logs`: `--channel <name|all>`, `--lines <n>`, `--json`
|
||||
|
||||
`channels status --probe` is the live path: on a reachable gateway it runs per-account
|
||||
`probeAccount` and optional `auditAccount` checks, so output can include transport
|
||||
state plus probe results such as `works`, `probe failed`, `audit ok`, or `audit failed`.
|
||||
If the gateway is unreachable, `channels status` falls back to config-only summaries
|
||||
instead of live probe output.
|
||||
|
||||
## Add / remove accounts
|
||||
|
||||
```bash
|
||||
@@ -36,6 +49,16 @@ openclaw channels remove --channel telegram --delete
|
||||
|
||||
Tip: `openclaw channels add --help` shows per-channel flags (token, private key, app token, signal-cli paths, etc).
|
||||
|
||||
Common non-interactive add surfaces include:
|
||||
|
||||
- bot-token channels: `--token`, `--bot-token`, `--app-token`, `--token-file`
|
||||
- Signal/iMessage transport fields: `--signal-number`, `--cli-path`, `--http-url`, `--http-host`, `--http-port`, `--db-path`, `--service`, `--region`
|
||||
- Google Chat fields: `--webhook-path`, `--webhook-url`, `--audience-type`, `--audience`
|
||||
- Matrix fields: `--homeserver`, `--user-id`, `--access-token`, `--password`, `--device-name`, `--initial-sync-limit`
|
||||
- Nostr fields: `--private-key`, `--relay-urls`
|
||||
- Tlon fields: `--ship`, `--url`, `--code`, `--group-channels`, `--dm-allowlist`, `--auto-discover-channels`
|
||||
- `--use-env` for default-account env-backed auth where supported
|
||||
|
||||
When you run `openclaw channels add` without flags, the interactive wizard can prompt:
|
||||
|
||||
- account ids per selected channel
|
||||
@@ -46,7 +69,7 @@ If you confirm bind now, the wizard asks which agent should own each configured
|
||||
|
||||
You can also manage the same routing rules later with `openclaw agents bindings`, `openclaw agents bind`, and `openclaw agents unbind` (see [agents](/cli/agents)).
|
||||
|
||||
When you add a non-default account to a channel that is still using single-account top-level settings (no `channels.<channel>.accounts` entries yet), OpenClaw moves account-scoped single-account top-level values into `channels.<channel>.accounts.default`, then writes the new account. This preserves the original account behavior while moving to the multi-account shape.
|
||||
When you add a non-default account to a channel that is still using single-account top-level settings, OpenClaw promotes account-scoped top-level values into the channel's account map before writing the new account. Most channels land those values in `channels.<channel>.accounts.default`, but bundled channels can preserve an existing matching promoted account instead. Matrix is the current example: if one named account already exists, or `defaultAccount` points at an existing named account, promotion preserves that account instead of creating a new `accounts.default`.
|
||||
|
||||
Routing behavior stays consistent:
|
||||
|
||||
@@ -54,7 +77,7 @@ Routing behavior stays consistent:
|
||||
- `channels add` does not auto-create or rewrite bindings in non-interactive mode.
|
||||
- Interactive setup can optionally add account-scoped bindings.
|
||||
|
||||
If your config was already in a mixed state (named accounts present, missing `default`, and top-level single-account values still set), run `openclaw doctor --fix` to move account-scoped values into `accounts.default`.
|
||||
If your config was already in a mixed state (named accounts present and top-level single-account values still set), run `openclaw doctor --fix` to move account-scoped values into the promoted account chosen for that channel. Most channels promote into `accounts.default`; Matrix can preserve an existing named/default target instead.
|
||||
|
||||
## Login / logout (interactive)
|
||||
|
||||
@@ -63,11 +86,16 @@ openclaw channels login --channel whatsapp
|
||||
openclaw channels logout --channel whatsapp
|
||||
```
|
||||
|
||||
Notes:
|
||||
|
||||
- `channels login` supports `--verbose`.
|
||||
- `channels login` / `logout` can infer the channel when only one supported login target is configured.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- Run `openclaw status --deep` for a broad probe.
|
||||
- Use `openclaw doctor` for guided fixes.
|
||||
- `openclaw channels list` prints `Claude: HTTP 403 ... user:profile` → usage snapshot needs the `user:profile` scope. Use `--no-usage`, or provide a claude.ai session key (`CLAUDE_WEB_SESSION_KEY` / `CLAUDE_WEB_COOKIE`), or re-auth via Claude Code CLI.
|
||||
- `openclaw channels list` prints `Claude: HTTP 403 ... user:profile` → usage snapshot needs the `user:profile` scope. Use `--no-usage`, or provide a claude.ai session key (`CLAUDE_WEB_SESSION_KEY` / `CLAUDE_WEB_COOKIE`), or re-auth via Claude CLI.
|
||||
- `openclaw channels status` falls back to config-only summaries when the gateway is unreachable. If a supported channel credential is configured via SecretRef but unavailable in the current command path, it reports that account as configured with degraded notes instead of showing it as not configured.
|
||||
|
||||
## Capabilities probe
|
||||
@@ -82,6 +110,7 @@ openclaw channels capabilities --channel discord --target channel:123
|
||||
Notes:
|
||||
|
||||
- `--channel` is optional; omit it to list every channel (including extensions).
|
||||
- `--account` is only valid with `--channel`.
|
||||
- `--target` accepts `channel:<id>` or a raw numeric channel id and only applies to Discord.
|
||||
- Probes are provider-specific: Discord intents + optional channel permissions; Slack bot + user scopes; Telegram bot flags + webhook; Signal daemon version; Microsoft Teams app token + Graph roles/scopes (annotated where known). Channels without probes report `Probe: unavailable`.
|
||||
|
||||
|
||||
@@ -11,10 +11,28 @@ Config helpers for non-interactive edits in `openclaw.json`: get/set/unset/file/
|
||||
values by path and print the active config file. Run without a subcommand to
|
||||
open the configure wizard (same as `openclaw configure`).
|
||||
|
||||
Root options:
|
||||
|
||||
- `--section <section>`: repeatable guided-setup section filter when you run `openclaw config` without a subcommand
|
||||
|
||||
Supported guided sections:
|
||||
|
||||
- `workspace`
|
||||
- `model`
|
||||
- `web`
|
||||
- `gateway`
|
||||
- `daemon`
|
||||
- `channels`
|
||||
- `plugins`
|
||||
- `skills`
|
||||
- `health`
|
||||
|
||||
## Examples
|
||||
|
||||
```bash
|
||||
openclaw config file
|
||||
openclaw config --section model
|
||||
openclaw config --section gateway --section daemon
|
||||
openclaw config schema
|
||||
openclaw config get browser.executablePath
|
||||
openclaw config set browser.executablePath "/usr/bin/google-chrome"
|
||||
@@ -30,7 +48,23 @@ openclaw config validate --json
|
||||
|
||||
### `config schema`
|
||||
|
||||
Print the generated JSON schema for `openclaw.json` to stdout as plain text.
|
||||
Print the generated JSON schema for `openclaw.json` to stdout as JSON.
|
||||
|
||||
What it includes:
|
||||
|
||||
- The current root config schema, plus a root `$schema` string field for editor tooling
|
||||
- Field `title` and `description` docs metadata used by the Control UI
|
||||
- Nested object, wildcard (`*`), and array-item (`[]`) nodes inherit the same `title` / `description` metadata when matching field documentation exists
|
||||
- `anyOf` / `oneOf` / `allOf` branches inherit the same docs metadata too when matching field documentation exists
|
||||
- Best-effort live plugin + channel schema metadata when runtime manifests can be loaded
|
||||
- A clean fallback schema even when the current config is invalid
|
||||
|
||||
Related runtime RPC:
|
||||
|
||||
- `config.schema.lookup` returns one normalized config path with a shallow
|
||||
schema node (`title`, `description`, `type`, `enum`, `const`, common bounds),
|
||||
matched UI hint metadata, and immediate child summaries. Use it for
|
||||
path-scoped drill-down in Control UI or custom clients.
|
||||
|
||||
```bash
|
||||
openclaw config schema
|
||||
@@ -69,6 +103,8 @@ openclaw config set gateway.port 19001 --strict-json
|
||||
openclaw config set channels.whatsapp.groups '["*"]' --strict-json
|
||||
```
|
||||
|
||||
`config get <path> --json` prints the raw value as JSON instead of terminal-formatted text.
|
||||
|
||||
## `config set` modes
|
||||
|
||||
`openclaw config set` supports four assignment styles:
|
||||
|
||||
@@ -12,19 +12,46 @@ Interactive prompt to set up credentials, devices, and agent defaults.
|
||||
Note: The **Model** section now includes a multi-select for the
|
||||
`agents.defaults.models` allowlist (what shows up in `/model` and the model picker).
|
||||
|
||||
When configure starts from a provider auth choice, the default-model and
|
||||
allowlist pickers prefer that provider automatically. For paired providers such
|
||||
as Volcengine/BytePlus, the same preference also matches their coding-plan
|
||||
variants (`volcengine-plan/*`, `byteplus-plan/*`). If the preferred-provider
|
||||
filter would produce an empty list, configure falls back to the unfiltered
|
||||
catalog instead of showing a blank picker.
|
||||
|
||||
Tip: `openclaw config` without a subcommand opens the same wizard. Use
|
||||
`openclaw config get|set|unset` for non-interactive edits.
|
||||
|
||||
For web search, `openclaw configure --section web` lets you choose a provider
|
||||
and configure its credentials. If you choose **Grok**, configure can also show
|
||||
a separate follow-up step to enable `x_search` with the same `XAI_API_KEY` and
|
||||
pick an `x_search` model. Other web-search providers do not show that step.
|
||||
and configure its credentials. Some providers also show provider-specific
|
||||
follow-up prompts:
|
||||
|
||||
- **Grok** can offer optional `x_search` setup with the same `XAI_API_KEY` and
|
||||
let you pick an `x_search` model.
|
||||
- **Kimi** can ask for the Moonshot API region (`api.moonshot.ai` vs
|
||||
`api.moonshot.cn`) and the default Kimi web-search model.
|
||||
|
||||
Related:
|
||||
|
||||
- Gateway configuration reference: [Configuration](/gateway/configuration)
|
||||
- Config CLI: [Config](/cli/config)
|
||||
|
||||
## Options
|
||||
|
||||
- `--section <section>`: repeatable section filter
|
||||
|
||||
Available sections:
|
||||
|
||||
- `workspace`
|
||||
- `model`
|
||||
- `web`
|
||||
- `gateway`
|
||||
- `daemon`
|
||||
- `channels`
|
||||
- `plugins`
|
||||
- `skills`
|
||||
- `health`
|
||||
|
||||
Notes:
|
||||
|
||||
- Choosing where the Gateway runs always updates `gateway.mode`. You can select "Continue" without other sections if that is all you need.
|
||||
@@ -39,4 +66,5 @@ Notes:
|
||||
openclaw configure
|
||||
openclaw configure --section web
|
||||
openclaw configure --section model --section channels
|
||||
openclaw configure --section gateway --section daemon
|
||||
```
|
||||
|
||||
@@ -19,8 +19,16 @@ Tip: run `openclaw cron --help` for the full command surface.
|
||||
Note: isolated `cron add` jobs default to `--announce` delivery. Use `--no-deliver` to keep
|
||||
output internal. `--deliver` remains as a deprecated alias for `--announce`.
|
||||
|
||||
Note: cron-owned isolated runs expect a plain-text summary and the runner owns
|
||||
the final send path. `--no-deliver` keeps the run internal; it does not hand
|
||||
delivery back to the agent's message tool.
|
||||
|
||||
Note: one-shot (`--at`) jobs delete after success by default. Use `--keep-after-run` to keep them.
|
||||
|
||||
Note: `--session` supports `main`, `isolated`, `current`, and `session:<id>`.
|
||||
Use `current` to bind to the active session at creation time, or `session:<id>` for
|
||||
an explicit persistent session key.
|
||||
|
||||
Note: for one-shot CLI jobs, offset-less `--at` datetimes are treated as UTC unless you also pass
|
||||
`--tz <iana>`, which interprets that local wall-clock time in the given timezone.
|
||||
|
||||
@@ -28,6 +36,41 @@ Note: recurring jobs now use exponential retry backoff after consecutive errors
|
||||
|
||||
Note: `openclaw cron run` now returns as soon as the manual run is queued for execution. Successful responses include `{ ok: true, enqueued: true, runId }`; use `openclaw cron runs --id <job-id>` to follow the eventual outcome.
|
||||
|
||||
Note: `openclaw cron run <job-id>` force-runs by default. Use `--due` to keep the
|
||||
older "only run if due" behavior.
|
||||
|
||||
Note: isolated cron turns suppress stale acknowledgement-only replies. If the
|
||||
first result is just an interim status update and no descendant subagent run is
|
||||
responsible for the eventual answer, cron re-prompts once for the real result
|
||||
before delivery.
|
||||
|
||||
Note: if an isolated cron run returns only the silent token (`NO_REPLY` /
|
||||
`no_reply`), cron suppresses direct outbound delivery and the fallback queued
|
||||
summary path as well, so nothing is posted back to chat.
|
||||
|
||||
Note: `cron add|edit --model ...` uses that selected allowed model for the job.
|
||||
If the model is not allowed, cron warns and falls back to the job's agent/default
|
||||
model selection instead. Configured fallback chains still apply, but a plain
|
||||
model override with no explicit per-job fallback list no longer appends the
|
||||
agent primary as a hidden extra retry target.
|
||||
|
||||
Note: isolated cron model precedence is Gmail-hook override first, then per-job
|
||||
`--model`, then any stored cron-session model override, then the normal
|
||||
agent/default selection.
|
||||
|
||||
Note: isolated cron fast mode follows the resolved live model selection. Model
|
||||
config `params.fastMode` applies by default, but a stored session `fastMode`
|
||||
override still wins over config.
|
||||
|
||||
Note: if an isolated run throws `LiveSessionModelSwitchError`, cron persists the
|
||||
switched provider/model (and switched auth profile override when present) before
|
||||
retrying. The outer retry loop is bounded to 2 switch retries after the initial
|
||||
attempt, then aborts instead of looping forever.
|
||||
|
||||
Note: failure notifications use `delivery.failureDestination` first, then
|
||||
global `cron.failureDestination`, and finally fall back to the job's primary
|
||||
announce target when no explicit failure destination is configured.
|
||||
|
||||
Note: retention/pruning is controlled in config:
|
||||
|
||||
- `cron.sessionRetention` (default `24h`) prunes completed isolated run sessions.
|
||||
@@ -78,3 +121,47 @@ openclaw cron add \
|
||||
```
|
||||
|
||||
`--light-context` applies to isolated agent-turn jobs only. For cron runs, lightweight mode keeps bootstrap context empty instead of injecting the full workspace bootstrap set.
|
||||
|
||||
Delivery ownership note:
|
||||
|
||||
- Cron-owned isolated jobs always route final user-visible delivery through the
|
||||
cron runner (`announce`, `webhook`, or internal-only `none`).
|
||||
- If the task mentions messaging some external recipient, the agent should
|
||||
describe the intended destination in its result instead of trying to send it
|
||||
directly.
|
||||
|
||||
## Common admin commands
|
||||
|
||||
Manual run:
|
||||
|
||||
```bash
|
||||
openclaw cron run <job-id>
|
||||
openclaw cron run <job-id> --due
|
||||
openclaw cron runs --id <job-id> --limit 50
|
||||
```
|
||||
|
||||
Agent/session retargeting:
|
||||
|
||||
```bash
|
||||
openclaw cron edit <job-id> --agent ops
|
||||
openclaw cron edit <job-id> --clear-agent
|
||||
openclaw cron edit <job-id> --session current
|
||||
openclaw cron edit <job-id> --session "session:daily-brief"
|
||||
```
|
||||
|
||||
Delivery tweaks:
|
||||
|
||||
```bash
|
||||
openclaw cron edit <job-id> --announce --channel slack --to "channel:C1234567890"
|
||||
openclaw cron edit <job-id> --best-effort-deliver
|
||||
openclaw cron edit <job-id> --no-best-effort-deliver
|
||||
openclaw cron edit <job-id> --no-deliver
|
||||
```
|
||||
|
||||
Failure-delivery note:
|
||||
|
||||
- `delivery.failureDestination` is supported for isolated jobs.
|
||||
- Main-session jobs may only use `delivery.failureDestination` when primary
|
||||
delivery mode is `webhook`.
|
||||
- If you do not set any failure destination and the job already announces to a
|
||||
channel, failure notifications reuse that same announce target.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user