Compare commits

..

208 Commits

Author SHA1 Message Date
kevinlin-openai
fc8e2196e9 fix(codex): enable native apps in app-server home 2026-05-06 09:40:05 -07:00
kevinlin-openai
e045e45210 feat(codex): use native plugin thread 2026-05-06 04:22:15 -07:00
Vincent Koc
34dc7f6ea6 Merge pull request #78378 from openclaw/fix/diagnostics-talk-prom
* commit '827e602d3a1bb726aaf68a02229a25ff3d848fc0':
  fix(diagnostics): include talk events in stability snapshots
  chore(plugin-sdk): refresh api baseline
  fix(diagnostics): export talk and recovery metrics
2026-05-06 02:03:19 -07:00
Vincent Koc
e2501b2d6d fix(diagnostics): export Talk metrics after SDK refactor
Adds bounded Talk lifecycle/audio diagnostics and session recovery metrics for OTEL, Prometheus, and stability snapshots after the Talk SDK/session refactor. Includes changelog/docs updates and Testbox/live proof.
2026-05-06 02:01:52 -07:00
Alex Knight
d9ffc1aa63 fix cron run binding route (#78373)
Co-authored-by: Alex Knight <15041791+amknight@users.noreply.github.com>
2026-05-06 18:57:32 +10:00
Vincent Koc
827e602d3a fix(diagnostics): include talk events in stability snapshots 2026-05-06 01:49:21 -07:00
Vincent Koc
8d9e7c8178 chore(plugin-sdk): refresh api baseline 2026-05-06 01:49:20 -07:00
Vincent Koc
aca844014f fix(diagnostics): export talk and recovery metrics 2026-05-06 01:48:07 -07:00
Peter Steinberger
0b88d6286c chore: bump version to 2026.5.6 2026-05-06 09:47:34 +01:00
Peter Steinberger
5cf55ed3f1 fix(openai): suppress stale Codex OAuth models 2026-05-06 09:38:07 +01:00
JC
85ded4d444 pdf: add Codex instructions for extraction fallback (#51329)
* Fix Codex PDF extraction fallback missing instructions

- add a Codex-specific systemPrompt on the PDF extraction fallback path
- keep non-Codex PDF fallback requests unchanged
- add regression coverage proving openai-codex-responses requests include instructions for PDF tool calls

* test: cover Codex text-only extraction fallback

- add regression coverage for the branch where PDF extraction includes images
  but the selected Codex model only accepts text input
- assert Codex-specific extraction instructions are still attached in that path

* test: fix extracted image mock shape

- add the required `type: "image"` field to the text-only fallback regression mock
- keep the new Codex coverage test aligned with PdfExtractedImage

* test: align Codex PDF fallback tests

* docs(changelog): note PDF Codex fallback fix

---------

Co-authored-by: Dr JCai <jingxiao.cai@gmail.com>
Co-authored-by: anyech <8743351+anyech@users.noreply.github.com>
2026-05-06 09:34:42 +01:00
Peter Steinberger
674c447264 ci: move additional checks to blacksmith 2026-05-06 09:33:43 +01:00
Peter Steinberger
ce8b0da9a2 test: slim secret runtime coverage 2026-05-06 09:33:28 +01:00
Alex Knight
ff655cb346 fix: preserve subagent task overrides (#78356)
Co-authored-by: Alex Knight <15041791+amknight@users.noreply.github.com>
2026-05-06 18:31:01 +10:00
Vincent Koc
0ddbf2e258 fix(plugins): keep managed npm mutations in legacy peer mode 2026-05-06 01:29:52 -07:00
Edionwheels
b902d86318 fix(cli): pass instructions for local openai-codex model probes (#76470)
* fix infer model run codex instructions

* docs changelog for codex model probe fix

* fix codex model probe instructions only

* docs: note codex model probe instruction shim

* chore: rerun proof gate

---------

Co-authored-by: Le LI <leli@LedeMacBook-Air.local>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-05-06 09:24:56 +01:00
Frank Yang
3e04755874 docs: add Frank Yang to maintainers 2026-05-06 16:19:19 +08:00
Peter Steinberger
a1b49c4b20 fix: stabilize google meet twilio joins 2026-05-06 09:18:20 +01:00
Peter Steinberger
2eaf8ad712 feat(plugins): support npm pack installs 2026-05-06 09:16:49 +01:00
Peter Steinberger
54e23b6d11 test: satisfy lint in optimized tests 2026-05-06 09:12:55 +01:00
Peter Steinberger
3fb1abcdcb test: isolate directory contract fixtures 2026-05-06 09:12:55 +01:00
Shubhankar Tripathy
9edeffc751 fix(codex/app-server): forward bootstrap into developerInstructions (#77372)
The OpenClaw workspace bootstrap block (SOUL.md, IDENTITY.md, USER.md,
TOOLS.md, BOOTSTRAP.md, MEMORY.md, HEARTBEAT.md) was only being merged into
Codex's config.instructions. The Codex app-server runtime overlay
consistently applies the explicit developerInstructions field, so persona
and style guidance present in the workspace was failing to shape Codex
behavior on session resume.

Build the workspace bootstrap block before finalizing developerInstructions
and join it into both:

- the baseline developerInstructions (initial assignment), and
- the context-engine developerInstructions (when context engine is active),
  preserving the existing config-engine projection addition.

The existing config.instructions merge stays intact, so the bootstrap now
reaches Codex through both paths and downstream hooks
(resolveAgentHarnessBeforePromptBuildResult) see what Codex will actually
receive. AGENTS.md remains excluded because Codex loads it natively.

Update the existing 'passes OpenClaw bootstrap files through ...' test to
also assert the developerInstructions field carries SOUL.md and the Codex
AGENTS.md substitution note while still excluding the native AGENTS.md
content.

Fixes #77363.
2026-05-06 09:09:59 +01:00
sliverp
af2719a7b9 docs(changelog): add entry for #78328 onboard stale channel plugin fallback 2026-05-06 16:01:32 +08:00
Sliverp
329580c64d fix(onboard): recover externalized channel plugin from stale config (#78328)
When a user's config has a stale `channels.<id>` entry (e.g. `appId`
or tokens left over from an earlier install) and the plugin is no
longer on disk -- for instance because the externalized npm package
was uninstalled or pruned during an upgrade -- `handleChannelChoice`
used to dead-end with "<channel> plugin not available." and leave
onboard stuck until the user manually deleted the config entry and
re-ran the CLI.

Two discovery paths are affected:

1. The `installedCatalogEntry` branch: when
   `loadScopedChannelPlugin` returns null but the catalog entry still
   carries `install.npmSpec`, fall back to
   `ensureChannelSetupPluginInstalled` with the same entry so onboard
   can reinstall the plugin from the official catalog.

2. The bundled-enable `else` branch: with a non-empty
   `channels.<id>` record, `isStaticallyChannelConfigured` drops the
   channel from `installableCatalogEntries`; if the plugin is also
   missing on disk (so it never enters `manifestInstalledIds`), both
   discovery buckets come back empty and the channel falls through to
   `enableBundledPluginForSetup`. Before delegating to that bundled
   path, consult the trusted catalog via
   `getTrustedChannelPluginCatalogEntry` and, if an `install.npmSpec`
   is available, drive the same catalog install flow used by a fresh
   pick of the channel.

Both new fallbacks re-apply the `resolveConfigDisabledHint` guard
that `enableBundledPluginForSetup` has always enforced, so an
operator-disabled channel (`plugins.entries.<id>.enabled === false`
or explicit `channels.<id>.enabled === false`) with a stale config
entry cannot be silently reinstalled or re-enabled through the
catalog path.

Both branches also keep their previous behavior when no catalog npm
spec is available (e.g. purely bundled channels), so this change is
a superset of the old flow rather than a replacement.

Affects all externalized channel plugins listed in the core
package's `files` exclusion (qqbot, bluebubbles, discord, whatsapp,
line, msteams, feishu, googlechat, nostr, zalo, zalouser,
synology-chat, tlon, twitch, and similar).
2026-05-06 15:55:16 +08:00
Edionwheels
58f81b0e04 fix(codex): honor OAuth contextTokens in native harness
Fixes #77858.

Co-authored-by: Edionwheels <267595845+lilesjtu@users.noreply.github.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-05-06 08:54:52 +01:00
Peter Steinberger
3915089a25 test: cache provider contract entries 2026-05-06 08:51:25 +01:00
Peter Steinberger
5969ac8ccf test: parallelize plugin package scan 2026-05-06 08:38:58 +01:00
Peter Steinberger
c5fcfa1b56 test: remove reload deferral wait 2026-05-06 08:34:17 +01:00
Ayaan Zaidi
3e0fcafb87 test(codex): use full runtime plan in app server tests 2026-05-06 13:03:54 +05:30
Ayaan Zaidi
6be5422fd6 fix(gateway): avoid plugin model resolution in session lists 2026-05-06 13:03:54 +05:30
Forge
ef517e1a54 Preserve session list model normalization 2026-05-06 13:03:54 +05:30
Forge
948375f494 Optimize session list model row resolution 2026-05-06 13:03:54 +05:30
Forge
8bfec5b9ac fix(sessions): fast-path qualified row model refs 2026-05-06 13:03:54 +05:30
Peter Steinberger
e59890eff0 test: speed up gateway cron history case 2026-05-06 08:31:28 +01:00
Vincent Koc
1a8a72e367 changelog: credit @keshavbotagent for #77949 2026-05-06 00:29:29 -07:00
Vincent Koc
8cc6638017 docs(cli): fix smart apostrophes in dns and health 2026-05-06 00:23:48 -07:00
keshavbotagent
3f210b10ce fix: show Codex tool progress in channel drafts (#77949)
Summary:
- Normalize Codex app-server dynamic and native tool activity into channel-visible tool progress.
- Keep Telegram message-tool-only progress drafts visible without duplicate dynamic item/tool lines.
- Preserve suppressed item progress while avoiding duplicate tool callbacks.

Verification:
- OPENCLAW_VITEST_MAX_WORKERS=1 pnpm test extensions/codex/src/app-server/event-projector.test.ts extensions/codex/src/app-server/run-attempt.test.ts extensions/telegram/src/bot-message-dispatch.test.ts src/auto-reply/reply/agent-runner-execution.test.ts src/auto-reply/reply/dispatch-from-config.test.ts --pool=forks --maxWorkers=1
- pnpm tsgo:extensions:test
- pnpm exec oxfmt --check --threads=1 CHANGELOG.md extensions/codex/src/app-server/event-projector.ts extensions/codex/src/app-server/event-projector.test.ts extensions/codex/src/app-server/run-attempt.ts extensions/codex/src/app-server/run-attempt.test.ts extensions/codex/src/app-server/tool-progress-normalization.ts extensions/telegram/src/bot-message-dispatch.ts extensions/telegram/src/bot-message-dispatch.test.ts src/auto-reply/get-reply-options.types.ts src/auto-reply/reply/agent-runner-execution.ts src/auto-reply/reply/agent-runner-execution.test.ts src/auto-reply/reply/dispatch-from-config.ts src/auto-reply/reply/dispatch-from-config.test.ts src/infra/agent-events.ts
- pnpm lint:extensions
- pnpm build
- CI on 6ff6a1f868: 88 success, 20 skipped, 1 neutral, no failures or pending checks

Fixes #75641.
2026-05-06 08:18:20 +01:00
Peter Steinberger
900e416688 test: avoid deepseek loader cold path 2026-05-06 08:17:44 +01:00
Vincent Koc
53809e52e9 docs(install/ansible): remove duplicate H1 2026-05-06 00:13:53 -07:00
Peter Steinberger
95fd321b68 test: mock web provider fast-path artifacts 2026-05-06 08:08:48 +01:00
Vincent Koc
13504f693d docs(tools/brave-search): remove duplicate H1 2026-05-06 00:03:33 -07:00
Vincent Koc
f8bb00bb8b fix(deps): override vulnerable ip-address 2026-05-05 23:59:43 -07:00
Peter Steinberger
f956d0993c test: avoid discord native command cold load 2026-05-06 07:56:37 +01:00
Peter Steinberger
e37607349b test: trim codex app-server test setup 2026-05-06 07:56:37 +01:00
Shakker
934247b4b7 docs: note gateway metadata scan reuse 2026-05-06 07:55:27 +01:00
Shakker
d46859d886 fix: reuse plugin snapshot for agent metadata 2026-05-06 07:55:27 +01:00
Shakker
fe393e4427 fix: reuse plugin snapshot for read-only channels 2026-05-06 07:55:27 +01:00
Shakker
df209586bd fix: reuse plugin snapshot for auto enable 2026-05-06 07:55:27 +01:00
Shakker
5655c2b066 fix: pass current snapshot to embedded runs 2026-05-06 07:55:27 +01:00
Shakker
ba1800e1bd fix: reuse plugin snapshot for embedded settings 2026-05-06 07:55:27 +01:00
Vincent Koc
852b9e7246 docs(channels/line): fix smart apostrophe 2026-05-05 23:53:36 -07:00
Peter Steinberger
ecf06d7abe test(line): narrow config schema parse failures 2026-05-06 07:49:27 +01:00
Peter Steinberger
8f3a34e2a1 refactor: share fs-safe JSON helpers 2026-05-06 07:40:10 +01:00
Peter Steinberger
cf83c5827d docs: clarify targeted local validation 2026-05-06 07:37:38 +01:00
Peter Steinberger
5e05052bb9 fix(line): require wildcard for open dm policy 2026-05-06 07:35:46 +01:00
Vincent Koc
24fc6a435f docs(providers/senseaudio): add missing Related section 2026-05-05 23:34:07 -07:00
Peter Steinberger
8e533490ab fix(plugins): repair managed npm openclaw peers
Remove stale managed-root openclaw manifests, locks, hidden locks, and installed copies before npm plugin installs.

Relink plugin-local openclaw peer symlinks after shared-root npm install, rollback, update, and uninstall mutations so SDK-using plugins keep resolving openclaw/plugin-sdk/*.

Force safe npm commands out of inherited legacy/strict peer-dependency modes.

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
Co-authored-by: Patrick Erichsen <patrick.a.erichsen@gmail.com>
2026-05-06 07:32:25 +01:00
Peter Steinberger
8cc762daff fix(feishu): keep topic sessions stable
Fixes Feishu native topic starter routing by hydrating a missing topic thread ID before session resolution.\n\nCloses #78262.
2026-05-06 07:30:27 +01:00
Vincent Koc
c0c38194f6 changelog: add Matrix approval delivery retry entry (#78179) 2026-05-05 23:29:14 -07:00
Vincent Koc
506b0bbaad docs(providers): remove duplicate H1 in provider directory 2026-05-05 23:25:47 -07:00
Patrick Erichsen
5107384e67 fix: stabilize Matrix tool progress QA (#78179)
* fix: stabilize matrix tool progress QA

* fix: handle backtick matrix progress previews

* fix: reuse observed matrix approvals

* fix: retry matrix generated image QA

* fix: wait for matrix sas trust propagation

* fix: resolve matrix target both approvals by reaction

* fix: avoid matrix target both approval echo wait

* fix: reuse observed matrix target both dm approval

* fix: retry matrix approval delivery

* fix: accept active matrix approval dm

* test: align matrix approval retry receipt

* test: include matrix approval view in retry fixture
2026-05-05 23:20:08 -07:00
Vincent Koc
eb4d654796 docs: typography hygiene across 6 pages (start/tools/nodes/mac/platforms) 2026-05-05 23:14:49 -07:00
Vincent Koc
6921a47562 docs: typography hygiene across 6 pages (channels/nodes/mac platforms) 2026-05-05 23:11:28 -07:00
Peter Steinberger
627b0073f2 test: remove gateway restart delay wait 2026-05-06 07:02:27 +01:00
Shakker
7544beea17 fix: preserve embedded dispatcher timeouts 2026-05-06 07:01:02 +01:00
Shakker
d52f581f76 fix: avoid fetch runtime proxy imports 2026-05-06 07:01:02 +01:00
Shakker
c9c66d7a1d fix: restore no-proxy dispatcher boundary 2026-05-06 07:01:02 +01:00
Vincent Koc
6807da544b fix(net): preserve no-proxy undici stream timeouts 2026-05-06 07:01:02 +01:00
Shakker
6cf7ae1d98 docs: note plugin fetch dispatcher fix 2026-05-06 07:01:02 +01:00
Shakker
95652d5867 test: cover no-proxy undici startup 2026-05-06 07:01:02 +01:00
Shakker
85ed972217 fix: lazy-load undici dispatchers 2026-05-06 07:01:02 +01:00
Ayaan Zaidi
98cbf7f11c fix: show current think level in Telegram picker (#78278) 2026-05-06 11:24:31 +05:30
Peter Steinberger
1672d35ef5 perf: avoid no-op plugin auto-enable scans 2026-05-06 06:53:51 +01:00
Peter Steinberger
5da9f5e57c test: remove cli retry test waits 2026-05-06 06:50:06 +01:00
Vincent Koc
fa2a32d0c5 docs: typography hygiene across 6 pages (cli/gateway/platforms) 2026-05-05 22:44:56 -07:00
hcl
5f783d7ddd Plugin skills: use Windows junction links
Fixes #77958.\n\nMaintainer-prepped by narrowing the branch to the Windows plugin-skills junction fix, rebasing onto current main, adding cleanup/idempotence regression coverage and changelog, and verifying local gates plus green CI.\n\nCo-authored-by: hcl <7755017+hclsys@users.noreply.github.com>\nCo-authored-by: Brad Groux <3053586+BradGroux@users.noreply.github.com>
2026-05-06 00:37:09 -05:00
拐爷&&老拐瘦
03e6a029ab Windows startup: handle localized schtasks access denied
Fixes #77993.\n\nMaintainer-prepped by rebasing onto current main, keeping the localized Windows schtasks Access Denied fallback scoped, adding focused regression coverage and changelog, and verifying local gates plus green CI.\n\nCo-authored-by: 拐爷&&老拐瘦 <geyunfei@gmail.com>\nCo-authored-by: Brad Groux <3053586+BradGroux@users.noreply.github.com>
2026-05-06 00:36:54 -05:00
Vincent Koc
e85fd2abcd docs: typography hygiene + dup H1 across 5 pages (cli/gateway/help) 2026-05-05 22:35:00 -07:00
Peter Steinberger
6febffb6fe test: harden active memory timeout specs 2026-05-06 06:30:48 +01:00
Vincent Koc
b23232d560 docs: typography hygiene across 6 pages (mac platform + sandbox/wizard) 2026-05-05 22:25:27 -07:00
Peter Steinberger
6c743021d7 test: stabilize active memory timeout mocks 2026-05-06 06:18:57 +01:00
Vincent Koc
f505c84285 docs: typography hygiene across 7 high-traffic pages 2026-05-05 22:16:37 -07:00
Peter Steinberger
4ec693a81a test: interleave cold full-suite shards 2026-05-06 06:08:27 +01:00
Vincent Koc
f531eff629 docs: audit and fix 5 pages (typography hygiene + dup H1) 2026-05-05 22:04:37 -07:00
Peter Steinberger
06c490f818 test: support higher vitest shard parallelism 2026-05-06 05:57:53 +01:00
Vincent Koc
981e32d05d docs(reference): audit and fix 4 pages (typography, dup H1, Related) 2026-05-05 21:56:31 -07:00
Peter Steinberger
1f6ce72b8a test: trim cron and context-engine waits 2026-05-06 05:55:34 +01:00
Vincent Koc
8a68ea092d changelog: add xAI thinking-profile clamp entry 2026-05-05 21:50:33 -07:00
Peter Steinberger
f2ce83833a test: avoid spawning cli help in metadata test 2026-05-06 05:48:21 +01:00
Vincent Koc
963073088d docs: audit and fix 5 pages (sentence-case headings + Related/title) 2026-05-05 21:48:05 -07:00
Peter Steinberger
6da5eda488 test: avoid real waits in cdp and outbound tests 2026-05-06 05:43:48 +01:00
Vincent Koc
cbaf999bd2 docs: audit and fix 4 pages (sentence-case headings + Related links) 2026-05-05 21:42:03 -07:00
Jesse Merhi
5b00cd1ae1 fix: narrow Gateway proxy bypass target (#77018)
* fix: narrow Gateway proxy bypass target

* fix: narrow Gateway proxy bypass target

* fix(clawsweeper): address review for automerge-openclaw-openclaw-77018 (1)

* fix(clawsweeper): address review for automerge-openclaw-openclaw-77018 (2)

* fix(clawsweeper): address review for automerge-openclaw-openclaw-77018 (validation-3)

* fix(clawsweeper): address review for automerge-openclaw-openclaw-77018 (4-final)

* fix: narrow Gateway proxy bypass target

* fix(clawsweeper): address review for automerge-openclaw-openclaw-77018 (1)

* fix(clawsweeper): address review for automerge-openclaw-openclaw-77018 (2)

* fix(clawsweeper): reconcile automerge-openclaw-openclaw-77018 with main (1)

---------

Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
2026-05-06 14:40:31 +10:00
Peter Steinberger
be1c99b76a test: pass env to fallback metadata snapshot 2026-05-06 05:33:38 +01:00
Peter Steinberger
e9987ffc3a fix: clamp xAI live gateway thinking 2026-05-06 05:33:38 +01:00
Peter Steinberger
afc2c2e207 test(browser): avoid real retry waits 2026-05-06 05:33:28 +01:00
Vincent Koc
1ded8de5a9 docs: audit and fix 3 pages (typography across help/channels) 2026-05-05 21:28:47 -07:00
Peter Steinberger
82c4fd8f56 test: cache fallback metadata snapshot 2026-05-06 05:20:55 +01:00
Vincent Koc
41736de923 docs: audit and fix 4 pages (pi version bump + 3 typography/H1) 2026-05-05 21:14:55 -07:00
Peter Steinberger
ea26a9dba0 fix: omit xAI reasoning efforts 2026-05-06 05:13:10 +01:00
pickaxe
d221d7b6a9 fix(plugins): isolate peer-link repair failures 2026-05-06 05:13:01 +01:00
pickaxe
4d248b887f test(plugins): remove unnecessary peer-link assertion 2026-05-06 05:13:01 +01:00
pickaxe
fb42c722f0 fix(plugins): repair peer links after npm updates 2026-05-06 05:13:01 +01:00
Brandon
eecda912ee fix(msteams): surface network errors blocking bot JWT validation and outbound replies (#77674) (#78081)
* fix(msteams): surface network errors blocking Teams bot JWT validation and outbound replies (#77674)

When login.botframework.com or smba.trafficmanager.net egress is blocked,
errors previously disappeared completely. JWT validator swallowed network
errors and returned false (401 looked identical to a bad credential), and
outbound send failures with transport-level codes had no hint pointing to
the Connector endpoint.

- sdk.ts: rethrow ECONNREFUSED/ENOTFOUND/EHOSTUNREACH/ETIMEDOUT/ECONNRESET
  from the JWKS key fetch so callers can distinguish firewall blocks from bad
  credentials; add isJwksNetworkError() helper
- monitor.ts: catch rethrown network errors in JWT middleware and log at
  runtime.error level with an actionable message pointing to
  login.botframework.com:443; upgrade allowlist resolution failures from
  runtime.log (optional/silent) to runtime.error
- errors.ts: add "network" kind to classifyMSTeamsSendError for transport-level
  errors (ECONNREFUSED, ENOTFOUND, etc.); add formatMSTeamsSendErrorHint for
  "network" kind pointing to smba.trafficmanager.net and egress rules
- monitor-handler.ts, message-handler.ts: remove spurious ?. from runtime.error
  calls (RuntimeEnv.error is a required non-optional field)

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

* fix(msteams): surface blocked botframework egress

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Brad Groux <3053586+BradGroux@users.noreply.github.com>
2026-05-05 23:11:06 -05:00
Peter Steinberger
5d7262c410 test: align telegram reply assertions with streaming defaults 2026-05-06 05:08:51 +01:00
Vincent Koc
c5ea7c4d0f docs: typography hygiene across 6 pages 2026-05-05 21:04:19 -07:00
Peter Steinberger
2df7ec5671 test: avoid bundled channel cold loads in message tool tests 2026-05-06 05:04:03 +01:00
Peter Steinberger
b85b1c68d1 Refactor file access to use fs-safe primitives (#78255)
* refactor: use fs-safe primitives across file access

* fix: preserve invalid managed npm manifests

* fix: keep fs seams for startup metadata
2026-05-06 05:03:11 +01:00
Vincent Koc
0d73f174a9 docs: typography hygiene + 2 in-body H1 removals across 5 pages 2026-05-05 21:01:44 -07:00
Peter Steinberger
f35fb7288a test: mock manifest normalization in fallback tests 2026-05-06 04:58:33 +01:00
Vincent Koc
68a82cb2e2 docs: typography hygiene + 2 in-body H1 removals across 6 pages
Replaced 60 typography characters (curly quotes, apostrophes, em/en
dashes, non-breaking hyphens) with ASCII equivalents per
docs/CLAUDE.md heading and content hygiene rules.

- docs/start/openclaw.md: 10 chars; removed the duplicate '# Building
  a personal assistant with OpenClaw' H1 (Mintlify renders title from
  frontmatter).
- docs/platforms/mac/remote.md: 10 chars; removed the duplicate
  '# Remote OpenClaw (macOS ⇄ remote host)' H1 (the U+21C4 codepoint
  and parens both produced brittle anchors).
- docs/tools/thinking.md: 10 chars
- docs/reference/templates/BOOTSTRAP.md: 10 chars (kept the in-body
  '# BOOTSTRAP.md - Hello, World' heading because the page is a
  template whose content is meant to be copied verbatim into a
  workspace BOOTSTRAP.md).
- docs/plugins/sdk-provider-plugins.md: 10 chars
- docs/platforms/macos.md: 10 chars
2026-05-05 20:58:10 -07:00
Ayaan Zaidi
3afc902f3d fix(telegram): finalize streamed replies in place (#77947) 2026-05-06 09:27:08 +05:30
Ayaan Zaidi
814b125f11 fix(telegram): separate progress drafts from final replies 2026-05-06 09:27:08 +05:30
Ayaan Zaidi
e27f179361 fix(telegram): verify final stream edit landed 2026-05-06 09:27:08 +05:30
Ayaan Zaidi
748d6dc75e test(qa): assert telegram streamed final count 2026-05-06 09:27:08 +05:30
Ayaan Zaidi
512f777099 test(qa): thread telegram long final prompts 2026-05-06 09:27:08 +05:30
Ayaan Zaidi
25fc85afa2 test(telegram): cover single stream delivery 2026-05-06 09:27:08 +05:30
Ayaan Zaidi
bca16d0f00 fix(telegram): finalize streamed text in place 2026-05-06 09:27:08 +05:30
Peter Steinberger
d7bd9fe049 fix(discord): route guild text commands (#78080) 2026-05-06 04:56:09 +01:00
Bryce D. Greybeard
b5c33bc204 fix(discord): avoid false heartbeat ACK timeouts
Fix the Discord Gateway heartbeat scheduler so ACK timeout checks are measured from the actual heartbeat send, not from the fixed HELLO-time interval. This prevents late randomized first heartbeats from causing false reconnect loops while the Discord channel is still awaiting readiness.\n\nVerification:\n- pnpm test extensions/discord/src/internal/gateway-lifecycle.test.ts extensions/discord/src/internal/gateway.test.ts\n- pnpm exec oxfmt --check --threads=1 CHANGELOG.md extensions/discord/src/internal/gateway-lifecycle.ts extensions/discord/src/internal/gateway-lifecycle.test.ts extensions/discord/src/internal/gateway.test.ts\n- git diff --check\n- Real behavior proof check passed on PR head bf239b886020c11d55af33f16674e953535f9b4c\n\nFixes #77668.\nSupersedes #77956.\nThanks @bryce-d-greybeard and @NikolaFC.
2026-05-06 04:46:46 +01:00
Vincent Koc
4ee234f8ee docs: typography hygiene across 6 pages
Replaced 66 typography characters (curly quotes, apostrophes, em/en
dashes, non-breaking hyphens) with ASCII equivalents per
docs/CLAUDE.md heading and content hygiene rules.

- docs/channels/mattermost.md: 12 chars
- docs/tools/plugin.md: 11 chars
- docs/providers/xai.md: 11 chars
- docs/plugins/building-plugins.md: 11 chars
- docs/concepts/streaming.md: 11 chars
- docs/concepts/model-providers.md: 11 chars
2026-05-05 20:45:39 -07:00
Peter Steinberger
ebb8bed78f fix: cap memory wiki filenames for safe writes 2026-05-06 04:44:14 +01:00
Peter Steinberger
777c539daf fix: harden sandboxed patch parent paths 2026-05-06 04:44:14 +01:00
Peter Steinberger
cbc228f0f6 docs: explain blocked plugin ownership repair 2026-05-06 04:43:37 +01:00
Alex Alaniz
b971ebaaab fix(exec-approvals): guard Windows rename fallback (#77907)
* fix exec approvals Windows rename fallback

* fix(exec-approvals): restore approvals directory mode

* fix(exec-approvals): normalize fallback temp mode

---------

Co-authored-by: Brad Groux <3053586+BradGroux@users.noreply.github.com>
2026-05-05 22:39:41 -05:00
Vincent Koc
f4a63940cc docs: typography hygiene across 6 pages
Replaced 74 typography characters (curly quotes, apostrophes, em/en
dashes, non-breaking hyphens) with ASCII equivalents per
docs/CLAUDE.md heading and content hygiene rules.

- docs/gateway/opentelemetry.md: 13 chars
- docs/channels/msteams.md: 13 chars
- docs/tools/skills.md: 12 chars
- docs/start/setup.md: 12 chars
- docs/nodes/location-command.md: 12 chars
- docs/concepts/context-engine.md: 12 chars
2026-05-05 20:34:37 -07:00
Vincent Koc
ae9f779e5f docs: typography hygiene + 1 in-body H1 removal across 6 pages
Replaced 84 typography characters (curly quotes, apostrophes, em/en
dashes, non-breaking hyphens) with ASCII equivalents per
docs/CLAUDE.md heading and content hygiene rules.

- docs/gateway/tools-invoke-http-api.md: 14 chars; removed the
  duplicate '# Tools Invoke (HTTP)' H1 (Mintlify renders title from
  frontmatter; the in-body H1 with parens produced a brittle anchor).
- docs/tools/browser-control.md: 14 chars
- docs/security/formal-verification.md: 14 chars
- docs/gateway/configuration-reference.md: 14 chars
- docs/concepts/agent.md: 14 chars
- docs/channels/qa-channel.md: 14 chars
2026-05-05 20:26:16 -07:00
github-actions[bot]
d71c11983f chore(ui): refresh nl control ui locale 2026-05-06 03:22:57 +00:00
github-actions[bot]
186d247209 chore(ui): refresh fa control ui locale 2026-05-06 03:22:53 +00:00
github-actions[bot]
020581ac7f chore(ui): refresh vi control ui locale 2026-05-06 03:22:49 +00:00
github-actions[bot]
f51436868b chore(ui): refresh th control ui locale 2026-05-06 03:22:09 +00:00
github-actions[bot]
9ce00b7756 chore(ui): refresh pl control ui locale 2026-05-06 03:22:01 +00:00
github-actions[bot]
a0a74608ff chore(ui): refresh id control ui locale 2026-05-06 03:21:47 +00:00
github-actions[bot]
b868f4e2be chore(ui): refresh uk control ui locale 2026-05-06 03:21:39 +00:00
github-actions[bot]
4e867ea2c9 chore(ui): refresh tr control ui locale 2026-05-06 03:21:05 +00:00
github-actions[bot]
1a3d77531d chore(ui): refresh it control ui locale 2026-05-06 03:20:59 +00:00
github-actions[bot]
b9eb969d9a chore(ui): refresh ar control ui locale 2026-05-06 03:20:54 +00:00
github-actions[bot]
fc6737bd0a chore(ui): refresh fr control ui locale 2026-05-06 03:20:29 +00:00
github-actions[bot]
c17bcb99e1 chore(ui): refresh ko control ui locale 2026-05-06 03:20:03 +00:00
github-actions[bot]
3cff0d3dc8 chore(ui): refresh ja-JP control ui locale 2026-05-06 03:20:01 +00:00
github-actions[bot]
19071cc6a5 chore(ui): refresh es control ui locale 2026-05-06 03:19:54 +00:00
github-actions[bot]
76e8f59f17 chore(ui): refresh zh-CN control ui locale 2026-05-06 03:19:13 +00:00
github-actions[bot]
931645e090 chore(ui): refresh zh-TW control ui locale 2026-05-06 03:19:06 +00:00
github-actions[bot]
47b65154ae chore(ui): refresh de control ui locale 2026-05-06 03:19:02 +00:00
github-actions[bot]
9111f83765 chore(ui): refresh pt-BR control ui locale 2026-05-06 03:18:55 +00:00
Val Alexander
c17121b1cc test(control-ui): refresh i18n raw copy baseline 2026-05-05 22:16:30 -05:00
Val Alexander
8aa377babe fix(control-ui): refine sessions compaction details 2026-05-05 22:16:30 -05:00
Vincent Koc
861a593921 docs: typography hygiene across 5 pages
Replaced 75 typography characters (curly quotes, apostrophes, em/en
dashes, non-breaking hyphens) with ASCII equivalents per
docs/CLAUDE.md heading and content hygiene rules.

- docs/plugins/skill-workshop.md: 15 chars
- docs/gateway/pairing.md: 15 chars
- docs/gateway/configuration.md: 15 chars
- docs/concepts/oauth.md: 15 chars
- docs/channels/bluebubbles.md: 15 chars
2026-05-05 20:14:18 -07:00
Peter Steinberger
c73f774b9b test: stabilize active-memory timeout partials 2026-05-06 04:11:02 +01:00
Val Alexander
e2858e70dd chore: update channel status protocol models 2026-05-05 22:09:45 -05:00
Val Alexander
60171e8638 Keep Control UI responsive under slow status and history loads 2026-05-05 22:07:39 -05:00
Peter Steinberger
3f6b481464 fix: serialize concurrent transcript appends 2026-05-06 04:06:28 +01:00
Vincent Koc
fafd76c5e6 docs: typography hygiene across 5 pages
Replaced 80 typography characters (curly quotes, apostrophes, em/en
dashes, non-breaking hyphens) with ASCII equivalents per
docs/CLAUDE.md heading and content hygiene rules.

- docs/plugins/sdk-entrypoints.md: 17 chars
- docs/help/index.md: 17 chars
- docs/concepts/agent-workspace.md: 16 chars
- docs/tools/lobster.md: 15 chars
- docs/tools/exec-approvals.md: 15 chars
2026-05-05 20:04:12 -07:00
Val Alexander
49c4a13231 fix(sessions): restore Control UI /new hooks
Fixes #76957.

Restores the Control UI /new hook lifecycle through an explicit sessions.create emitCommandHooks opt-in, preserving hook-free defaults for programmatic parent-session creates.

Validation:
- pnpm protocol:check
- pnpm test src/gateway/server.sessions.reset-hooks.test.ts ui/src/ui/app-render.helpers.node.test.ts
- pnpm exec oxlint on touched TS files
- pnpm exec oxfmt --check --threads=1 on touched files
- git diff --check
- OPENCLAW_LOCAL_CHECK=1 OPENCLAW_LOCAL_CHECK_MODE=throttled env NODE_OPTIONS=--max-old-space-size=4096 pnpm check:changed
- GitHub PR checks green on 3a446ec78e
- ClawSweeper re-review completed with no blocking findings and security cleared

Duplicate triage:
- #77376, #77004, and #76967 were superseded closed attempts for #76957
- #77562 is a closed duplicate issue
- #77880 mentions #76957 but is not a duplicate of this hook fix
2026-05-05 21:57:22 -05:00
Val Alexander
3110c621df fix(gateway): preserve mixed assistant history text
Preserve visible assistant text from mixed text/tool-use transcript turns in chat.history while keeping commentary-only assistant turns hidden.

Fixes #77374.

Verification:
- pnpm test src/gateway/server-methods/server-methods.test.ts src/gateway/server.chat.gateway-server-chat-b.test.ts
- pnpm exec oxfmt --check --threads=1 src/gateway/chat-display-projection.ts src/gateway/server-methods/server-methods.test.ts src/gateway/server.chat.gateway-server-chat-b.test.ts
- git diff --check
- pnpm changed:lanes --json
- PR CI passed on 048266c5a5
2026-05-05 21:56:56 -05:00
Vincent Koc
7a39551685 docs: typography hygiene + 2 in-body H1 removals across 5 pages
Replaced 92 typography characters (curly quotes, apostrophes, em/en
dashes, non-breaking hyphens) with ASCII equivalents per
docs/CLAUDE.md heading and content hygiene rules.

- docs/channels/feishu.md: 19 chars; removed the duplicate
  '# Feishu / Lark' H1 (Mintlify renders title from frontmatter; the
  in-body H1 with a slash produced a brittle anchor).
- docs/gateway/bonjour.md: 18 chars; removed the duplicate
  '# Bonjour / mDNS discovery' H1.
- docs/channels/matrix.md: 19 chars
- docs/tools/browser.md: 18 chars
- docs/automation/standing-orders.md: 18 chars
2026-05-05 19:54:53 -07:00
Vincent Koc
4395f1dd66 docs: typography hygiene + drop one in-body H1 across 5 pages
Replaced 98 typography characters (curly quotes, apostrophes, em/en
dashes, non-breaking hyphens) with ASCII equivalents per
docs/CLAUDE.md heading and content hygiene rules.

- docs/plugins/sdk-migration.md: 20 chars
- docs/help/testing.md: 20 chars
- docs/automation/tasks.md: 20 chars
- docs/plugins/sdk-channel-plugins.md: 19 chars
- docs/channels/yuanbao.md: 19 chars; removed the duplicate '# Yuanbao'
  H1 (Mintlify renders title from frontmatter).
2026-05-05 19:46:32 -07:00
Peter Steinberger
8489d0eb68 test: update spawn workspace pi settings mock 2026-05-06 03:43:39 +01:00
Peter Steinberger
ea391c6df2 test: stabilize cron and pairing shard hangs 2026-05-06 03:36:46 +01:00
Brad Hallett
0bdba47a3e fix: disable Pi auto-compaction when safeguard mode is active (#73839)
Merged via squash.

Prepared head SHA: d554201343
Co-authored-by: bradhallett <53977268+bradhallett@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
2026-05-05 19:35:47 -07:00
Vincent Koc
2b8d91d9ee docs: typography hygiene + 2 in-body H1 removals across 5 pages
Replaced 112 typography characters (curly quotes, apostrophes, em/en
dashes, non-breaking hyphens) with ASCII equivalents per
docs/CLAUDE.md heading and content hygiene rules.

- docs/help/gpt55-codex-agentic-parity.md: 22 chars; removed the
  duplicate '# GPT-5.5 / Codex Agentic Parity in OpenClaw' H1 (Mintlify
  renders the title from frontmatter; the in-body H1 with the slash
  produced a brittle anchor).
- docs/platforms/mac/menu-bar.md: 21 chars; removed the duplicate
  '# Menu Bar Status Logic' H1.
- docs/tools/acp-agents.md: 23 chars
- docs/concepts/qa-matrix.md: 23 chars
- docs/concepts/qa-e2e-automation.md: 23 chars
2026-05-05 19:34:52 -07:00
Vincent Koc
b9f711089a docs: typography hygiene + drop one in-body H1 across 5 pages
Replaced 138 typography characters (curly quotes, apostrophes, em/en
dashes, non-breaking hyphens) with ASCII equivalents per
docs/CLAUDE.md heading and content hygiene rules so grep, copy-paste,
and Mintlify search hit clean tokens.

- docs/reference/AGENTS.default.md: 29 chars, plus removed the
  duplicate '# AGENTS.md - OpenClaw Personal Assistant (default)' H1
  (Mintlify renders title from frontmatter; the in-body H1 with
  parens and a bare hyphen produced a brittle anchor).
- docs/help/testing-live.md: 29 chars
- docs/tools/image-generation.md: 28 chars
- docs/channels/index.md: 27 chars
- docs/tools/video-generation.md: 25 chars
2026-05-05 19:25:16 -07:00
Peter Steinberger
74532265f4 test: tolerate archive race outcomes 2026-05-06 03:23:25 +01:00
Vincent Koc
736f627fb5 docs: typography hygiene across 4 large pages
Replaced 152 typography characters (curly quotes, apostrophes, em/en
dashes, non-breaking hyphens) with ASCII equivalents so grep,
copy-paste, and Mintlify search hit clean tokens. Per docs/CLAUDE.md
heading and content hygiene rules.

- docs/gateway/security/index.md: 59 chars
- docs/plugins/hooks.md: 34 chars
- docs/reference/session-management-compaction.md: 30 chars
- docs/tools/clawhub.md: 29 chars
2026-05-05 19:19:15 -07:00
Peter Steinberger
585bff4b75 test: accept archive race refusal variants 2026-05-06 03:17:59 +01:00
Peter Steinberger
b60d5f4024 test: keep voice-call runtime tests on public seams 2026-05-06 03:09:33 +01:00
Peter Steinberger
1d1b3a398d test: keep voice-call runtime test on sdk seam 2026-05-06 03:07:44 +01:00
Val Alexander
36df0d93b9 fix: repair iOS LAN pairing
Fix iOS LAN/setup-code pairing policy for #47887.

- Allow explicit private LAN and .local plaintext ws:// setup/manual connects where policy allows it.
- Keep public hosts, .ts.net, and Tailscale CGNAT plaintext fail-closed.
- Prefer explicit passwords over stale bootstrap tokens in Swift and TypeScript gateway clients.
- Update setup-code/device-pair coverage, docs, and changelog with source credit for #65185.

Verification:
- pnpm install
- git diff --check origin/main..HEAD
- pnpm exec oxfmt --check --threads=1 src/gateway/client.ts src/gateway/client.test.ts src/pairing/setup-code.ts src/pairing/setup-code.test.ts extensions/device-pair/index.ts extensions/device-pair/index.test.ts
- pnpm format:docs:check
- pnpm test src/gateway/client.test.ts src/pairing/setup-code.test.ts extensions/device-pair/index.test.ts
- cd apps/shared/OpenClawKit && swift test --filter 'DeepLinksSecurityTests|GatewayNodeSessionTests'
- pnpm lint:swift passes with the existing TalkModeRuntime.swift type-body-length warning

Blocked locally:
- iOS app-target xcodebuild tests require unavailable watchOS 26.4 runtime here.
- Testbox check:changed previously failed because the image lacks swiftlint; local swiftlint passes.
2026-05-05 21:07:19 -05:00
Peter Steinberger
ae7c13e284 test: restore current-main test isolation 2026-05-06 03:04:55 +01:00
Vincent Koc
bff5051e38 docs: drop in-body H1s and typography hygiene across 4 pages
docs/install/macos-vm.md: removed the duplicate '# OpenClaw on macOS
VMs (Sandboxing)' H1 (Mintlify renders title from frontmatter; the
in-body H1 plus parens produced a brittle anchor).

docs/install/development-channels.md: removed the duplicate
'# Development channels' H1.

docs/install/index.md: replaced 3 typography characters (curly quotes
and en-dash) with ASCII equivalents.

docs/concepts/delegate-architecture.md: replaced 10 typography
characters (curly quotes, apostrophes, em/en dashes) with ASCII
equivalents.
2026-05-05 19:04:46 -07:00
Peter Steinberger
6ad601d195 test: align archive hardlink guard expectation 2026-05-06 03:04:27 +01:00
Peter Steinberger
8b9b849b19 test: align fs-safe race expectations 2026-05-06 03:02:47 +01:00
Vincent Koc
9671a91590 docs: Related CardGroups + typography hygiene across 4 pages
docs/install/clawdock.md: renamed '## Related pages' to '## Related'
for consistency with sibling install docs and converted the 3-bullet
list into a CardGroup linking docker, docker-vm-runtime, and updating.

docs/install/nix.md: replaced 2 typography characters with ASCII
equivalents and converted the 3-bullet Related list into a CardGroup,
adding an Updating card so readers wiring nix-openclaw next to a
managed install see the upgrade path.

docs/concepts/features.md: converted the 2-bullet Related list into a
CardGroup, adding cross-links to channels and plugins so the page now
points readers at both deeper concepts (experimental features, agent
runtime) and direct surfaces (channels, plugins).

docs/tools/pdf.md: replaced 2 typography characters with ASCII
equivalents.
2026-05-05 18:56:25 -07:00
Peter Steinberger
9e108fa9a7 fix: repair fs-safe ci expectations 2026-05-06 02:56:12 +01:00
Peter Steinberger
b43efd3793 fix: clean up post-land CI guards 2026-05-06 02:51:53 +01:00
Peter Steinberger
8294229592 test: refresh fs-safe boundary expectations 2026-05-06 02:50:36 +01:00
Peter Steinberger
a6a4140ee7 fix(media): handle canonical inbound media paths 2026-05-06 02:50:36 +01:00
Peter Steinberger
d47c624370 docs(release): clarify unpublished beta tag movement 2026-05-06 02:49:47 +01:00
Peter Steinberger
9ff7fe08e9 docs: standardize compact PR author activity 2026-05-06 02:46:27 +01:00
Vincent Koc
e36cb33379 docs: drop in-body H1s and typography hygiene across 4 pages
docs/install/gcp.md: removed the duplicate '# OpenClaw on GCP Compute
Engine (Docker, Production VPS Guide)' H1 plus its redundant '## Goal'
header. Mintlify renders the title from frontmatter, so the body H1
created a brittle anchor and the prose now starts directly with the
goal sentence.

docs/install/node.md: replaced 8 typography characters (curly quotes
and non-breaking hyphens) with ASCII equivalents.

docs/tools/duckduckgo-search.md: replaced 9 typography characters with
ASCII equivalents.

docs/tools/browser-login.md: removed the duplicate '# Browser login +
X/Twitter posting' H1 (Mintlify renders title from frontmatter; the
'+' would also have produced a brittle anchor). Replaced 2 typography
characters with ASCII equivalents.
2026-05-05 18:46:03 -07:00
Peter Steinberger
73d9044204 docs(agents): prefer crabbox webvnc inspection 2026-05-06 02:43:49 +01:00
Peter Steinberger
057d3a43c0 feat(mantis): capture logged-in discord web evidence 2026-05-06 02:43:49 +01:00
Peter Steinberger
20163313af fix: resolve fs-safe post-land fallout 2026-05-06 02:41:36 +01:00
Peter Steinberger
71cd132f1f docs: remove refactor notes 2026-05-06 02:40:34 +01:00
Peter Steinberger
9b1d28edf1 chore: refresh talk sdk baseline 2026-05-06 02:39:15 +01:00
Peter Steinberger
df29682384 test: update talk unit-fast paths 2026-05-06 02:39:15 +01:00
Peter Steinberger
e02ddf71af fix: guard managed talk room control 2026-05-06 02:39:15 +01:00
Peter Steinberger
0402ae327e test: generate hook install archives 2026-05-06 02:39:15 +01:00
Peter Steinberger
c7b69a319b test: retry gateway chat temp cleanup 2026-05-06 02:39:15 +01:00
Peter Steinberger
df4db5a721 test: isolate main auth profile fixtures 2026-05-06 02:39:15 +01:00
Peter Steinberger
f1636d5e28 refactor: unify talk session runtime 2026-05-06 02:39:15 +01:00
Peter Steinberger
7431cb8def docs: detail talk refactor plan 2026-05-06 02:39:15 +01:00
Peter Steinberger
7760edc68e chore: refresh talk generated metadata 2026-05-06 02:39:15 +01:00
Peter Steinberger
ada560ece4 feat: adapt voice surfaces to talk events 2026-05-06 02:39:15 +01:00
Peter Steinberger
9e6f38f4e1 feat: unify browser realtime talk clients 2026-05-06 02:39:15 +01:00
Peter Steinberger
466f718320 feat: wire talk handoff into native nodes 2026-05-06 02:39:15 +01:00
Peter Steinberger
c434d7720b feat: add unified talk gateway sessions 2026-05-06 02:39:15 +01:00
Peter Steinberger
7225a2678e feat: expose talk-capable realtime providers 2026-05-06 02:39:15 +01:00
Peter Steinberger
c90c68c636 feat: add shared talk runtime primitives 2026-05-06 02:39:15 +01:00
Peter Steinberger
24853ced11 docs: outline unified talk API 2026-05-06 02:39:15 +01:00
Vincent Koc
1f7d0ef310 docs: typography hygiene + Related CardGroups across 4 pages
docs/concepts/context.md: replaced 12 curly quote and italic-marker
typography characters with ASCII equivalents so grep, copy-paste, and
Mintlify search hit clean tokens. Converted the 4-bullet Related list
into a CardGroup linking context-engine, compaction, system-prompt,
and agent-loop. Verified all four targets exist.

docs/concepts/soul.md: replaced 7 typography characters (curly
apostrophe in 'agent's' and similar) with ASCII equivalents. Renamed
'## Related docs' to '## Related' for consistency with sibling pages
and converted the 3-bullet list into a CardGroup linking
agent-workspace, system-prompt, and the SOUL.md template.

docs/tools/perplexity-search.md: removed the duplicate
'# Perplexity Search API' H1 (Mintlify renders title from frontmatter).
Replaced 2 typography characters and converted the 4-bullet Related
list into a CardGroup; verified web/brave-search/exa-search targets.

docs/tools/apply-patch.md: converted the 3-bullet Related list into a
CardGroup linking diffs, exec, and code-execution.
2026-05-05 18:36:06 -07:00
Vincent Koc
7f71e84248 docs(concepts): typography hygiene + Related CardGroups across 3 pages
docs/concepts/presence.md: replaced 8 curly quote and non-breaking
hyphen characters (U+201C/U+201D/U+2019/U+2011) with ASCII equivalents
so grep, copy-paste, and Mintlify search hit the right tokens.
Converted the 2-bullet Related list into a CardGroup adding cross-links
to gateway architecture and gateway protocol since presence is produced
by both surfaces.

docs/concepts/markdown-formatting.md: replaced 5 typography characters
(en-dash and curly quotes) with ASCII equivalents and converted the
2-bullet Related list into a CardGroup pointing at streaming/chunking
and system prompt.

docs/concepts/typing-indicators.md: replaced 4 typography characters
with ASCII equivalents and converted the 2-bullet Related list into a
CardGroup with the same Presence and Streaming cross-links.

Verified /concepts/streaming, /concepts/system-prompt,
/concepts/architecture, and /gateway/protocol targets all exist.
2026-05-05 18:30:39 -07:00
Peter Steinberger
29ddcc688e docs: require global GitHub activity in PR triage 2026-05-06 02:28:22 +01:00
Peter Steinberger
601b4819cb test: refresh plugin loader boundary assertions 2026-05-06 02:24:43 +01:00
Peter Steinberger
538605ff44 [codex] Extract filesystem safety primitives (#77918)
* refactor: extract filesystem safety primitives

* refactor: use fs-safe for file access helpers

* refactor: reuse fs-safe for media reads

* refactor: use fs-safe for image reads

* refactor: reuse fs-safe in qqbot media opener

* refactor: reuse fs-safe for local media checks

* refactor: consume cleaner fs-safe api

* refactor: align fs-safe json option names

* fix: preserve fs-safe migration contracts

* refactor: use fs-safe primitive subpaths

* refactor: use grouped fs-safe subpaths

* refactor: align fs-safe api usage

* refactor: adapt private state store api

* chore: refresh proof gate

* refactor: follow fs-safe json api split

* refactor: follow reduced fs-safe surface

* build: default fs-safe python helper off

* fix: preserve fs-safe plugin sdk aliases

* refactor: consolidate fs-safe usage

* refactor: unify fs-safe store usage

* refactor: trim fs-safe temp workspace usage

* refactor: hide low-level fs-safe primitives

* build: use published fs-safe package

* fix: preserve outbound recovery durability after rebase

* chore: refresh pr checks
2026-05-06 02:15:17 +01:00
Vincent Koc
61481eb34f docs: tighten architecture, btw, agent-send hygiene
docs/concepts/architecture.md: replaced 8 non-breaking hyphen
characters (U+2011) with regular hyphens. Non-breaking hyphens defeat
copy-paste from rendered HTML, break grep on the raw markdown, and
make Mintlify search miss otherwise-correct queries. Affected words:
'long-lived', 'server-push', 'device-based'.

docs/tools/btw.md: converted the 3-bullet Related list into a
CardGroup. Renamed 'Thinking Levels' to sentence-case 'Thinking
levels' and added a Steer-command card so readers comparing ephemeral
vs in-run intervention paths see both options.

docs/tools/agent-send.md: converted the 3-bullet Related list into a
CardGroup. Removed two em-dash characters in the bullet copy
('Sub-agents — background sub-agent spawning', 'Sessions — how
session keys work') and added a Slash-commands card. Verified
/cli/agent, /tools/subagents, /concepts/session, and
/tools/slash-commands targets all exist.
2026-05-05 18:13:16 -07:00
Peter Steinberger
c744b2c236 docs: improve OpenClaw PR skill trigger 2026-05-06 02:10:11 +01:00
Peter Steinberger
947e530ad1 fix: improve slack socket mode diagnostics 2026-05-06 02:09:36 +01:00
1195 changed files with 34054 additions and 27648 deletions

View File

@@ -22,6 +22,8 @@ Blacksmith fallback playbook.
command -v crabbox
../crabbox/bin/crabbox --version
pnpm crabbox:run -- --help | sed -n '1,120p'
../crabbox/bin/crabbox desktop launch --help
../crabbox/bin/crabbox webvnc --help
```
- OpenClaw scripts prefer `../crabbox/bin/crabbox` when present. The user PATH
@@ -139,6 +141,35 @@ pnpm crabbox:stop -- <id-or-slug>
blacksmith testbox stop --id <tbx_id>
```
## Interactive Desktop And WebVNC
Prefer WebVNC for human inspection because the browser portal can preload the
lease VNC password and avoids a native VNC client's copy/paste/password dance.
Use native `crabbox vnc` only when WebVNC is unavailable, the browser portal is
broken, or the user explicitly wants a local VNC client.
Common desktop flow:
```sh
../crabbox/bin/crabbox warmup --provider hetzner --desktop --browser --class standard --idle-timeout 60m --ttl 240m
../crabbox/bin/crabbox desktop launch --provider hetzner --id <cbx_id-or-slug> --browser --url https://example.com --webvnc --open
```
Useful WebVNC commands:
```sh
../crabbox/bin/crabbox webvnc --provider hetzner --id <cbx_id-or-slug> --open
../crabbox/bin/crabbox webvnc --provider hetzner --id <cbx_id-or-slug> --daemon --open
../crabbox/bin/crabbox webvnc --provider hetzner --id <cbx_id-or-slug> --status
../crabbox/bin/crabbox webvnc --provider hetzner --id <cbx_id-or-slug> --stop
../crabbox/bin/crabbox screenshot --provider hetzner --id <cbx_id-or-slug> --output desktop.png
```
`desktop launch --webvnc --open` is usually the nicest one-shot: it starts the
browser/app inside the visible session, bridges the lease into the authenticated
WebVNC portal, and opens the portal. Keep browsers windowed for human QA; use
`--fullscreen` only for capture/video workflows.
## If Crabbox Fails
Keep the fallback narrow. First decide whether the failure is Crabbox itself,
@@ -268,11 +299,11 @@ when Blacksmith proof is requested; pass `--provider blacksmith-testbox`.
### Interactive Desktop / WebVNC
For human WebVNC demos, keep the remote desktop visible and windowed. Do not
fullscreen the remote browser or hide the XFCE panel/window chrome unless the
explicit goal is video/capture output. After launch, verify a screenshot shows
the desktop panel plus browser title bar. If Chrome is fullscreen, toggle it
back with:
For human desktop demos, prefer `webvnc` over native `vnc` and keep the remote
desktop visible/windowed. Do not fullscreen the remote browser or hide the XFCE
panel/window chrome unless the explicit goal is video/capture output. After
launch, verify a screenshot shows the desktop panel plus browser title bar. If
Chrome is fullscreen, toggle it back with:
```sh
crabbox run --id <lease> --shell -- 'DISPLAY=:99 xdotool search --onlyvisible --class google-chrome windowactivate key F11'

View File

@@ -1,6 +1,6 @@
---
name: openclaw-pr-maintainer
description: Review, triage, close, label, comment on, or land OpenClaw PRs/issues with maintainer evidence checks.
description: Use immediately for any pasted OpenClaw GitHub issue or PR URL/number, and for OpenClaw issue/PR review, triage, duplicate search, opener identity/who wrote it, author account age/activity, comments, labels, close, land, or maintainer evidence checks.
---
# OpenClaw PR Maintainer
@@ -28,8 +28,9 @@ gitcrawl cluster-detail openclaw/openclaw --id <cluster-id> --member-limit 20 --
- For every reviewed, triaged, closed, or landed issue/PR, show the opener's human name when available, GitHub login, and account age.
- Get the login from `gh issue view` / `gh pr view` (`author.login`), then fetch profile metadata once with `gh api users/<login> --jq '{login,name,created_at,type}'`.
- Report account age as created date plus rough age, for example `Opened by Jane Doe (@jane, account created 2021-04-03, ~5y old)`.
- Also show recent GitHub activity when it informs maintainer risk: OpenClaw PRs, issues, and commits in the last 12 months; for linked issue-fixing PRs, include both the PR author and issue opener when they differ.
- Report opener identity as one compact line:
`By: Jane Doe (@jane, acct 2021-04-03) | OpenClaw: 4 PRs, 2 issues, 11 commits/12mo | GitHub: 9 repos, 86 commits, 9 PRs, 3 issues, 12 reviews`
- Always show recent activity in two lanes: OpenClaw-local PRs, issues, and commits in the last 12 months; and general public GitHub activity over the same window. For linked issue-fixing PRs, include both the PR author and issue opener when they differ.
- Prefer the bundled helper for activity lookups:
```bash
@@ -37,9 +38,11 @@ gitcrawl cluster-detail openclaw/openclaw --id <cluster-id> --member-limit 20 --
.agents/skills/openclaw-pr-maintainer/scripts/github-activity.sh --global <login>
```
- The helper reports repo-local activity first and can fetch public GitHub contribution totals for the same window with `--global`.
- The helper reports repo-local activity first and can fetch public GitHub contribution totals for the same window with `--global`; run the global form by default for review/triage identity summaries.
- If the global contribution graph reports zero or looks inconsistent with visible public activity, sanity-check with `gh api users/<login>`, `gh api 'users/<login>/events/public?per_page=100'`, and recent public repo commits before calling the account inactive.
- The helper is intentionally cache-friendly for gitcrawl-backed `gh`: it rounds repo-local windows to the UTC day, rounds global contribution windows to the UTC hour, and counts PRs/issues from one paginated issues response before fetching commits separately. Prefer reusing the helper instead of hand-rolling several `gh api` loops.
- Report activity compactly, for example `OpenClaw last 12mo: 4 PRs, 2 issues, 11 commits; GitHub public last 12mo: 86 commits, 9 PRs, 3 issues, 12 reviews`.
- If the contribution graph is misleading or zero but public events/repos show activity, keep it one line, for example:
`By: pickaxe (@ProspectOre, acct 2019-08-24) | OpenClaw: 5 PRs, 0 issues, 5 commits/12mo | GitHub: 5 repos, 29 recent events, 100 public own-repo commits; graph=0`
- If `name` is empty, use the login only. If profile lookup is rate-limited or unavailable, say `account age unknown` rather than omitting the opener.
- Use identity and activity as triage signal, not proof by itself: new, low-activity, or bot-like accounts can raise review caution, but code, repro, and CI evidence still decide.

View File

@@ -42,10 +42,12 @@ Use this skill for release and publish-time workflow. Keep ordinary development
config footprint move, so do not blindly copy stale replacement annotations
into release notes.
- Do not delete or rewrite beta tags after their matching npm package has been
published. If a pushed beta tag fails preflight before npm publish, delete and
recreate the tag and prerelease at the fixed commit so npm prerelease versions
stay contiguous. If a published beta needs a fix, commit the fix on the
release branch and increment to the next `-beta.N`.
published. If a pushed beta tag fails before npm publish, the version is not
consumed: keep the same `-beta.N`, delete/recreate or force-move the git tag
and prerelease to the fixed commit, and rerun preflight. Do not increment to
the next beta number until the matching npm package has actually published.
If a published beta needs a fix, commit the fix on the release branch and
increment to the next `-beta.N`.
- For a beta release train, run the fast local preflight first, publish the
beta to npm `beta`, then run the expensive published-package roster focused
on install/update/Docker/Parallels/NPM Telegram. If anything fails, fix it on

View File

@@ -1461,7 +1461,7 @@ jobs:
name: ${{ matrix.check_name }}
needs: [preflight]
if: ${{ !cancelled() && always() && needs.preflight.outputs.run_check_additional == 'true' }}
runs-on: ubuntu-24.04
runs-on: ${{ github.repository == 'openclaw/openclaw' && 'blacksmith-8vcpu-ubuntu-2404' || 'ubuntu-24.04' }}
timeout-minutes: 20
strategy:
fail-fast: false

View File

@@ -245,6 +245,24 @@ jobs:
- name: Build Mantis harness
run: pnpm build
- name: Setup Go for Crabbox CLI
uses: actions/setup-go@v6
with:
go-version: "1.26.x"
cache: false
- name: Install Crabbox CLI
shell: bash
run: |
set -euo pipefail
install_dir="${RUNNER_TEMP}/crabbox"
mkdir -p "$install_dir" "$HOME/.local/bin"
git clone --depth 1 https://github.com/openclaw/crabbox.git "$install_dir/src"
go build -C "$install_dir/src" -o "$HOME/.local/bin/crabbox" ./cmd/crabbox
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
"$HOME/.local/bin/crabbox" --version
"$HOME/.local/bin/crabbox" warmup --help 2>&1 | grep -q -- "-desktop"
- name: Prepare baseline and candidate worktrees
shell: bash
env:
@@ -307,6 +325,14 @@ jobs:
OPENCLAW_QA_CONVEX_SECRET_CI: ${{ secrets.OPENCLAW_QA_CONVEX_SECRET_CI }}
OPENCLAW_QA_REDACT_PUBLIC_METADATA: "1"
OPENCLAW_QA_DISCORD_CAPTURE_CONTENT: "1"
MANTIS_DISCORD_VIEWER_CHROME_PROFILE_TGZ_B64: ${{ secrets.MANTIS_DISCORD_VIEWER_CHROME_PROFILE_TGZ_B64 }}
MANTIS_DISCORD_VIEWER_CHROME_PROFILE_DIR: ${{ vars.MANTIS_DISCORD_VIEWER_CHROME_PROFILE_DIR }}
CRABBOX_COORDINATOR: ${{ secrets.CRABBOX_COORDINATOR }}
CRABBOX_COORDINATOR_TOKEN: ${{ secrets.CRABBOX_COORDINATOR_TOKEN }}
OPENCLAW_QA_MANTIS_CRABBOX_COORDINATOR: ${{ secrets.OPENCLAW_QA_MANTIS_CRABBOX_COORDINATOR }}
OPENCLAW_QA_MANTIS_CRABBOX_COORDINATOR_TOKEN: ${{ secrets.OPENCLAW_QA_MANTIS_CRABBOX_COORDINATOR_TOKEN }}
CRABBOX_ACCESS_CLIENT_ID: ${{ secrets.CRABBOX_ACCESS_CLIENT_ID }}
CRABBOX_ACCESS_CLIENT_SECRET: ${{ secrets.CRABBOX_ACCESS_CLIENT_SECRET }}
CANDIDATE_SHA: ${{ needs.validate_candidate.outputs.candidate_revision }}
BASELINE_LABEL: ${{ needs.resolve_request.outputs.baseline_ref }}
run: |
@@ -331,7 +357,14 @@ jobs:
local lane="$1"
local repo_root="${GITHUB_WORKSPACE}/${worktree_root}/${lane}"
local output_dir=".artifacts/qa-e2e/mantis/discord-thread-attachment/${lane}"
pnpm --dir "$repo_root" openclaw qa discord \
local lane_env=()
if [[ "$lane" == "candidate" ]]; then
lane_env=(
OPENCLAW_QA_DISCORD_CAPTURE_UI_METADATA=1
OPENCLAW_QA_DISCORD_KEEP_THREADS=1
)
fi
env "${lane_env[@]}" pnpm --dir "$repo_root" openclaw qa discord \
--repo-root "$repo_root" \
--output-dir "$output_dir" \
--provider-mode mock-openai \
@@ -347,6 +380,73 @@ jobs:
run_lane baseline
run_lane candidate
capture_candidate_discord_web() {
if [[ -z "${MANTIS_DISCORD_VIEWER_CHROME_PROFILE_TGZ_B64:-}" && -z "${MANTIS_DISCORD_VIEWER_CHROME_PROFILE_DIR:-}" ]]; then
echo "::notice::No Mantis Discord viewer browser profile is configured; skipping logged-in Discord Web video."
return 0
fi
CRABBOX_COORDINATOR="${CRABBOX_COORDINATOR:-${OPENCLAW_QA_MANTIS_CRABBOX_COORDINATOR:-}}"
CRABBOX_COORDINATOR_TOKEN="${CRABBOX_COORDINATOR_TOKEN:-${OPENCLAW_QA_MANTIS_CRABBOX_COORDINATOR_TOKEN:-}}"
export CRABBOX_COORDINATOR CRABBOX_COORDINATOR_TOKEN
if [[ -z "${CRABBOX_COORDINATOR_TOKEN:-}" ]]; then
echo "::warning::Crabbox coordinator token missing; skipping logged-in Discord Web video."
return 0
fi
local ui_json="$root/candidate/discord-thread-reply-filepath-attachment-ui.json"
if [[ ! -f "$ui_json" ]]; then
echo "::warning::Candidate Discord UI metadata is missing; skipping logged-in Discord Web video."
return 0
fi
local discord_url
discord_url="$(jq -r '.discordWebUrl // empty' "$ui_json")"
if [[ -z "$discord_url" ]]; then
echo "::warning::Candidate Discord UI URL is empty; skipping logged-in Discord Web video."
return 0
fi
local desktop_dir="$root/candidate/discord-web"
local profile_args=()
if [[ -n "${MANTIS_DISCORD_VIEWER_CHROME_PROFILE_TGZ_B64:-}" ]]; then
profile_args+=(--browser-profile-archive-env MANTIS_DISCORD_VIEWER_CHROME_PROFILE_TGZ_B64)
fi
if [[ -n "${MANTIS_DISCORD_VIEWER_CHROME_PROFILE_DIR:-}" ]]; then
profile_args+=(--browser-profile-dir "$MANTIS_DISCORD_VIEWER_CHROME_PROFILE_DIR")
fi
pnpm openclaw qa mantis desktop-browser-smoke \
--browser-url "$discord_url" \
"${profile_args[@]}" \
--video-duration 24 \
--output-dir "$desktop_dir" \
--provider hetzner \
--class standard \
--idle-timeout 30m \
--ttl 90m
cp "$desktop_dir/desktop-browser-smoke.png" "$root/candidate/discord-thread-reply-filepath-attachment-discord-web.png"
if [[ -f "$desktop_dir/desktop-browser-smoke.mp4" ]]; then
cp "$desktop_dir/desktop-browser-smoke.mp4" "$root/candidate/discord-thread-reply-filepath-attachment-discord-web.mp4"
fi
if [[ -f "$root/candidate/discord-thread-reply-filepath-attachment-discord-web.mp4" ]]; then
if ! command -v ffmpeg >/dev/null 2>&1 || ! command -v ffprobe >/dev/null 2>&1; then
sudo apt-get update && sudo apt-get install -y ffmpeg || true
fi
crabbox media preview \
--input "$root/candidate/discord-thread-reply-filepath-attachment-discord-web.mp4" \
--output "$root/candidate/discord-thread-reply-filepath-attachment-discord-web-preview.gif" \
--trimmed-video-output "$root/candidate/discord-thread-reply-filepath-attachment-discord-web-change.mp4" \
--json > "$root/candidate/discord-thread-reply-filepath-attachment-discord-web-preview.json" || {
rm -f "$root/candidate/discord-thread-reply-filepath-attachment-discord-web-preview.gif"
rm -f "$root/candidate/discord-thread-reply-filepath-attachment-discord-web-change.mp4"
rm -f "$root/candidate/discord-thread-reply-filepath-attachment-discord-web-preview.json"
echo "::warning::Could not generate logged-in Discord Web motion preview; keeping screenshot/full MP4."
}
fi
}
capture_candidate_discord_web
baseline_status="$(jq -r '.scenarios[] | select(.id == "discord-thread-reply-filepath-attachment") | .status' "$root/baseline/discord-qa-summary.json")"
candidate_status="$(jq -r '.scenarios[] | select(.id == "discord-thread-reply-filepath-attachment") | .status' "$root/candidate/discord-qa-summary.json")"
comparison_status="fail"
@@ -380,6 +480,18 @@ jobs:
echo "- Result: \`${comparison_status}\`"
echo "- Baseline screenshot: \`baseline/discord-thread-reply-filepath-attachment-attachment.png\`"
echo "- Candidate screenshot: \`candidate/discord-thread-reply-filepath-attachment-attachment.png\`"
if [[ -f "$root/candidate/discord-thread-reply-filepath-attachment-discord-web.png" ]]; then
echo "- Candidate logged-in Discord Web screenshot: \`candidate/discord-thread-reply-filepath-attachment-discord-web.png\`"
fi
if [[ -f "$root/candidate/discord-thread-reply-filepath-attachment-discord-web-preview.gif" ]]; then
echo "- Candidate logged-in Discord Web preview: \`candidate/discord-thread-reply-filepath-attachment-discord-web-preview.gif\`"
fi
if [[ -f "$root/candidate/discord-thread-reply-filepath-attachment-discord-web-change.mp4" ]]; then
echo "- Candidate logged-in Discord Web change clip: \`candidate/discord-thread-reply-filepath-attachment-discord-web-change.mp4\`"
fi
if [[ -f "$root/candidate/discord-thread-reply-filepath-attachment-discord-web.mp4" ]]; then
echo "- Candidate logged-in Discord Web video: \`candidate/discord-thread-reply-filepath-attachment-discord-web.mp4\`"
fi
} > "$root/mantis-report.md"
jq -n \
@@ -402,6 +514,12 @@ jobs:
artifacts: [
{ kind: "timeline", lane: "baseline", label: "Baseline missing filePath attachment", path: "baseline/discord-thread-reply-filepath-attachment-attachment.png", targetPath: "baseline.png", alt: "Baseline Discord thread reply without filePath attachment", width: 420 },
{ kind: "timeline", lane: "candidate", label: "Candidate includes filePath attachment", path: "candidate/discord-thread-reply-filepath-attachment-attachment.png", targetPath: "candidate.png", alt: "Candidate Discord thread reply with filePath attachment", width: 420 },
{ kind: "desktopScreenshot", lane: "candidate", label: "Candidate logged-in Discord Web", path: "candidate/discord-thread-reply-filepath-attachment-discord-web.png", targetPath: "candidate-discord-web.png", alt: "Logged-in Discord Web showing the candidate thread attachment", width: 560, required: false, inline: true },
{ kind: "motionPreview", lane: "candidate", label: "Candidate logged-in Discord Web motion", path: "candidate/discord-thread-reply-filepath-attachment-discord-web-preview.gif", targetPath: "candidate-discord-web-preview.gif", alt: "Animated logged-in Discord Web proof for the candidate thread attachment", width: 560, required: false, inline: true },
{ kind: "motionClip", lane: "candidate", label: "Candidate logged-in Discord Web change MP4", path: "candidate/discord-thread-reply-filepath-attachment-discord-web-change.mp4", targetPath: "candidate-discord-web-change.mp4", required: false },
{ kind: "fullVideo", lane: "candidate", label: "Candidate logged-in Discord Web MP4", path: "candidate/discord-thread-reply-filepath-attachment-discord-web.mp4", targetPath: "candidate-discord-web.mp4", required: false },
{ kind: "metadata", lane: "candidate", label: "Candidate logged-in Discord Web preview metadata", path: "candidate/discord-thread-reply-filepath-attachment-discord-web-preview.json", targetPath: "candidate-discord-web-preview.json", required: false },
{ kind: "metadata", lane: "candidate", label: "Candidate Discord UI metadata", path: "candidate/discord-thread-reply-filepath-attachment-ui.json", targetPath: "candidate-discord-ui.json", required: false },
{ kind: "metadata", lane: "run", label: "Comparison JSON", path: "comparison.json", targetPath: "comparison.json" },
{ kind: "report", lane: "run", label: "Mantis report", path: "mantis-report.md", targetPath: "mantis-report.md" }
]

View File

@@ -57,8 +57,8 @@ Telegraph style. Root rules only. Read scoped `AGENTS.md` before subtree work.
- Linting: use repo wrappers (`pnpm lint:*`, `scripts/run-oxlint.mjs`); do not invoke generic JS formatters/lints unless a repo script uses them.
- Heavy checks: `OPENCLAW_LOCAL_CHECK=1`, mode `OPENCLAW_LOCAL_CHECK_MODE=throttled|full`; CI/shared use `OPENCLAW_LOCAL_CHECK=0`.
- Crabbox: preferred live scenario runner when available. It has Linux, Windows, and macOS workers/targets; pick the OS that matches the bug. If unavailable, use the local system, Docker, Parallels, or CI live lane that proves the same behavior.
- Blacksmith/Testbox: on maintainer machines with Blacksmith access, broad/shared validation defaults to Testbox. This includes `pnpm check`, `pnpm check:changed`, `pnpm test`, `pnpm test:changed`, Docker/E2E/live/package/build gates, and any command likely to fan out across many Vitest projects. Do not start those broad gates locally unless the user explicitly asks for local proof or sets `OPENCLAW_LOCAL_CHECK_MODE=throttled|full`.
- Local validation: targeted edit loops only, such as `pnpm test <specific-file>`, targeted formatter checks, and small lint/type probes. If a local command expands beyond targeted proof, stop it and move the broad gate to Testbox.
- Blacksmith/Testbox: use when the validation needs the remote environment, broad/shared suite capacity, cross-OS/package/Docker/E2E/live proof, or another end-to-end setup that is meaningfully better off-host. Broad fan-out commands such as `pnpm check`, full `pnpm test`, Docker/E2E/live/package/build gates, and wide changed gates belong in Testbox by default. Do not start those broad gates locally unless the user explicitly asks for local proof or sets `OPENCLAW_LOCAL_CHECK_MODE=throttled|full`.
- Local validation: targeted edit loops stay local, such as `pnpm test <specific-file>`, narrow `pnpm test:changed` selections, targeted formatter checks, and small lint/type probes. If a local command expands beyond targeted proof, stop it and move the broad gate to Testbox.
- Testbox use: run from repo root, pre-warm early with `blacksmith testbox warmup ci-check-testbox.yml --ref main --idle-timeout 90`, reuse the returned `tbx_...` id for all `run`/`download` commands, and stop boxes you created before handoff. Timeout bins: `90` minutes default, `240` multi-hour, `720` all-day, `1440` overnight; anything above `1440` needs explicit approval and cleanup.
- Testbox full-suite profile: `blacksmith testbox run --id <ID> "env NODE_OPTIONS=--max-old-space-size=4096 OPENCLAW_TEST_PROJECTS_PARALLEL=6 OPENCLAW_VITEST_MAX_WORKERS=1 pnpm test"`. For installable package proof, prefer the GitHub `Package Acceptance` workflow over ad hoc Testbox commands.
@@ -98,8 +98,8 @@ Telegraph style. Root rules only. Read scoped `AGENTS.md` before subtree work.
- extension tests: extension test typecheck/tests
- public SDK/plugin contract: extension prod/test too
- unknown root/config: all lanes
- Before handoff/push for code/test/runtime/config changes: run `pnpm check:changed` in Testbox by default on maintainer machines. Tests-only: run `pnpm test:changed` in Testbox by default. Full prod sweep: run `pnpm check` in Testbox. Use local only for narrow targeted proof or when explicitly requested.
- If `pnpm test:changed` or `pnpm check:changed` selects broad/shared lanes, it belongs in Testbox; do not let it continue locally after it fans out.
- Before handoff/push for code/test/runtime/config changes: prove the touched surface. Use local targeted tests/checks for narrow changes; use Testbox when `pnpm check:changed`, `pnpm test:changed`, or other validation selects broad/shared lanes or needs a remote/end-to-end environment. Full prod sweeps (`pnpm check`, full `pnpm test`) belong in Testbox by default on maintainer machines.
- If `pnpm test:changed` or `pnpm check:changed` stays narrowly scoped, it can run locally. If it fans out into broad/shared lanes, stop it and move the broad gate to Testbox.
- Docs/changelog-only and CI/workflow metadata-only changes are not changed-gate work by default. Use `git diff --check` plus the relevant formatter/docs/workflow sanity check; escalate to `pnpm check:changed` only when scripts, test config, generated docs/API, package metadata, or runtime/build behavior changed.
- Rebase sanity: after a green `pnpm check:changed`, a clean rebase onto current
`origin/main` does not require rerunning the full changed gate when the rebase

View File

@@ -6,8 +6,14 @@ Docs: https://docs.openclaw.ai
### Changes
- Plugins/install: add `npm-pack:<path.tgz>` installs so local npm pack artifacts run through the same managed npm-root install, lockfile verification, dependency scan, and install-record path as registry npm plugins.
- Plugin skills/Windows: publish plugin-provided skill directories as junctions on Windows so standard users without Developer Mode can register plugin skills without symlink EPERM failures. Fixes #77958. (#77971) Thanks @hclsys and @jarro.
- MS Teams: surface blocked Bot Framework egress by logging JWKS fetch network failures and adding a Bot Connector send hint for transport-level reply failures. Fixes #77674. (#78081) Thanks @Beandon13.
- Gateway/sessions: fast-path already-qualified model refs while building session-list rows so `openclaw sessions` and Control UI session lists avoid heavyweight model resolution on large stores. (#77902) Thanks @ragesaq.
- PR triage: mark external pull requests with `proof: supplied` when Barnacle finds structured real behavior proof, keep stale negative proof labels in sync across CRLF-edited PR bodies, and let ClawSweeper own the stronger `proof: sufficient` judgement.
- Sessions CLI: show the selected agent runtime in the `openclaw sessions` table so terminal output matches the runtime visibility already present in JSON/status surfaces. Thanks @vincentkoc.
- Talk/voice: unify realtime relay, transcription relay, managed-room handoff, Voice Call, Google Meet, VoiceClaw, and native clients around a shared Talk session controller and add the Gateway-managed `talk.session.*` RPC surface.
- Diagnostics/Talk: export bounded Talk lifecycle/audio metrics and session recovery metrics through OpenTelemetry and Prometheus without exposing transcripts, audio payloads, room ids, turn ids, or session ids.
- Google Meet/Voice Call: make Twilio dial-in joins speak through the realtime Gemini voice bridge with paced audio streaming, backpressure-aware buffering, barge-in queue clearing, same-session agent consult routing, duplicate-consult coalescing, and no TwiML fallback during realtime speech, giving Meet participants a much snappier OpenClaw voice agent. (#77064) Thanks @scoootscooob.
- Voice Call/realtime: add opt-in OpenClaw agent voice context capsules and consult-cadence guidance so Gemini/OpenAI realtime calls can sound like the configured agent without consulting the full agent on every ordinary turn. Thanks @scoootscooob.
- Docker/Gateway: harden the gateway container by dropping `NET_RAW` and `NET_ADMIN` capabilities and enabling `no-new-privileges` in the bundled `docker-compose.yml`. Thanks @VintageAyu.
@@ -56,6 +62,9 @@ Docs: https://docs.openclaw.ai
- Plugins/update: treat official externalized bundled npm migrations and ClawHub-to-npm fallbacks as trusted source-linked installs, so prerelease-only official plugin packages can migrate from bundled builds without being rejected as unsafe prerelease resolutions. Thanks @vincentkoc.
- Plugins/update: move ClawHub-preferred externalized plugin installs back to ClawHub after an earlier npm fallback once the ClawHub package becomes available. Thanks @vincentkoc.
- Plugins/update: clean stale bundled load paths for already-externalized pinned npm and ClawHub plugin installs, so release-channel sync does not leave removed bundled paths ahead of the installed external package. Thanks @vincentkoc.
- Plugins/update: repair stale managed npm-root `openclaw` peer packages before plugin installs, so beta-channel official plugin updates are not downgraded by old core package-lock state. Thanks @vincentkoc.
- Plugins/install: run managed npm-root install, rollback, repair, and uninstall mutations with legacy peer resolution so removing one plugin cannot rehydrate a stale registry `openclaw` package into the shared root. Thanks @vincentkoc.
- Plugins/install: reassert managed npm plugin `openclaw` peer links after shared-root npm installs, updates, and uninstalls, so mutating one plugin does not leave previously installed SDK-using plugins unable to resolve `openclaw/plugin-sdk/*`.
- Plugins/update: make package upgrades swap pnpm/npm-prefix installs cleanly, keep legacy plugin install runtime chunks working, and on the beta channel fall back default-line npm plugins to default/latest when plugin beta releases are missing or fail install validation. Thanks @vincentkoc and @joshavant.
- Plugins/active-memory: skip session-store channel entries that contain `:` when resolving the recall subagent's channel, so QQ c2c agent IDs (e.g. `c2c:10D4F7C2…`) and other scoped conversation IDs do not reach bundled-plugin `dirName` validation and crash the recall run. The same guard already applied to explicit `channelId` params (#76704); this extends it to store-derived channels. (#77396) Thanks @hclsys.
- Sandbox/Windows: accept drive-absolute Docker bind sources while keeping sandbox blocked-path and allowed-root policy comparisons Windows-case-insensitive. (#42174) Thanks @6607changchun.
@@ -71,6 +80,8 @@ Docs: https://docs.openclaw.ai
- Gateway/performance: defer non-readiness sidecars until after the ready signal, avoid hot-path channel plugin barrel imports, and fast-path trusted bundled plugin metadata during Gateway startup.
- Gateway/performance: avoid importing `jiti` on native-loadable plugin startup paths, so compiled bundled plugin surfaces do not pay source-transform loader cost unless fallback loading is actually needed.
- Plugins/loader: preserve real compiled plugin module evaluation errors on the native fast path instead of treating every thrown `.js` module as a source-transform fallback miss. Thanks @vincentkoc.
- Plugin SDK/fs-safe: expose reusable atomic replacement, sibling-temp writes, and cross-device move fallback helpers through `plugin-sdk/security-runtime`, and move OpenClaw's duplicated safe filesystem write paths onto the shared `@openclaw/fs-safe` package.
- Plugin SDK/fs-safe: rename the public temp workspace helpers to `tempWorkspace`, `withTempWorkspace`, `tempWorkspaceSync`, and `withTempWorkspaceSync`, matching the cleaner `@openclaw/fs-safe` API before the package is published.
- Providers/OpenRouter: add opt-in response caching params that send OpenRouter's `X-OpenRouter-Cache`, `X-OpenRouter-Cache-TTL`, and cache-clear headers only on verified OpenRouter routes. Thanks @vincentkoc.
- Providers/OpenRouter: expand app-attribution categories so OpenClaw advertises coding, programming, writing, chat, and personal-agent usage on verified OpenRouter routes. Thanks @vincentkoc.
- Agents/performance: pass the resolved workspace through BTW, compaction, embedded-run model generation, and PDF model setup so explicit agent-dir model refreshes can reuse the current workspace-scoped plugin metadata snapshot instead of falling back to cold plugin metadata scans. (#77519, #77532)
@@ -95,24 +106,55 @@ Docs: https://docs.openclaw.ai
- Contributor PRs: require external pull requests to include after-fix real behavior proof from a real OpenClaw setup, with terminal screenshots, console output, redacted runtime logs, linked artifacts, and copied live output treated as valid evidence while unit tests, mocks, lint, typechecks, snapshots, and CI remain supplemental only.
- Plugins/catalog: add an `@tencent-weixin/openclaw-weixin` external entry pinned to `2.4.1` so onboarding and `openclaw channels add` can install the Tencent Weixin (personal WeChat) channel by default. (#77269) Thanks @pumpkinxing1.
- Developer tooling: add checked-in VS Code Gateway debugging configs and an opt-in `OUTPUT_SOURCE_MAPS=1` source-map build path for breakpoints in TypeScript source. (#45710) Thanks @SwissArmyBud.
- Managed proxy: add `proxy.loopbackMode` for Gateway loopback control-plane traffic, allowing operators to keep the default Gateway loopback bypass, force loopback Gateway traffic through the proxy, or block it. (#77018) Thanks @jesse-merhi.
- Telegram/native commands: show the current thinking level above the `/think` level picker so users can see the active setting before changing it. (#78278) Thanks @obviyus.
### Fixes
- OpenAI/Codex: suppress stale `openai-codex` GPT-5.1/5.2/5.3 model refs that ChatGPT/Codex OAuth accounts now reject, keeping model lists, config validation, and forward-compat resolution on current 5.4/5.5 routes. Fixes #67158. Thanks @drpau.
- Google Meet/Voice Call: wait longer before playing PIN-derived Twilio DTMF for Meet dial-in prompts and retire stale delegated phone sessions instead of reusing completed calls.
- PDF/Codex: include extraction-fallback instructions for `openai-codex/*` PDF tool requests so Codex Responses receives its required system prompt. Fixes #77872. Thanks @anyech.
- Onboard/channels: recover externalized channel plugins from stale `channels.<id>` config by falling back to `ensureChannelSetupPluginInstalled` via the trusted catalog when the plugin is missing on disk, so leftover `appId`/token entries no longer dead-end onboard with "<channel> plugin not available." (#78328) Thanks @sliverp.
- Codex/app-server: forward the OpenClaw workspace bootstrap block through Codex `developerInstructions` instead of `config.instructions`, so persona/style guidance reaches the behavior-shaping app-server lane. Fixes #77363. Thanks @lonexreb.
- CLI/infer: pass minimal instructions to local `openai-codex/*` model probes and surface provider error details when `infer model run` returns no text. Fixes #76464. Thanks @lilesjtu.
- Dependencies: override transitive `ip-address` to `10.2.0` so the runtime lockfile no longer includes the vulnerable `10.1.0` build flagged by Dependabot alert 109. Thanks @vincentkoc.
- Feishu: hydrate missing native topic starter thread IDs before session routing so first turns and follow-ups stay in the same topic session. Fixes #78262. Thanks @joeyzenghuan.
- LINE: reject `dmPolicy: "open"` configs without wildcard `allowFrom` so webhook DMs fail validation instead of being acknowledged and silently blocked before inbound processing. Fixes #78316.
- Telegram/Codex: keep message-tool-only progress drafts visible and render native Codex tool progress once per tool instead of duplicating item/tool draft lines. Fixes #75641. (#77949) Thanks @keshavbotagent.
- Providers/xAI: stop sending OpenAI-style reasoning effort controls to native Grok Responses models, so `xai/grok-4.3` no longer fails live Docker/Gateway runs with `Invalid reasoning effort`.
- Providers/xAI: clamp the bundled xAI thinking profile to `off` so live Gateway runs cannot send unsupported reasoning levels to native Grok Responses models.
- Matrix/approvals: retry approval delivery up to 3 times with a short backoff so transient Matrix send failures do not strand pending approval prompts. (#78179) Thanks @Patrick-Erichsen.
- Discord/gateway: measure heartbeat ACK timeouts from the actual heartbeat send, preventing late initial heartbeats from triggering false reconnect loops while the channel is still awaiting readiness. Fixes #77668. (#78087) Thanks @bryce-d-greybeard and @NikolaFC.
- Channels/cron: ignore stale runtime conversation bindings that point at completed isolated cron run sessions, so follow-up DMs fall back to their normal route instead of reusing a closed cron task prompt. Fixes #78074. Thanks @amknight.
- Discord/guilds: route plain text control commands such as `/steer` through the normal authorization and mention gate instead of silently dropping them before an agent session can see them. Fixes #78080. Thanks @ramitrkar-hash.
- Control UI/Sessions: make the compaction count a compact `N Checkpoint(s)` disclosure and show expanded session-level details with modern checkpoint history cards across responsive table layouts. Thanks @BunsDev.
- Control UI/performance: keep chat and channel tabs responsive while history payloads and channel probes are slow, label partial channel status, and record slow chat/config render timings in the event log. Thanks @BunsDev.
- Control UI/sessions: fire the documented `/new` command and lifecycle hooks only for explicit Control UI session creation, restoring session-memory and custom hook capture without changing SDK parent-session creates. Fixes #76957. Thanks @BunsDev.
- Exec approvals: fall back to a guarded copy when Windows rejects rename-overwrite for `exec-approvals.json`, while preserving symlink, hard-link, and owner-only permission safeguards. Fixes #77785. (#77907) Thanks @Alex-Alaniz and @MilleniumGenAI.
- Slack: preserve Socket Mode SDK error context and structured Slack API fields in reconnect logs, so startup failures no longer collapse to a bare `unknown error`.
- Agents/subagents: preserve the delegated task prompt when a spawned target agent uses `systemPromptOverride`, so `sessions_spawn(mode: "run")` child runs still see their assigned task. Fixes #77950. Thanks @amknight.
- iOS pairing: allow setup-code and manual `ws://` connects for private LAN and `.local` gateways while keeping Tailscale/public routes on `wss://`, and prefer explicit gateway passwords over stale bootstrap tokens in mixed-auth reconnects. Fixes #47887; carries forward #65185. Thanks @draix and @BunsDev.
- Node/Windows: fall back to the Startup-folder launcher when Spanish-localized `schtasks` reports `Acceso denegado`, matching the existing access-denied fallback path. Fixes #77993. Thanks @jackonedev.
- Plugins/diagnostics: make source-only TypeScript package warnings actionable by explaining that missing compiled runtime output is a publisher packaging issue and pointing users to update/reinstall or disable/uninstall the plugin. Fixes #77835. Thanks @googlerest.
- Control UI/chat: keep persisted assistant progress text visible when the same transcript turn also contains tool-use metadata, so chat.history reloads no longer make those replies vanish after the next user message. Fixes #77374. Thanks @BunsDev.
- TUI: skip the generic CLI respawn wrapper for interactive launches, exit cleanly on terminal loss, and refuse to restore heartbeat sessions as the remembered chat session, preventing stale heartbeat history and orphaned `openclaw-tui` processes on first boot. Thanks @vincentkoc.
- Doctor/sessions: move heartbeat-poisoned default main session store entries to recovery keys and clear stale TUI restore pointers, so `doctor --fix` can repair instances already stuck on `agent:main:main` heartbeat history. Thanks @vincentkoc.
- Agents/context engines: keep hidden OpenClaw runtime-context custom messages out of context-engine assemble, afterTurn, and ingest hooks so transcript reconstruction plugins only see conversation messages. Thanks @vincentkoc.
- Network/runtime: avoid importing Undici's package dispatcher during no-proxy timeout bootstrap so external channel plugin fetch requests with explicit Content-Length keep working. Fixes #78007. Thanks @shakkernerd.
- Gateway/shutdown: cancel delayed post-ready maintenance during close and suppress maintenance/cron startup after quick restarts, preventing orphaned background timers. Thanks @vincentkoc.
- Agents/generated media: treat attachment-style message tool actions as completed chat sends, preventing duplicate fallback media posts when generated files were already uploaded.
- Control UI/sessions: show each session's agent runtime in the Sessions table and allow filtering by runtime labels, matching the Agents panel runtime wording. Thanks @vincentkoc.
- Discord/streaming: show live reasoning text in progress drafts instead of a bare `Reasoning` status line.
- Gateway/status: avoid marking fast repeated health/status samples as event-loop degraded from CPU/utilization alone until the Gateway has accumulated a sustained sampling window. Thanks @shakkernerd.
- Gateway/performance: reuse the current compatible plugin metadata snapshot across hot read-only status, channel, auth, skills, and embedded agent settings paths, avoiding repeated synchronous plugin metadata scans during Gateway activity. Fixes #77983. Thanks @shakkernerd.
- Plugins/update: keep installed official npm and ClawHub plugins such as Codex, Discord, WhatsApp, and diagnostics plugins synced during host updates even when disabled or previously exact-pinned, while preserving third-party plugin pins. Thanks @vincentkoc.
- Doctor/status: warn when `OPENCLAW_GATEWAY_TOKEN` would shadow a different active `gateway.auth.token` source for local CLI commands, while avoiding false positives when config points at the same env token. Fixes #74271. Thanks @yelog.
- Gateway/HTTP: avoid loading managed outgoing-image media handlers for unrelated requests, so disabled OpenAI-compatible routes return 404 without waiting on lazy media sidecars. Thanks @vincentkoc.
- Gateway/OpenAI-compatible: send the assistant role SSE chunk as soon as streaming chat-completion headers are accepted, so cold agent setup cannot leave `/v1/chat/completions` clients with a bodyless 200 response until their idle timeout fires.
- Agents/media: avoid direct generated-media completion fallback while the announce-agent run is still pending, so async video and music completions do not duplicate raw media messages. (#77754)
- WebChat/Codex media: stage Codex app-server generated local images into managed media before Gateway display, so Codex-home image paths no longer hit `LocalMediaAccessError` while keeping Codex home out of the display allowlist. Thanks @frankekn.
- Plugins/update: repair plugin-local `openclaw` peer links for all recorded npm plugins after any npm update mutates the shared managed npm tree, so targeted or batch updates cannot leave Codex, Discord, or Brave with pruned SDK imports. (#77787) Thanks @ProspectOre.
- Codex harness: honor `models.providers.openai-codex.models[].contextTokens` for native `openai/*` Codex runtime runs and `/status` context reporting, so subscription-backed Codex agents use the configured OAuth context cap without inflating past the runtime model window. Fixes #77858. Thanks @lilesjtu.
- TUI/sessions: bound the session picker to recent rows and use exact lookup-style refreshes for the active session, so dusty stores no longer make TUI hydrate weeks-old transcripts before becoming responsive. Thanks @vincentkoc.
- Doctor/gateway: report recent supervisor restart handoffs in `openclaw doctor --deep`, using the installed service environment when available so service-managed clean exits are visible in guided diagnostics. Thanks @shakkernerd.
- Gateway/status: show recent supervisor restart handoffs in `openclaw gateway status --deep`, including JSON details, so clean service-managed restarts are reported as restart handoffs instead of opaque stopped-service diagnostics. Thanks @shakkernerd.
@@ -387,7 +429,9 @@ Docs: https://docs.openclaw.ai
- Agents/sessions: after embedded Pi runs, append assistant-visible reply text to session JSONL only when Pi did not already persist an equivalent tail assistant entry, without re-mirroring the user prompt Pi owns. Fixes #77823. (#77839) Thanks @neeravmakwana.
- Plugins/CLI: load the install-records ledger when listing channel-catalog entries, so npm-installed third-party channel plugins resolve through `openclaw channels login`/`channels add` instead of failing with `Unsupported channel`. (#77269) Thanks @pumpkinxing1.
- Memory wiki/Security: enforce session visibility on shared-memory `wiki_search` and `wiki_get` so sandboxed subagents cannot read transcript content from sibling or parent sessions. Fixes GHSA-72fw-cqh5-f324. Thanks @zsxsoft.
- Exec approvals: enforce allowlist `argPattern` argument restrictions on Linux and macOS as well as Windows, so an entry like `{ pattern: "python3", argPattern: "^safe\\.py$" }` no longer silently relaxes to a path-only match on non-Windows hosts. (#75143) Thanks @eleqtrizit.
- Exec approvals: enforce allowlist `argPattern` argument restrictions on Linux and macOS as well as Windows, so an entry like `{ pattern: "python3", argPattern: "^safe\.py$" }` no longer silently relaxes to a path-only match on non-Windows hosts. (#75143) Thanks @eleqtrizit.
- Agents/compaction: disable Pi auto-compaction whenever OpenClaw effectively owns safeguard compaction, including provider-backed safeguard mode, so Pi and OpenClaw no longer fight over long-session compaction. Fixes #73003. (#73839) Thanks @bradhallett.
- Telegram/streaming: finalize text replies by stopping the edited stream message instead of sending a second answer bubble, so Telegram turns cannot duplicate the streamed final response. (#77947) Thanks @obviyus.
## 2026.5.3-1

View File

@@ -14,6 +14,9 @@ Welcome to the lobster tank! 🦞
- **Peter Steinberger** - Benevolent Dictator
- GitHub: [@steipete](https://github.com/steipete) · X: [@steipete](https://x.com/steipete)
- **Frank Yang** - PR triage, Agents, Gateway, Channels
- GitHub: [@frankekn](https://github.com/frankekn) · X: [@frankekn](https://x.com/frankekn)
- **Shadow** - Discord subsystem, Discord admin, Clawhub, all community moderation
- GitHub: [@thewilloftheshadow](https://github.com/thewilloftheshadow) · X: [@4shadowed](https://x.com/4shadowed)

View File

@@ -65,8 +65,8 @@ android {
applicationId = "ai.openclaw.app"
minSdk = 31
targetSdk = 36
versionCode = 2026050500
versionName = "2026.5.5"
versionCode = 2026050600
versionName = "2026.5.6"
ndk {
// Support all major ABIs — native libs are tiny (~47 KB per ABI)
abiFilters += listOf("armeabi-v7a", "arm64-v8a", "x86", "x86_64")

View File

@@ -36,6 +36,7 @@ import ai.openclaw.app.node.Quad
import ai.openclaw.app.node.SmsHandler
import ai.openclaw.app.node.SmsManager
import ai.openclaw.app.node.SystemHandler
import ai.openclaw.app.node.TalkHandler
import ai.openclaw.app.node.asObjectOrNull
import ai.openclaw.app.node.asStringOrNull
import ai.openclaw.app.node.invokeErrorFromThrowable
@@ -205,6 +206,16 @@ class NodeRuntime(
deviceHandler = deviceHandler,
notificationsHandler = notificationsHandler,
systemHandler = systemHandler,
talkHandler =
object : TalkHandler {
override suspend fun handlePttStart(paramsJson: String?): GatewaySession.InvokeResult = handleTalkPttStart()
override suspend fun handlePttStop(paramsJson: String?): GatewaySession.InvokeResult = handleTalkPttStop()
override suspend fun handlePttCancel(paramsJson: String?): GatewaySession.InvokeResult = handleTalkPttCancel()
override suspend fun handlePttOnce(paramsJson: String?): GatewaySession.InvokeResult = handleTalkPttOnce()
},
photosHandler = photosHandler,
contactsHandler = contactsHandler,
calendarHandler = calendarHandler,
@@ -881,6 +892,80 @@ class NodeRuntime(
setVoiceCaptureMode(if (value) VoiceCaptureMode.TalkMode else VoiceCaptureMode.Off)
}
private suspend fun handleTalkPttStart(): GatewaySession.InvokeResult =
runPreparedTalkPttCommand {
val payload = talkMode.beginPushToTalk()
GatewaySession.InvokeResult.ok(payload.toJson())
}
private suspend fun handleTalkPttStop(): GatewaySession.InvokeResult =
runTalkPttCommand {
val payload = talkMode.endPushToTalk()
finishTalkCaptureIfIdle()
GatewaySession.InvokeResult.ok(payload.toJson())
}
private suspend fun handleTalkPttCancel(): GatewaySession.InvokeResult =
runTalkPttCommand {
val payload = talkMode.cancelPushToTalk()
finishTalkCaptureIfIdle()
GatewaySession.InvokeResult.ok(payload.toJson())
}
private suspend fun handleTalkPttOnce(): GatewaySession.InvokeResult =
runPreparedTalkPttCommand {
val payload = talkMode.runPushToTalkOnce()
finishTalkCaptureIfIdle()
GatewaySession.InvokeResult.ok(payload.toJson())
}
private suspend fun runPreparedTalkPttCommand(block: suspend () -> GatewaySession.InvokeResult): GatewaySession.InvokeResult =
runTalkPttCommand {
prepareTalkCapture()
try {
block()
} catch (err: Throwable) {
cleanupFailedTalkCapture()
throw err
}
}
private suspend fun runTalkPttCommand(block: suspend () -> GatewaySession.InvokeResult): GatewaySession.InvokeResult =
try {
block()
} catch (err: Throwable) {
val (code, message) = invokeErrorFromThrowable(err)
GatewaySession.InvokeResult.error(code = code, message = message)
}
private suspend fun prepareTalkCapture() {
if (!hasRecordAudioPermission()) {
throw IllegalStateException("MIC_PERMISSION_REQUIRED: grant Microphone permission")
}
micCapture.setMicEnabled(false)
stopVoicePlayback()
NodeForegroundService.setVoiceCaptureMode(appContext, VoiceCaptureMode.TalkMode)
talkMode.ttsOnAllResponses = true
talkMode.setPlaybackEnabled(speakerEnabled.value)
talkMode.ensureChatSubscribed()
externalAudioCaptureActive.value = true
}
private suspend fun cleanupFailedTalkCapture() {
runCatching { talkMode.cancelPushToTalk() }
talkMode.ttsOnAllResponses = false
NodeForegroundService.setVoiceCaptureMode(appContext, VoiceCaptureMode.Off)
externalAudioCaptureActive.value = false
}
private fun finishTalkCaptureIfIdle() {
if (!talkMode.isEnabled.value && !talkMode.isListening.value && !talkMode.isSpeaking.value) {
talkMode.ttsOnAllResponses = false
NodeForegroundService.setVoiceCaptureMode(appContext, VoiceCaptureMode.Off)
externalAudioCaptureActive.value = false
}
}
val speakerEnabled: StateFlow<Boolean>
get() = prefs.speakerEnabled

View File

@@ -278,14 +278,13 @@ class GatewayDiscovery(
return legacyHostAddress(resolved)
}
private fun legacyHostAddress(resolved: NsdServiceInfo): String? {
return try {
private fun legacyHostAddress(resolved: NsdServiceInfo): String? =
try {
val host = NsdServiceInfo::class.java.getMethod("getHost").invoke(resolved) as? InetAddress
host?.hostAddress
} catch (_: Throwable) {
null
}
}
private fun publish() {
_gateways.value =
@@ -529,20 +528,20 @@ class GatewayDiscovery(
val cm = connectivity ?: return null
// Prefer VPN (Tailscale) when present; otherwise use the active network.
trackedNetworks(cm).firstOrNull { n ->
val caps = cm.getNetworkCapabilities(n) ?: return@firstOrNull false
caps.hasTransport(NetworkCapabilities.TRANSPORT_VPN)
}?.let { return it }
trackedNetworks(cm)
.firstOrNull { n ->
val caps = cm.getNetworkCapabilities(n) ?: return@firstOrNull false
caps.hasTransport(NetworkCapabilities.TRANSPORT_VPN)
}?.let { return it }
return cm.activeNetwork
}
private fun trackedNetworks(cm: ConnectivityManager): List<Network> {
return buildList {
private fun trackedNetworks(cm: ConnectivityManager): List<Network> =
buildList {
cm.activeNetwork?.let(::add)
addAll(availableNetworks)
}.distinct()
}
private fun createDirectResolver(): Resolver? {
val cm = connectivity ?: return null

View File

@@ -14,6 +14,7 @@ import ai.openclaw.app.protocol.OpenClawNotificationsCommand
import ai.openclaw.app.protocol.OpenClawPhotosCommand
import ai.openclaw.app.protocol.OpenClawSmsCommand
import ai.openclaw.app.protocol.OpenClawSystemCommand
import ai.openclaw.app.protocol.OpenClawTalkCommand
data class NodeRuntimeFlags(
val cameraEnabled: Boolean,
@@ -81,6 +82,7 @@ object InvokeCommandRegistry {
name = OpenClawCapability.VoiceWake.rawValue,
availability = NodeCapabilityAvailability.VoiceWakeEnabled,
),
NodeCapabilitySpec(name = OpenClawCapability.Talk.rawValue),
NodeCapabilitySpec(
name = OpenClawCapability.Location.rawValue,
availability = NodeCapabilityAvailability.LocationEnabled,
@@ -135,6 +137,18 @@ object InvokeCommandRegistry {
InvokeCommandSpec(
name = OpenClawSystemCommand.Notify.rawValue,
),
InvokeCommandSpec(
name = OpenClawTalkCommand.PttStart.rawValue,
),
InvokeCommandSpec(
name = OpenClawTalkCommand.PttStop.rawValue,
),
InvokeCommandSpec(
name = OpenClawTalkCommand.PttCancel.rawValue,
),
InvokeCommandSpec(
name = OpenClawTalkCommand.PttOnce.rawValue,
),
InvokeCommandSpec(
name = OpenClawCameraCommand.List.rawValue,
requiresForeground = true,

View File

@@ -13,6 +13,7 @@ import ai.openclaw.app.protocol.OpenClawMotionCommand
import ai.openclaw.app.protocol.OpenClawNotificationsCommand
import ai.openclaw.app.protocol.OpenClawSmsCommand
import ai.openclaw.app.protocol.OpenClawSystemCommand
import ai.openclaw.app.protocol.OpenClawTalkCommand
internal enum class SmsSearchAvailabilityReason {
Available,
@@ -59,6 +60,7 @@ class InvokeDispatcher(
private val deviceHandler: DeviceHandler,
private val notificationsHandler: NotificationsHandler,
private val systemHandler: SystemHandler,
private val talkHandler: TalkHandler,
private val photosHandler: PhotosHandler,
private val contactsHandler: ContactsHandler,
private val calendarHandler: CalendarHandler,
@@ -188,6 +190,12 @@ class InvokeDispatcher(
// System command
OpenClawSystemCommand.Notify.rawValue -> systemHandler.handleSystemNotify(paramsJson)
// Talk commands
OpenClawTalkCommand.PttStart.rawValue -> talkHandler.handlePttStart(paramsJson)
OpenClawTalkCommand.PttStop.rawValue -> talkHandler.handlePttStop(paramsJson)
OpenClawTalkCommand.PttCancel.rawValue -> talkHandler.handlePttCancel(paramsJson)
OpenClawTalkCommand.PttOnce.rawValue -> talkHandler.handlePttOnce(paramsJson)
// Photos command
ai.openclaw.app.protocol.OpenClawPhotosCommand.Latest.rawValue ->
photosHandler.handlePhotosLatest(
@@ -336,3 +344,13 @@ class InvokeDispatcher(
}
}
}
interface TalkHandler {
suspend fun handlePttStart(paramsJson: String?): GatewaySession.InvokeResult
suspend fun handlePttStop(paramsJson: String?): GatewaySession.InvokeResult
suspend fun handlePttCancel(paramsJson: String?): GatewaySession.InvokeResult
suspend fun handlePttOnce(paramsJson: String?): GatewaySession.InvokeResult
}

View File

@@ -7,6 +7,7 @@ enum class OpenClawCapability(
Camera("camera"),
Sms("sms"),
VoiceWake("voiceWake"),
Talk("talk"),
Location("location"),
Device("device"),
Notifications("notifications"),
@@ -71,6 +72,20 @@ enum class OpenClawSmsCommand(
}
}
enum class OpenClawTalkCommand(
val rawValue: String,
) {
PttStart("talk.ptt.start"),
PttStop("talk.ptt.stop"),
PttCancel("talk.ptt.cancel"),
PttOnce("talk.ptt.once"),
;
companion object {
const val NamespacePrefix: String = "talk."
}
}
enum class OpenClawLocationCommand(
val rawValue: String,
) {

View File

@@ -0,0 +1,45 @@
package ai.openclaw.app.voice
import kotlinx.serialization.json.JsonArray
import kotlinx.serialization.json.JsonElement
import kotlinx.serialization.json.JsonObject
import kotlinx.serialization.json.JsonPrimitive
internal object ChatEventText {
fun assistantTextFromPayload(payload: JsonObject): String? = assistantTextFromMessage(payload["message"])
fun assistantTextFromMessage(messageEl: JsonElement?): String? {
val message = messageEl.asObjectOrNull() ?: return null
val role = message["role"].asStringOrNull()
if (role != null && role != "assistant") return null
return textFromContent(message["content"])
}
private fun textFromContent(content: JsonElement?): String? =
when (content) {
is JsonPrimitive -> content.asStringOrNull()?.trim()?.takeIf { it.isNotEmpty() }
is JsonArray ->
content
.mapNotNull(::textFromContentPart)
.filter { it.isNotEmpty() }
.joinToString("\n")
.takeIf { it.isNotBlank() }
else -> null
}
private fun textFromContentPart(part: JsonElement): String? {
part
.asStringOrNull()
?.trim()
?.takeIf { it.isNotEmpty() }
?.let { return it }
val obj = part.asObjectOrNull() ?: return null
val type = obj["type"].asStringOrNull()
if (type != null && type != "text") return null
return obj["text"].asStringOrNull()?.trim()?.takeIf { it.isNotEmpty() }
}
}
private fun JsonElement?.asObjectOrNull(): JsonObject? = this as? JsonObject
private fun JsonElement?.asStringOrNull(): String? = (this as? JsonPrimitive)?.takeIf { it.isString }?.content

View File

@@ -21,7 +21,6 @@ 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
import kotlinx.serialization.json.JsonPrimitive
import java.util.UUID
@@ -596,20 +595,7 @@ class MicCaptureManager(
PackageManager.PERMISSION_GRANTED
)
private fun parseAssistantText(payload: JsonObject): String? {
val message = payload["message"].asObjectOrNull() ?: return null
if (message["role"].asStringOrNull() != "assistant") return null
val content = message["content"] as? JsonArray ?: return null
val parts =
content.mapNotNull { item ->
val obj = item.asObjectOrNull() ?: return@mapNotNull null
if (obj["type"].asStringOrNull() != "text") return@mapNotNull null
obj["text"].asStringOrNull()?.trim()?.takeIf { it.isNotEmpty() }
}
if (parts.isEmpty()) return null
return parts.joinToString("\n")
}
private fun parseAssistantText(payload: JsonObject): String? = ChatEventText.assistantTextFromPayload(payload)
private val listener =
object : RecognitionListener {

View File

@@ -12,20 +12,26 @@ import kotlinx.coroutines.delay
import kotlinx.coroutines.withContext
import java.io.File
internal interface TalkAudioPlaying {
suspend fun play(audio: TalkSpeakAudio)
fun stop()
}
internal class TalkAudioPlayer(
private val context: Context,
) {
) : TalkAudioPlaying {
private val lock = Any()
private var active: ActivePlayback? = null
suspend fun play(audio: TalkSpeakAudio) {
override 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() {
override fun stop() {
synchronized(lock) {
active?.cancel()
active = null

View File

@@ -41,7 +41,28 @@ import java.util.UUID
import java.util.concurrent.atomic.AtomicLong
import kotlin.coroutines.coroutineContext
class TalkModeManager(
data class TalkPttStartPayload(
val captureId: String,
) {
fun toJson(): String = """{"captureId":"$captureId"}"""
}
data class TalkPttStopPayload(
val captureId: String,
val transcript: String?,
val status: String,
) {
fun toJson(): String =
buildJsonObject {
put("captureId", JsonPrimitive(captureId))
if (transcript != null) {
put("transcript", JsonPrimitive(transcript))
}
put("status", JsonPrimitive(status))
}.toString()
}
class TalkModeManager internal constructor(
private val context: Context,
private val scope: CoroutineScope,
private val session: GatewaySession,
@@ -49,6 +70,8 @@ class TalkModeManager(
private val isConnected: () -> Boolean,
private val onBeforeSpeak: suspend () -> Unit = {},
private val onAfterSpeak: suspend () -> Unit = {},
private val talkSpeakClient: TalkSpeechSynthesizing = TalkSpeakClient(session = session),
private val talkAudioPlayer: TalkAudioPlaying = TalkAudioPlayer(context),
) {
companion object {
private const val tag = "TalkMode"
@@ -60,9 +83,6 @@ 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
@@ -82,6 +102,10 @@ class TalkModeManager(
private var restartJob: Job? = null
private var stopRequested = false
private var listeningMode = false
private var activePttCaptureId: String? = null
private var pttAutoStopEnabled = false
private var pttTimeoutJob: Job? = null
private var pttCompletion: CompletableDeferred<TalkPttStopPayload>? = null
private var silenceJob: Job? = null
private var silenceWindowMs = TalkDefaults.defaultSilenceTimeoutMs
@@ -156,6 +180,127 @@ class TalkModeManager(
}
}
suspend fun beginPushToTalk(): TalkPttStartPayload {
if (!isConnected()) {
_statusText.value = "Gateway not connected"
throw IllegalStateException("UNAVAILABLE: Gateway not connected")
}
activePttCaptureId?.let { return TalkPttStartPayload(captureId = it) }
stopSpeaking(resetInterrupt = false)
pttTimeoutJob?.cancel()
pttTimeoutJob = null
pttAutoStopEnabled = false
pttCompletion = null
silenceJob?.cancel()
silenceJob = null
listeningMode = false
finalizeInFlight = false
stopRequested = false
lastTranscript = ""
lastHeardAtMs = null
val micOk =
ContextCompat.checkSelfPermission(context, Manifest.permission.RECORD_AUDIO) ==
PackageManager.PERMISSION_GRANTED
if (!micOk) {
_statusText.value = "Microphone permission required"
throw IllegalStateException("MIC_PERMISSION_REQUIRED: grant Microphone permission")
}
if (!SpeechRecognizer.isRecognitionAvailable(context)) {
_statusText.value = "Speech recognizer unavailable"
throw IllegalStateException("UNAVAILABLE: Speech recognizer unavailable")
}
val captureId = UUID.randomUUID().toString()
activePttCaptureId = captureId
withContext(Dispatchers.Main) {
recognizer?.cancel()
recognizer?.destroy()
recognizer = SpeechRecognizer.createSpeechRecognizer(context).also { it.setRecognitionListener(listener) }
startListeningInternal(markListening = true)
}
_statusText.value = "Listening (PTT)"
return TalkPttStartPayload(captureId = captureId)
}
suspend fun endPushToTalk(): TalkPttStopPayload {
val captureId = activePttCaptureId ?: UUID.randomUUID().toString()
if (activePttCaptureId == null) {
return finishPushToTalk(TalkPttStopPayload(captureId = captureId, transcript = null, status = "idle"))
}
clearPushToTalkRecognition()
val transcript = lastTranscript.trim()
lastTranscript = ""
lastHeardAtMs = null
if (transcript.isEmpty()) {
_statusText.value = if (_isEnabled.value) "Listening" else "Ready"
if (_isEnabled.value) {
start()
}
return finishPushToTalk(TalkPttStopPayload(captureId = captureId, transcript = null, status = "empty"))
}
if (!isConnected()) {
_statusText.value = "Gateway not connected"
if (_isEnabled.value) {
start()
}
return finishPushToTalk(TalkPttStopPayload(captureId = captureId, transcript = transcript, status = "offline"))
}
_statusText.value = "Thinking…"
scope.launch {
finalizeTranscript(transcript)
}
return finishPushToTalk(TalkPttStopPayload(captureId = captureId, transcript = transcript, status = "queued"))
}
suspend fun cancelPushToTalk(): TalkPttStopPayload {
val captureId = activePttCaptureId ?: UUID.randomUUID().toString()
if (activePttCaptureId == null) {
return finishPushToTalk(TalkPttStopPayload(captureId = captureId, transcript = null, status = "idle"))
}
clearPushToTalkRecognition()
lastTranscript = ""
lastHeardAtMs = null
_statusText.value = if (_isEnabled.value) "Listening" else "Ready"
if (_isEnabled.value) {
start()
}
return finishPushToTalk(TalkPttStopPayload(captureId = captureId, transcript = null, status = "cancelled"))
}
suspend fun runPushToTalkOnce(maxDurationMs: Long = 12_000L): TalkPttStopPayload {
if (pttCompletion != null) {
cancelPushToTalk()
}
if (activePttCaptureId != null) {
return TalkPttStopPayload(
captureId = activePttCaptureId ?: UUID.randomUUID().toString(),
transcript = null,
status = "busy",
)
}
beginPushToTalk()
val completion = CompletableDeferred<TalkPttStopPayload>()
pttCompletion = completion
pttAutoStopEnabled = true
startSilenceMonitor()
pttTimeoutJob =
scope.launch {
delay(maxDurationMs)
if (pttAutoStopEnabled && activePttCaptureId != null) {
endPushToTalk()
}
}
return completion.await()
}
/**
* Speak a wake-word command through TalkMode's full pipeline:
* chat.send → wait for final → read assistant text → TTS.
@@ -335,6 +480,12 @@ class TalkModeManager(
stopRequested = true
finalizeInFlight = false
listeningMode = false
activePttCaptureId = null
pttAutoStopEnabled = false
pttCompletion?.cancel()
pttCompletion = null
pttTimeoutJob?.cancel()
pttTimeoutJob = null
restartJob?.cancel()
restartJob = null
silenceJob?.cancel()
@@ -434,7 +585,7 @@ class TalkModeManager(
silenceJob?.cancel()
silenceJob =
scope.launch {
while (_isEnabled.value) {
while (_isEnabled.value || pttAutoStopEnabled) {
delay(200)
checkSilence()
}
@@ -448,6 +599,12 @@ class TalkModeManager(
val lastHeard = lastHeardAtMs ?: return
val elapsed = SystemClock.elapsedRealtime() - lastHeard
if (elapsed < silenceWindowMs) return
if (activePttCaptureId != null) {
if (pttAutoStopEnabled) {
scope.launch { endPushToTalk() }
}
return
}
if (finalizeInFlight) return
finalizeInFlight = true
scope.launch {
@@ -525,6 +682,27 @@ class TalkModeManager(
}
}
private suspend fun clearPushToTalkRecognition() {
pttTimeoutJob?.cancel()
pttTimeoutJob = null
pttAutoStopEnabled = false
activePttCaptureId = null
_isListening.value = false
listeningMode = false
clearListenWatchdog()
withContext(Dispatchers.Main) {
recognizer?.cancel()
recognizer?.destroy()
recognizer = null
}
}
private fun finishPushToTalk(payload: TalkPttStopPayload): TalkPttStopPayload {
pttCompletion?.complete(payload)
pttCompletion = null
return payload
}
private suspend fun subscribeChatIfNeeded(
session: GatewaySession,
sessionKey: String,
@@ -656,20 +834,7 @@ class TalkModeManager(
}
}
private fun extractTextFromChatEventMessage(messageEl: JsonElement?): String? {
val msg = messageEl?.asObjectOrNull() ?: return null
val content = msg["content"] as? JsonArray ?: return null
return content
.mapNotNull { entry ->
entry
.asObjectOrNull()
?.get("text")
?.asStringOrNull()
?.trim()
}.filter { it.isNotEmpty() }
.joinToString("\n")
.takeIf { it.isNotBlank() }
}
private fun extractTextFromChatEventMessage(messageEl: JsonElement?): String? = ChatEventText.assistantTextFromMessage(messageEl)
private suspend fun waitForAssistantText(
session: GatewaySession,
@@ -729,17 +894,16 @@ class TalkModeManager(
_lastAssistantText.value = cleaned
ensurePlaybackActive(playbackToken)
_statusText.value = "Speaking"
_isSpeaking.value = true
_statusText.value = "Generating voice"
_isSpeaking.value = false
lastSpokenText = cleaned
ensureInterruptListener()
requestAudioFocusForTts()
try {
val started = SystemClock.elapsedRealtime()
when (val result = talkSpeakClient.synthesize(text = cleaned, directive = directive)) {
is TalkSpeakResult.Success -> {
ensurePlaybackActive(playbackToken)
markAudioPlaybackStarting(playbackToken)
talkAudioPlayer.play(result.audio)
ensurePlaybackActive(playbackToken)
Log.d(tag, "talk.speak ok durMs=${SystemClock.elapsedRealtime() - started}")
@@ -789,8 +953,6 @@ class TalkModeManager(
shouldResumeAfterSpeak = true
onBeforeSpeak()
ensurePlaybackActive(playbackToken)
_isSpeaking.value = true
_statusText.value = "Speaking…"
block()
} finally {
synchronized(ttsJobLock) {
@@ -888,6 +1050,7 @@ class TalkModeManager(
}
},
)
markAudioPlaybackStarting(playbackToken)
val result = engine.speak(text, TextToSpeech.QUEUE_FLUSH, null, utteranceId)
if (result != TextToSpeech.SUCCESS) {
throw IllegalStateException("TextToSpeech start failed")
@@ -905,6 +1068,14 @@ class TalkModeManager(
}
}
private fun markAudioPlaybackStarting(playbackToken: Long) {
ensurePlaybackActive(playbackToken)
_statusText.value = "Speaking…"
_isSpeaking.value = true
ensureInterruptListener()
requestAudioFocusForTts()
}
fun stopTts() {
stopSpeaking(resetInterrupt = true)
_isSpeaking.value = false

View File

@@ -28,12 +28,19 @@ internal sealed interface TalkSpeakResult {
) : TalkSpeakResult
}
internal interface TalkSpeechSynthesizing {
suspend fun synthesize(
text: String,
directive: TalkDirective?,
): 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(
) : TalkSpeechSynthesizing {
override suspend fun synthesize(
text: String,
directive: TalkDirective?,
): TalkSpeakResult {

View File

@@ -6,6 +6,11 @@ import ai.openclaw.app.gateway.GatewayEndpoint
import ai.openclaw.app.gateway.GatewaySession
import ai.openclaw.app.gateway.GatewayTlsProbeFailure
import ai.openclaw.app.gateway.GatewayTlsProbeResult
import ai.openclaw.app.node.InvokeDispatcher
import ai.openclaw.app.protocol.OpenClawTalkCommand
import ai.openclaw.app.voice.TalkModeManager
import android.Manifest
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.runBlocking
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
@@ -15,6 +20,7 @@ import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.RuntimeEnvironment
import org.robolectric.Shadows.shadowOf
import org.robolectric.annotation.Config
import java.lang.reflect.Field
import java.util.UUID
@@ -221,6 +227,23 @@ class GatewayBootstrapAuthTest {
assertNull(authStore.loadToken(deviceId, "operator"))
}
@Test
fun talkPttStart_cleansPreparedCaptureWhenBeginFails() =
runBlocking {
val app = RuntimeEnvironment.getApplication()
shadowOf(app).grantPermissions(Manifest.permission.RECORD_AUDIO)
val runtime = NodeRuntime(app)
val dispatcher = readField<InvokeDispatcher>(runtime, "invokeDispatcher")
val result = dispatcher.handleInvoke(OpenClawTalkCommand.PttStart.rawValue, null)
assertEquals("UNAVAILABLE", result.error?.code)
assertEquals(VoiceCaptureMode.Off, runtime.voiceCaptureMode.value)
assertFalse(readField<MutableStateFlow<Boolean>>(runtime, "externalAudioCaptureActive").value)
val talkMode = readField<Lazy<TalkModeManager>>(runtime, "talkMode\$delegate").value
assertFalse(talkMode.ttsOnAllResponses)
}
private fun waitForGatewayTrustPrompt(runtime: NodeRuntime): NodeRuntime.GatewayTrustPrompt {
repeat(50) {
runtime.pendingGatewayTrust.value?.let { return it }

View File

@@ -12,6 +12,7 @@ import ai.openclaw.app.protocol.OpenClawNotificationsCommand
import ai.openclaw.app.protocol.OpenClawPhotosCommand
import ai.openclaw.app.protocol.OpenClawSmsCommand
import ai.openclaw.app.protocol.OpenClawSystemCommand
import ai.openclaw.app.protocol.OpenClawTalkCommand
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertNotNull
@@ -26,6 +27,7 @@ class InvokeCommandRegistryTest {
OpenClawCapability.Device.rawValue,
OpenClawCapability.Notifications.rawValue,
OpenClawCapability.System.rawValue,
OpenClawCapability.Talk.rawValue,
OpenClawCapability.Photos.rawValue,
OpenClawCapability.Contacts.rawValue,
OpenClawCapability.Calendar.rawValue,
@@ -50,6 +52,10 @@ class InvokeCommandRegistryTest {
OpenClawNotificationsCommand.List.rawValue,
OpenClawNotificationsCommand.Actions.rawValue,
OpenClawSystemCommand.Notify.rawValue,
OpenClawTalkCommand.PttStart.rawValue,
OpenClawTalkCommand.PttStop.rawValue,
OpenClawTalkCommand.PttCancel.rawValue,
OpenClawTalkCommand.PttOnce.rawValue,
OpenClawPhotosCommand.Latest.rawValue,
OpenClawContactsCommand.Search.rawValue,
OpenClawContactsCommand.Add.rawValue,

View File

@@ -1,11 +1,13 @@
package ai.openclaw.app.node
import ai.openclaw.app.gateway.DeviceIdentityStore
import ai.openclaw.app.gateway.GatewaySession
import ai.openclaw.app.protocol.OpenClawCallLogCommand
import ai.openclaw.app.protocol.OpenClawCameraCommand
import ai.openclaw.app.protocol.OpenClawLocationCommand
import ai.openclaw.app.protocol.OpenClawMotionCommand
import ai.openclaw.app.protocol.OpenClawSmsCommand
import ai.openclaw.app.protocol.OpenClawTalkCommand
import android.content.Context
import android.content.pm.PackageManager
import kotlinx.coroutines.flow.MutableStateFlow
@@ -208,6 +210,27 @@ class InvokeDispatcherTest {
assertEquals("INVALID_REQUEST: unknown command", result.error?.message)
}
@Test
fun handleInvoke_routesTalkPttCommands() =
runTest {
val talk = InvokeDispatcherFakeTalkHandler()
val dispatcher = newDispatcher(talkHandler = talk)
val start = dispatcher.handleInvoke(OpenClawTalkCommand.PttStart.rawValue, null)
val stop = dispatcher.handleInvoke(OpenClawTalkCommand.PttStop.rawValue, null)
val cancel = dispatcher.handleInvoke(OpenClawTalkCommand.PttCancel.rawValue, null)
val once = dispatcher.handleInvoke(OpenClawTalkCommand.PttOnce.rawValue, null)
assertEquals("""{"captureId":"start"}""", start.payloadJson)
assertEquals("""{"status":"stop"}""", stop.payloadJson)
assertEquals("""{"status":"cancel"}""", cancel.payloadJson)
assertEquals("""{"status":"once"}""", once.payloadJson)
assertEquals(
listOf("start", "stop", "cancel", "once"),
talk.calls,
)
}
private fun newDispatcher(
cameraEnabled: Boolean = false,
locationEnabled: Boolean = false,
@@ -219,6 +242,7 @@ class InvokeDispatcherTest {
debugBuild: Boolean = false,
motionActivityAvailable: Boolean = false,
motionPedometerAvailable: Boolean = false,
talkHandler: TalkHandler = InvokeDispatcherFakeTalkHandler(),
): InvokeDispatcher {
val appContext = RuntimeEnvironment.getApplication()
shadowOf(appContext.packageManager).setSystemFeature(PackageManager.FEATURE_TELEPHONY, smsTelephonyAvailable)
@@ -238,6 +262,7 @@ class InvokeDispatcherTest {
stateProvider = InvokeDispatcherFakeNotificationsStateProvider(),
),
systemHandler = SystemHandler.forTesting(InvokeDispatcherFakeSystemNotificationPoster()),
talkHandler = talkHandler,
photosHandler = PhotosHandler.forTesting(appContext, InvokeDispatcherFakePhotosDataSource()),
contactsHandler = ContactsHandler.forTesting(appContext, InvokeDispatcherFakeContactsDataSource()),
calendarHandler = CalendarHandler.forTesting(appContext, InvokeDispatcherFakeCalendarDataSource()),
@@ -312,6 +337,30 @@ private class InvokeDispatcherFakeSystemNotificationPoster : SystemNotificationP
override fun post(request: SystemNotifyRequest) = Unit
}
private class InvokeDispatcherFakeTalkHandler : TalkHandler {
val calls = mutableListOf<String>()
override suspend fun handlePttStart(paramsJson: String?): GatewaySession.InvokeResult {
calls.add("start")
return GatewaySession.InvokeResult.ok("""{"captureId":"start"}""")
}
override suspend fun handlePttStop(paramsJson: String?): GatewaySession.InvokeResult {
calls.add("stop")
return GatewaySession.InvokeResult.ok("""{"status":"stop"}""")
}
override suspend fun handlePttCancel(paramsJson: String?): GatewaySession.InvokeResult {
calls.add("cancel")
return GatewaySession.InvokeResult.ok("""{"status":"cancel"}""")
}
override suspend fun handlePttOnce(paramsJson: String?): GatewaySession.InvokeResult {
calls.add("once")
return GatewaySession.InvokeResult.ok("""{"status":"once"}""")
}
}
private class InvokeDispatcherFakePhotosDataSource : PhotosDataSource {
override fun hasPermission(context: Context): Boolean = true

View File

@@ -25,6 +25,7 @@ class OpenClawProtocolConstantsTest {
assertEquals("canvas", OpenClawCapability.Canvas.rawValue)
assertEquals("camera", OpenClawCapability.Camera.rawValue)
assertEquals("voiceWake", OpenClawCapability.VoiceWake.rawValue)
assertEquals("talk", OpenClawCapability.Talk.rawValue)
assertEquals("location", OpenClawCapability.Location.rawValue)
assertEquals("sms", OpenClawCapability.Sms.rawValue)
assertEquals("device", OpenClawCapability.Device.rawValue)
@@ -92,6 +93,14 @@ class OpenClawProtocolConstantsTest {
assertEquals("sms.search", OpenClawSmsCommand.Search.rawValue)
}
@Test
fun talkCommandsUseStableStrings() {
assertEquals("talk.ptt.start", OpenClawTalkCommand.PttStart.rawValue)
assertEquals("talk.ptt.stop", OpenClawTalkCommand.PttStop.rawValue)
assertEquals("talk.ptt.cancel", OpenClawTalkCommand.PttCancel.rawValue)
assertEquals("talk.ptt.once", OpenClawTalkCommand.PttOnce.rawValue)
}
@Test
fun callLogCommandsUseStableStrings() {
assertEquals("callLog.search", OpenClawCallLogCommand.Search.rawValue)

View File

@@ -0,0 +1,69 @@
package ai.openclaw.app.voice
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.JsonObject
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNull
import org.junit.Test
class ChatEventTextTest {
private val json = Json { ignoreUnknownKeys = true }
@Test
fun extractsAssistantTextParts() {
val payload =
payload(
"""
{
"message": {
"role": "assistant",
"content": [
{ "type": "text", "text": "hello" },
{ "type": "text", "text": "world" }
]
}
}
""",
)
assertEquals("hello\nworld", ChatEventText.assistantTextFromPayload(payload))
}
@Test
fun extractsPlainStringContent() {
val payload =
payload(
"""
{
"message": {
"role": "assistant",
"content": "plain reply"
}
}
""",
)
assertEquals("plain reply", ChatEventText.assistantTextFromPayload(payload))
}
@Test
fun ignoresUserMessages() {
val payload =
payload(
"""
{
"message": {
"role": "user",
"content": [
{ "type": "text", "text": "do not speak" }
]
}
}
""",
)
assertNull(ChatEventText.assistantTextFromPayload(payload))
}
private fun payload(source: String): JsonObject = json.parseToJsonElement(source.trimIndent()) as JsonObject
}

View File

@@ -9,7 +9,10 @@ import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.launch
import kotlinx.coroutines.test.runTest
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Test
import org.junit.runner.RunWith
@@ -78,7 +81,54 @@ class TalkModeManagerTest {
assertEquals(1L, playbackGeneration(manager).get())
}
private fun createManager(): TalkModeManager {
@Test
fun nonPendingUserFinalDoesNotUseAllResponseTts() {
val manager = createManager()
manager.ttsOnAllResponses = true
manager.handleGatewayEvent("chat", chatFinalPayload(runId = "run-user", text = "do not speak", role = "user"))
assertEquals(0L, playbackGeneration(manager).get())
}
@Test
fun textReadyDoesNotEnterSpeakingUntilAudioPlaybackStarts() =
runTest {
val talkSpeakClient = FakeTalkSpeechSynthesizer()
val talkAudioPlayer = FakeTalkAudioPlayer()
val manager = createManager(talkSpeakClient = talkSpeakClient, talkAudioPlayer = talkAudioPlayer)
val job = launch { manager.speakAssistantReply("hello") }
talkSpeakClient.requested.await()
assertEquals("Generating voice…", manager.statusText.value)
assertFalse(manager.isSpeaking.value)
talkSpeakClient.result.complete(
TalkSpeakResult.Success(
TalkSpeakAudio(
bytes = byteArrayOf(1, 2, 3),
provider = "test",
outputFormat = "mp3_44100_128",
voiceCompatible = true,
mimeType = "audio/mpeg",
fileExtension = ".mp3",
),
),
)
talkAudioPlayer.started.await()
assertEquals("Speaking…", manager.statusText.value)
assertTrue(manager.isSpeaking.value)
talkAudioPlayer.finished.complete(Unit)
job.join()
}
private fun createManager(
talkSpeakClient: TalkSpeechSynthesizing = TalkSpeakClient(),
talkAudioPlayer: TalkAudioPlaying? = null,
): TalkModeManager {
val app = RuntimeEnvironment.getApplication()
val sessionJob = SupervisorJob()
val session =
@@ -96,6 +146,8 @@ class TalkModeManagerTest {
session = session,
supportsChatSubscribe = false,
isConnected = { true },
talkSpeakClient = talkSpeakClient,
talkAudioPlayer = talkAudioPlayer ?: TalkAudioPlayer(app),
)
}
@@ -124,6 +176,7 @@ class TalkModeManagerTest {
private fun chatFinalPayload(
runId: String,
text: String,
role: String = "assistant",
): String =
"""
{
@@ -131,7 +184,7 @@ class TalkModeManagerTest {
"sessionKey": "main",
"state": "final",
"message": {
"role": "assistant",
"role": "$role",
"content": [
{ "type": "text", "text": "$text" }
]
@@ -140,6 +193,34 @@ class TalkModeManagerTest {
""".trimIndent()
}
private class FakeTalkSpeechSynthesizer : TalkSpeechSynthesizing {
val requested = CompletableDeferred<Unit>()
val result = CompletableDeferred<TalkSpeakResult>()
override suspend fun synthesize(
text: String,
directive: TalkDirective?,
): TalkSpeakResult {
requested.complete(Unit)
return result.await()
}
}
private class FakeTalkAudioPlayer : TalkAudioPlaying {
val started = CompletableDeferred<Unit>()
val finished = CompletableDeferred<Unit>()
var stopped = false
override suspend fun play(audio: TalkSpeakAudio) {
started.complete(Unit)
finished.await()
}
override fun stop() {
stopped = true
}
}
private class InMemoryDeviceAuthStore : DeviceAuthTokenStore {
override fun loadEntry(
deviceId: String,

View File

@@ -1,5 +1,9 @@
# OpenClaw iOS Changelog
## 2026.5.6 - 2026-05-06
Maintenance update for the current OpenClaw development release.
## 2026.5.5 - 2026-05-05
Maintenance update for the current OpenClaw development release.

View File

@@ -2,8 +2,8 @@
// Source of truth: apps/ios/version.json
// Generated by scripts/ios-sync-versioning.ts.
OPENCLAW_IOS_VERSION = 2026.5.5
OPENCLAW_MARKETING_VERSION = 2026.5.5
OPENCLAW_IOS_VERSION = 2026.5.6
OPENCLAW_MARKETING_VERSION = 2026.5.6
OPENCLAW_BUILD_VERSION = 1
#include? "../build/Version.xcconfig"

View File

@@ -689,7 +689,7 @@ final class GatewayConnectionController {
}
private func shouldRequireTLS(host: String) -> Bool {
!Self.isLoopbackHost(host)
!LoopbackHost.isLocalNetworkHost(host)
}
private func shouldForceTLS(host: String) -> Bool {
@@ -698,51 +698,6 @@ final class GatewayConnectionController {
return trimmed.hasSuffix(".ts.net") || trimmed.hasSuffix(".ts.net.")
}
private static func isLoopbackHost(_ rawHost: String) -> Bool {
var host = rawHost.trimmingCharacters(in: .whitespacesAndNewlines).lowercased()
guard !host.isEmpty else { return false }
if host.hasPrefix("[") && host.hasSuffix("]") {
host.removeFirst()
host.removeLast()
}
if host.hasSuffix(".") {
host.removeLast()
}
if let zoneIndex = host.firstIndex(of: "%") {
host = String(host[..<zoneIndex])
}
if host.isEmpty { return false }
if host == "localhost" || host == "0.0.0.0" || host == "::" {
return true
}
return Self.isLoopbackIPv4(host) || Self.isLoopbackIPv6(host)
}
private static func isLoopbackIPv4(_ host: String) -> Bool {
var addr = in_addr()
let parsed = host.withCString { inet_pton(AF_INET, $0, &addr) == 1 }
guard parsed else { return false }
let value = UInt32(bigEndian: addr.s_addr)
let firstOctet = UInt8((value >> 24) & 0xFF)
return firstOctet == 127
}
private static func isLoopbackIPv6(_ host: String) -> Bool {
var addr = in6_addr()
let parsed = host.withCString { inet_pton(AF_INET6, $0, &addr) == 1 }
guard parsed else { return false }
return withUnsafeBytes(of: &addr) { rawBytes in
let bytes = rawBytes.bindMemory(to: UInt8.self)
let isV6Loopback = bytes[0..<15].allSatisfy { $0 == 0 } && bytes[15] == 1
if isV6Loopback { return true }
let isMappedV4 = bytes[0..<10].allSatisfy { $0 == 0 } && bytes[10] == 0xFF && bytes[11] == 0xFF
return isMappedV4 && bytes[12] == 127
}
}
private func manualStableID(host: String, port: Int) -> String {
"manual|\(host.lowercased())|\(port)"
}
@@ -821,6 +776,7 @@ final class GatewayConnectionController {
if locationMode != .off { caps.append(OpenClawCapability.location.rawValue) }
caps.append(OpenClawCapability.device.rawValue)
caps.append(OpenClawCapability.talk.rawValue)
if WatchMessagingService.isSupportedOnDevice() {
caps.append(OpenClawCapability.watch.rawValue)
}

View File

@@ -800,11 +800,11 @@ final class TalkModeManager: NSObject {
}
}
let completion = await self.waitForChatCompletion(runId: runId, gateway: gateway, timeoutSeconds: 120)
if completion == .timeout {
if completion.state == .timeout {
self.logger.warning(
"chat completion timeout runId=\(runId, privacy: .public); attempting history fallback")
GatewayDiagnostics.log("talk: chat completion timeout runId=\(runId)")
} else if completion == .aborted {
} else if completion.state == .aborted {
self.statusText = "Aborted"
self.logger.warning("chat completion aborted runId=\(runId, privacy: .public)")
GatewayDiagnostics.log("talk: chat completion aborted runId=\(runId)")
@@ -812,7 +812,7 @@ final class TalkModeManager: NSObject {
await self.finishIncrementalSpeech()
await self.start()
return
} else if completion == .error {
} else if completion.state == .error {
self.statusText = "Chat error"
self.logger.warning("chat completion error runId=\(runId, privacy: .public)")
GatewayDiagnostics.log("talk: chat completion error runId=\(runId)")
@@ -822,16 +822,19 @@ final class TalkModeManager: NSObject {
return
}
var assistantText = try await self.waitForAssistantText(
gateway: gateway,
since: startedAt,
timeoutSeconds: completion == .final ? 12 : 25)
var assistantText = completion.assistantText
if assistantText == nil, shouldIncremental {
let fallback = self.incrementalSpeechBuffer.latestText
if !fallback.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
assistantText = fallback
}
}
if assistantText == nil {
assistantText = try await self.waitForAssistantTextFromHistory(
gateway: gateway,
since: startedAt,
timeoutSeconds: completion.state == .final ? 12 : 25)
}
guard let assistantText else {
self.statusText = "No reply"
self.logger.warning("assistant text timeout runId=\(runId, privacy: .public)")
@@ -898,6 +901,11 @@ final class TalkModeManager: NSObject {
}
}
private struct ChatCompletionResult {
var state: ChatCompletionState
var assistantText: String?
}
private func sendChat(_ message: String, gateway: GatewayNodeSession) async throws -> String {
struct SendResponse: Decodable { let runId: String }
let payload: [String: Any] = [
@@ -922,40 +930,51 @@ final class TalkModeManager: NSObject {
private func waitForChatCompletion(
runId: String,
gateway: GatewayNodeSession,
timeoutSeconds: Int = 120) async -> ChatCompletionState
timeoutSeconds: Int = 120) async -> ChatCompletionResult
{
let stream = await gateway.subscribeServerEvents(bufferingNewest: 200)
return await withTaskGroup(of: ChatCompletionState.self) { group in
return await withTaskGroup(of: ChatCompletionResult.self) { group in
group.addTask { [runId] in
var latestAssistantText: String?
for await evt in stream {
if Task.isCancelled { return .timeout }
if Task.isCancelled {
return ChatCompletionResult(state: .timeout, assistantText: latestAssistantText)
}
guard evt.event == "chat", let payload = evt.payload else { continue }
guard let chatEvent = try? GatewayPayloadDecoding.decode(payload, as: ChatEvent.self) else {
guard let chatEvent = try? GatewayPayloadDecoding.decode(
payload,
as: OpenClawChatEventPayload.self)
else {
continue
}
guard chatEvent.runid == runId else { continue }
if let state = chatEvent.state.value as? String {
switch state {
case "final": return .final
case "aborted": return .aborted
case "error": return .error
default: break
}
guard chatEvent.runId == runId else { continue }
if let text = OpenClawChatEventText.assistantText(from: chatEvent) {
latestAssistantText = text
}
switch chatEvent.state {
case "final":
return ChatCompletionResult(state: .final, assistantText: latestAssistantText)
case "aborted":
return ChatCompletionResult(state: .aborted, assistantText: nil)
case "error":
return ChatCompletionResult(state: .error, assistantText: nil)
default:
break
}
}
return .timeout
return ChatCompletionResult(state: .timeout, assistantText: latestAssistantText)
}
group.addTask {
try? await Task.sleep(nanoseconds: UInt64(timeoutSeconds) * 1_000_000_000)
return .timeout
return ChatCompletionResult(state: .timeout, assistantText: nil)
}
let result = await group.next() ?? .timeout
let result = await group.next() ?? ChatCompletionResult(state: .timeout, assistantText: nil)
group.cancelAll()
return result
}
}
private func waitForAssistantText(
private func waitForAssistantTextFromHistory(
gateway: GatewayNodeSession,
since: Double,
timeoutSeconds: Int) async throws -> String?

View File

@@ -101,6 +101,20 @@ private func agentAction(
#expect(DeepLinkParser.parse(url) == nil)
}
@Test func parseGatewayLinkAllowsPrivateLanWs() {
let url = URL(
string: "openclaw://gateway?host=openclaw.local&port=18789&tls=0&token=abc")!
#expect(
DeepLinkParser.parse(url) == .gateway(
.init(
host: "openclaw.local",
port: 18789,
tls: false,
bootstrapToken: nil,
token: "abc",
password: nil)))
}
@Test func parseGatewayLinkRejectsInsecurePrefixBypassHost() {
let url = URL(
string: "openclaw://gateway?host=127.attacker.example&port=18789&tls=0&token=abc")!
@@ -162,6 +176,25 @@ private func agentAction(
password: nil))
}
@Test func parseGatewaySetupCodeAllowsPrivateLanWs() {
let payload = #"{"url":"ws://openclaw.local:18789","bootstrapToken":"tok"}"#
let link = GatewayConnectDeepLink.fromSetupCode(setupCode(from: payload))
#expect(link == .init(
host: "openclaw.local",
port: 18789,
tls: false,
bootstrapToken: "tok",
token: nil,
password: nil))
}
@Test func parseGatewaySetupCodeRejectsTailnetPlaintextWs() {
let payload = #"{"url":"ws://gateway.tailnet.ts.net:18789","bootstrapToken":"tok"}"#
let link = GatewayConnectDeepLink.fromSetupCode(setupCode(from: payload))
#expect(link == nil)
}
@Test func parseGatewaySetupInputParsesFullCopiedSetupMessage() {
let payload = #"{"url":"wss://gateway.example.com","bootstrapToken":"tok"}"#
let link = GatewayConnectDeepLink.fromSetupInput("""

View File

@@ -36,6 +36,7 @@ import UIKit
#expect(caps.contains(OpenClawCapability.camera.rawValue))
#expect(caps.contains(OpenClawCapability.location.rawValue))
#expect(caps.contains(OpenClawCapability.voiceWake.rawValue))
#expect(caps.contains(OpenClawCapability.talk.rawValue))
}
}

View File

@@ -107,8 +107,9 @@ import Testing
let controller = makeController()
#expect(controller._test_resolveManualUseTLS(host: "gateway.example.com", useTLS: false) == true)
#expect(controller._test_resolveManualUseTLS(host: "openclaw.local", useTLS: false) == true)
#expect(controller._test_resolveManualUseTLS(host: "127.attacker.example", useTLS: false) == true)
#expect(controller._test_resolveManualUseTLS(host: "gateway.ts.net", useTLS: false) == true)
#expect(controller._test_resolveManualUseTLS(host: "100.64.0.9", useTLS: false) == true)
#expect(controller._test_resolveManualUseTLS(host: "localhost", useTLS: false) == false)
#expect(controller._test_resolveManualUseTLS(host: "127.0.0.1", useTLS: false) == false)
@@ -118,6 +119,17 @@ import Testing
#expect(controller._test_resolveManualUseTLS(host: "0.0.0.0", useTLS: false) == false)
}
@Test @MainActor func manualConnectionsAllowPrivateLanPlaintext() async {
let controller = makeController()
#expect(controller._test_resolveManualUseTLS(host: "openclaw.local", useTLS: false) == false)
#expect(controller._test_resolveManualUseTLS(host: "192.168.1.20", useTLS: false) == false)
#expect(controller._test_resolveManualUseTLS(host: "10.0.0.5", useTLS: false) == false)
#expect(controller._test_resolveManualUseTLS(host: "172.16.1.5", useTLS: false) == false)
#expect(controller._test_resolveManualUseTLS(host: "169.254.1.5", useTLS: false) == false)
#expect(controller._test_resolveManualUseTLS(host: "fd00::1", useTLS: false) == false)
}
@Test @MainActor func manualDefaultPortUses443OnlyForTailnetTLSHosts() async {
let controller = makeController()

View File

@@ -1,3 +1,3 @@
{
"version": "2026.5.5"
"version": "2026.5.6"
}

View File

@@ -15,9 +15,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2026.5.5</string>
<string>2026.5.6</string>
<key>CFBundleVersion</key>
<string>2026050500</string>
<string>2026050600</string>
<key>CFBundleIconFile</key>
<string>OpenClaw</string>
<key>CFBundleURLTypes</key>

View File

@@ -395,10 +395,18 @@ actor TalkModeRuntime {
"talk chat.send ok runId=\(response.runId, privacy: .public) " +
"session=\(sessionKey, privacy: .public)")
guard let assistantText = await self.waitForAssistantText(
var assistantText = await self.waitForAssistantEventText(
sessionKey: sessionKey,
since: startedAt,
runId: response.runId,
timeoutSeconds: 45)
if assistantText == nil {
self.logger.warning("talk assistant event text missing; using history fallback")
assistantText = await self.waitForAssistantTextFromHistory(
sessionKey: sessionKey,
since: startedAt,
timeoutSeconds: 12)
}
guard let assistantText
else {
self.logger.warning("talk assistant text missing after timeout")
await self.startListening()
@@ -439,7 +447,67 @@ actor TalkModeRuntime {
return TalkPromptBuilder.build(transcript: transcript, interruptedAtSeconds: interrupted)
}
private func waitForAssistantText(
private func waitForAssistantEventText(
sessionKey: String,
runId: String,
timeoutSeconds: Int) async -> String?
{
let stream = await GatewayConnection.shared.subscribe(bufferingNewest: 200)
return await withTaskGroup(of: String?.self) { group in
group.addTask { [runId, sessionKey] in
var latestText: String?
for await push in stream {
if Task.isCancelled { return latestText }
guard case let .event(evt) = push else { continue }
guard evt.event == "chat", let payload = evt.payload else { continue }
guard let chatEvent = try? GatewayPayloadDecoding.decode(
payload,
as: OpenClawChatEventPayload.self)
else {
continue
}
guard chatEvent.runId == runId else { continue }
if let eventSessionKey = chatEvent.sessionKey,
!Self.matchesSessionKey(eventSessionKey, sessionKey)
{
continue
}
if let text = OpenClawChatEventText.assistantText(from: chatEvent) {
latestText = text
}
switch chatEvent.state {
case "final":
return latestText
case "aborted", "error":
return nil
default:
break
}
}
return latestText
}
group.addTask {
try? await Task.sleep(nanoseconds: UInt64(timeoutSeconds) * 1_000_000_000)
return nil
}
guard let result = await group.next() else {
group.cancelAll()
return nil
}
group.cancelAll()
return result
}
}
private static func matchesSessionKey(_ incoming: String, _ current: String) -> Bool {
let incoming = incoming.trimmingCharacters(in: .whitespacesAndNewlines).lowercased()
let current = current.trimmingCharacters(in: .whitespacesAndNewlines).lowercased()
if incoming == current { return true }
return (incoming == "agent:main:main" && current == "main") ||
(incoming == "main" && current == "agent:main:main")
}
private func waitForAssistantTextFromHistory(
sessionKey: String,
since: Double,
timeoutSeconds: Int) async -> String?
@@ -1111,7 +1179,10 @@ extension TalkModeRuntime {
} else {
self.ttsLogger
.info(
"talk provider \(parsed.activeProvider, privacy: .public) uses gateway talk.speak with system voice fallback")
"""
talk provider \(parsed.activeProvider, privacy: .public) uses gateway talk.speak \
with system voice fallback
""")
}
return parsed
} catch {

View File

@@ -1910,6 +1910,7 @@ public struct SessionsCreateParams: Codable, Sendable {
public let label: String?
public let model: String?
public let parentsessionkey: String?
public let emitcommandhooks: Bool?
public let task: String?
public let message: String?
@@ -1919,6 +1920,7 @@ public struct SessionsCreateParams: Codable, Sendable {
label: String?,
model: String?,
parentsessionkey: String?,
emitcommandhooks: Bool?,
task: String?,
message: String?)
{
@@ -1927,6 +1929,7 @@ public struct SessionsCreateParams: Codable, Sendable {
self.label = label
self.model = model
self.parentsessionkey = parentsessionkey
self.emitcommandhooks = emitcommandhooks
self.task = task
self.message = message
}
@@ -1937,6 +1940,7 @@ public struct SessionsCreateParams: Codable, Sendable {
case label
case model
case parentsessionkey = "parentSessionKey"
case emitcommandhooks = "emitCommandHooks"
case task
case message
}
@@ -2630,6 +2634,202 @@ public struct TalkModeParams: Codable, Sendable {
}
}
public struct TalkEvent: Codable, Sendable {
public let id: String
public let type: AnyCodable
public let sessionid: String
public let turnid: String?
public let captureid: String?
public let seq: Int
public let timestamp: String
public let mode: AnyCodable
public let transport: AnyCodable
public let brain: AnyCodable
public let provider: String?
public let final: Bool?
public let callid: String?
public let itemid: String?
public let parentid: String?
public let payload: AnyCodable
public init(
id: String,
type: AnyCodable,
sessionid: String,
turnid: String?,
captureid: String?,
seq: Int,
timestamp: String,
mode: AnyCodable,
transport: AnyCodable,
brain: AnyCodable,
provider: String?,
final: Bool?,
callid: String?,
itemid: String?,
parentid: String?,
payload: AnyCodable)
{
self.id = id
self.type = type
self.sessionid = sessionid
self.turnid = turnid
self.captureid = captureid
self.seq = seq
self.timestamp = timestamp
self.mode = mode
self.transport = transport
self.brain = brain
self.provider = provider
self.final = final
self.callid = callid
self.itemid = itemid
self.parentid = parentid
self.payload = payload
}
private enum CodingKeys: String, CodingKey {
case id
case type
case sessionid = "sessionId"
case turnid = "turnId"
case captureid = "captureId"
case seq
case timestamp
case mode
case transport
case brain
case provider
case final
case callid = "callId"
case itemid = "itemId"
case parentid = "parentId"
case payload
}
}
public struct TalkCatalogParams: Codable, Sendable {}
public struct TalkCatalogResult: Codable, Sendable {
public let modes: [AnyCodable]
public let transports: [AnyCodable]
public let brains: [AnyCodable]
public let speech: [String: AnyCodable]
public let transcription: [String: AnyCodable]
public let realtime: [String: AnyCodable]
public init(
modes: [AnyCodable],
transports: [AnyCodable],
brains: [AnyCodable],
speech: [String: AnyCodable],
transcription: [String: AnyCodable],
realtime: [String: AnyCodable])
{
self.modes = modes
self.transports = transports
self.brains = brains
self.speech = speech
self.transcription = transcription
self.realtime = realtime
}
private enum CodingKeys: String, CodingKey {
case modes
case transports
case brains
case speech
case transcription
case realtime
}
}
public struct TalkClientCreateParams: Codable, Sendable {
public let sessionkey: String?
public let provider: String?
public let model: String?
public let voice: String?
public let mode: AnyCodable?
public let transport: AnyCodable?
public let brain: AnyCodable?
public init(
sessionkey: String?,
provider: String?,
model: String?,
voice: String?,
mode: AnyCodable?,
transport: AnyCodable?,
brain: AnyCodable?)
{
self.sessionkey = sessionkey
self.provider = provider
self.model = model
self.voice = voice
self.mode = mode
self.transport = transport
self.brain = brain
}
private enum CodingKeys: String, CodingKey {
case sessionkey = "sessionKey"
case provider
case model
case voice
case mode
case transport
case brain
}
}
public struct TalkClientToolCallParams: Codable, Sendable {
public let sessionkey: String
public let callid: String
public let name: String
public let args: AnyCodable?
public let relaysessionid: String?
public init(
sessionkey: String,
callid: String,
name: String,
args: AnyCodable?,
relaysessionid: String?)
{
self.sessionkey = sessionkey
self.callid = callid
self.name = name
self.args = args
self.relaysessionid = relaysessionid
}
private enum CodingKeys: String, CodingKey {
case sessionkey = "sessionKey"
case callid = "callId"
case name
case args
case relaysessionid = "relaySessionId"
}
}
public struct TalkClientToolCallResult: Codable, Sendable {
public let runid: String
public let idempotencykey: String
public init(
runid: String,
idempotencykey: String)
{
self.runid = runid
self.idempotencykey = idempotencykey
}
private enum CodingKeys: String, CodingKey {
case runid = "runId"
case idempotencykey = "idempotencyKey"
}
}
public struct TalkConfigParams: Codable, Sendable {
public let includesecrets: Bool?
@@ -2658,22 +2858,100 @@ public struct TalkConfigResult: Codable, Sendable {
}
}
public struct TalkRealtimeSessionParams: Codable, Sendable {
public struct TalkSessionAppendAudioParams: Codable, Sendable {
public let sessionid: String
public let audiobase64: String
public let timestamp: Double?
public init(
sessionid: String,
audiobase64: String,
timestamp: Double?)
{
self.sessionid = sessionid
self.audiobase64 = audiobase64
self.timestamp = timestamp
}
private enum CodingKeys: String, CodingKey {
case sessionid = "sessionId"
case audiobase64 = "audioBase64"
case timestamp
}
}
public struct TalkSessionCancelOutputParams: Codable, Sendable {
public let sessionid: String
public let turnid: String?
public let reason: String?
public init(
sessionid: String,
turnid: String?,
reason: String?)
{
self.sessionid = sessionid
self.turnid = turnid
self.reason = reason
}
private enum CodingKeys: String, CodingKey {
case sessionid = "sessionId"
case turnid = "turnId"
case reason
}
}
public struct TalkSessionCancelTurnParams: Codable, Sendable {
public let sessionid: String
public let turnid: String?
public let reason: String?
public init(
sessionid: String,
turnid: String?,
reason: String?)
{
self.sessionid = sessionid
self.turnid = turnid
self.reason = reason
}
private enum CodingKeys: String, CodingKey {
case sessionid = "sessionId"
case turnid = "turnId"
case reason
}
}
public struct TalkSessionCreateParams: Codable, Sendable {
public let sessionkey: String?
public let provider: String?
public let model: String?
public let voice: String?
public let mode: AnyCodable?
public let transport: AnyCodable?
public let brain: AnyCodable?
public let ttlms: Int?
public init(
sessionkey: String?,
provider: String?,
model: String?,
voice: String?)
voice: String?,
mode: AnyCodable?,
transport: AnyCodable?,
brain: AnyCodable?,
ttlms: Int?)
{
self.sessionkey = sessionkey
self.provider = provider
self.model = model
self.voice = voice
self.mode = mode
self.transport = transport
self.brain = brain
self.ttlms = ttlms
}
private enum CodingKeys: String, CodingKey {
@@ -2681,86 +2959,252 @@ public struct TalkRealtimeSessionParams: Codable, Sendable {
case provider
case model
case voice
case mode
case transport
case brain
case ttlms = "ttlMs"
}
}
public struct TalkRealtimeRelayAudioParams: Codable, Sendable {
public let relaysessionid: String
public let audiobase64: String
public let timestamp: Double?
public struct TalkSessionCreateResult: Codable, Sendable {
public let sessionid: String
public let provider: String?
public let mode: AnyCodable
public let transport: AnyCodable
public let brain: AnyCodable
public let relaysessionid: String?
public let transcriptionsessionid: String?
public let handoffid: String?
public let roomid: String?
public let roomurl: String?
public let token: String?
public let audio: AnyCodable?
public let model: String?
public let voice: String?
public let expiresat: Double?
public init(
relaysessionid: String,
audiobase64: String,
timestamp: Double?)
sessionid: String,
provider: String?,
mode: AnyCodable,
transport: AnyCodable,
brain: AnyCodable,
relaysessionid: String?,
transcriptionsessionid: String?,
handoffid: String?,
roomid: String?,
roomurl: String?,
token: String?,
audio: AnyCodable?,
model: String?,
voice: String?,
expiresat: Double?)
{
self.sessionid = sessionid
self.provider = provider
self.mode = mode
self.transport = transport
self.brain = brain
self.relaysessionid = relaysessionid
self.audiobase64 = audiobase64
self.timestamp = timestamp
self.transcriptionsessionid = transcriptionsessionid
self.handoffid = handoffid
self.roomid = roomid
self.roomurl = roomurl
self.token = token
self.audio = audio
self.model = model
self.voice = voice
self.expiresat = expiresat
}
private enum CodingKeys: String, CodingKey {
case sessionid = "sessionId"
case provider
case mode
case transport
case brain
case relaysessionid = "relaySessionId"
case audiobase64 = "audioBase64"
case timestamp
case transcriptionsessionid = "transcriptionSessionId"
case handoffid = "handoffId"
case roomid = "roomId"
case roomurl = "roomUrl"
case token
case audio
case model
case voice
case expiresat = "expiresAt"
}
}
public struct TalkRealtimeRelayMarkParams: Codable, Sendable {
public let relaysessionid: String
public let markname: String?
public struct TalkSessionJoinParams: Codable, Sendable {
public let sessionid: String
public let token: String
public init(
relaysessionid: String,
markname: String?)
sessionid: String,
token: String)
{
self.relaysessionid = relaysessionid
self.markname = markname
self.sessionid = sessionid
self.token = token
}
private enum CodingKeys: String, CodingKey {
case relaysessionid = "relaySessionId"
case markname = "markName"
case sessionid = "sessionId"
case token
}
}
public struct TalkRealtimeRelayStopParams: Codable, Sendable {
public let relaysessionid: String
public struct TalkSessionJoinResult: Codable, Sendable {
public let id: String
public let roomid: String
public let roomurl: String
public let sessionkey: String
public let sessionid: String?
public let channel: String?
public let target: String?
public let provider: String?
public let model: String?
public let voice: String?
public let mode: AnyCodable
public let transport: AnyCodable
public let brain: AnyCodable
public let createdat: Double
public let expiresat: Double
public let room: [String: AnyCodable]
public init(
relaysessionid: String)
id: String,
roomid: String,
roomurl: String,
sessionkey: String,
sessionid: String?,
channel: String?,
target: String?,
provider: String?,
model: String?,
voice: String?,
mode: AnyCodable,
transport: AnyCodable,
brain: AnyCodable,
createdat: Double,
expiresat: Double,
room: [String: AnyCodable])
{
self.relaysessionid = relaysessionid
self.id = id
self.roomid = roomid
self.roomurl = roomurl
self.sessionkey = sessionkey
self.sessionid = sessionid
self.channel = channel
self.target = target
self.provider = provider
self.model = model
self.voice = voice
self.mode = mode
self.transport = transport
self.brain = brain
self.createdat = createdat
self.expiresat = expiresat
self.room = room
}
private enum CodingKeys: String, CodingKey {
case relaysessionid = "relaySessionId"
case id
case roomid = "roomId"
case roomurl = "roomUrl"
case sessionkey = "sessionKey"
case sessionid = "sessionId"
case channel
case target
case provider
case model
case voice
case mode
case transport
case brain
case createdat = "createdAt"
case expiresat = "expiresAt"
case room
}
}
public struct TalkRealtimeRelayToolResultParams: Codable, Sendable {
public let relaysessionid: String
public struct TalkSessionTurnParams: Codable, Sendable {
public let sessionid: String
public let turnid: String?
public init(
sessionid: String,
turnid: String?)
{
self.sessionid = sessionid
self.turnid = turnid
}
private enum CodingKeys: String, CodingKey {
case sessionid = "sessionId"
case turnid = "turnId"
}
}
public struct TalkSessionTurnResult: Codable, Sendable {
public let ok: Bool
public let turnid: String?
public let events: [TalkEvent]?
public init(
ok: Bool,
turnid: String?,
events: [TalkEvent]?)
{
self.ok = ok
self.turnid = turnid
self.events = events
}
private enum CodingKeys: String, CodingKey {
case ok
case turnid = "turnId"
case events
}
}
public struct TalkSessionSubmitToolResultParams: Codable, Sendable {
public let sessionid: String
public let callid: String
public let result: AnyCodable
public init(
relaysessionid: String,
sessionid: String,
callid: String,
result: AnyCodable)
{
self.relaysessionid = relaysessionid
self.sessionid = sessionid
self.callid = callid
self.result = result
}
private enum CodingKeys: String, CodingKey {
case relaysessionid = "relaySessionId"
case sessionid = "sessionId"
case callid = "callId"
case result
}
}
public struct TalkRealtimeRelayOkResult: Codable, Sendable {
public struct TalkSessionCloseParams: Codable, Sendable {
public let sessionid: String
public init(
sessionid: String)
{
self.sessionid = sessionid
}
private enum CodingKeys: String, CodingKey {
case sessionid = "sessionId"
}
}
public struct TalkSessionOkResult: Codable, Sendable {
public let ok: Bool
public init(
@@ -2903,6 +3347,8 @@ public struct ChannelsStatusResult: Codable, Sendable {
public let channelaccounts: [String: AnyCodable]
public let channeldefaultaccountid: [String: AnyCodable]
public let eventloop: [String: AnyCodable]?
public let partial: Bool?
public let warnings: [String]?
public init(
ts: Int,
@@ -2914,7 +3360,9 @@ public struct ChannelsStatusResult: Codable, Sendable {
channels: [String: AnyCodable],
channelaccounts: [String: AnyCodable],
channeldefaultaccountid: [String: AnyCodable],
eventloop: [String: AnyCodable]?)
eventloop: [String: AnyCodable]?,
partial: Bool?,
warnings: [String]?)
{
self.ts = ts
self.channelorder = channelorder
@@ -2926,6 +3374,8 @@ public struct ChannelsStatusResult: Codable, Sendable {
self.channelaccounts = channelaccounts
self.channeldefaultaccountid = channeldefaultaccountid
self.eventloop = eventloop
self.partial = partial
self.warnings = warnings
}
private enum CodingKeys: String, CodingKey {
@@ -2939,6 +3389,8 @@ public struct ChannelsStatusResult: Codable, Sendable {
case channelaccounts = "channelAccounts"
case channeldefaultaccountid = "channelDefaultAccountId"
case eventloop = "eventLoop"
case partial
case warnings
}
}

View File

@@ -0,0 +1,78 @@
import OpenClawKit
public enum OpenClawChatEventText {
public static func assistantText(from event: OpenClawChatEventPayload) -> String? {
self.assistantText(fromMessage: event.message)
}
public static func assistantText(fromMessage message: AnyCodable?) -> String? {
guard let message else { return nil }
return self.assistantText(fromValue: message.value)
}
private static func assistantText(fromValue value: Any) -> String? {
if let text = value as? String {
return self.trimmed(text)
}
guard let object = self.dictionary(from: value) else { return nil }
if let role = self.stringValue(object["role"])?.trimmingCharacters(in: .whitespacesAndNewlines),
!role.isEmpty,
role.lowercased() != "assistant"
{
return nil
}
guard let content = object["content"] else { return nil }
return self.textContent(from: content)
}
private static func textContent(from value: Any) -> String? {
if let text = value as? String {
return self.trimmed(text)
}
let parts: [String] = if let array = value as? [AnyCodable] {
array.compactMap { self.textContentPart(from: $0.value) }
} else if let array = value as? [Any] {
array.compactMap { self.textContentPart(from: $0) }
} else {
self.textContentPart(from: value).map { [$0] } ?? []
}
return self.trimmed(parts.joined(separator: "\n"))
}
private static func textContentPart(from value: Any) -> String? {
if let text = value as? String {
return self.trimmed(text)
}
guard let object = self.dictionary(from: value) else { return nil }
return self.trimmed(self.stringValue(object["text"]) ?? "")
}
private static func dictionary(from value: Any) -> [String: Any]? {
if let dict = value as? [String: AnyCodable] {
return dict.mapValues(\.value)
}
if let dict = value as? [String: Any] {
return dict
}
return nil
}
private static func stringValue(_ value: Any?) -> String? {
if let string = value as? String {
return string
}
if let wrapped = value as? AnyCodable {
return self.stringValue(wrapped.value)
}
return nil
}
private static func trimmed(_ text: String) -> String? {
let trimmed = text.trimmingCharacters(in: .whitespacesAndNewlines)
return trimmed.isEmpty ? nil : trimmed
}
}

View File

@@ -6,6 +6,7 @@ public enum OpenClawCapability: String, Codable, Sendable {
case camera
case screen
case voiceWake
case talk
case location
case device
case watch

View File

@@ -116,7 +116,7 @@ public struct GatewayConnectDeepLink: Codable, Sendable, Equatable {
return nil
}
let tls = payload.tls ?? true
if !tls, !LoopbackHost.isLoopbackHost(host) {
if !tls, !LoopbackHost.isLocalNetworkHost(host) {
return nil
}
return GatewayConnectDeepLink(
@@ -143,7 +143,7 @@ public struct GatewayConnectDeepLink: Codable, Sendable, Equatable {
return nil
}
let tls = scheme == "wss" || scheme == "https"
if !tls, !LoopbackHost.isLoopbackHost(hostname) {
if !tls, !LoopbackHost.isLocalNetworkHost(hostname) {
return nil
}
return GatewayConnectDeepLink(
@@ -254,7 +254,7 @@ public enum DeepLinkParser {
}
let port = query["port"].flatMap { Int($0) } ?? 18789
let tls = (query["tls"] as NSString?)?.boolValue ?? false
if !tls, !LoopbackHost.isLoopbackHost(hostParam) {
if !tls, !LoopbackHost.isLocalNetworkHost(hostParam) {
return nil
}
return .gateway(

View File

@@ -522,7 +522,8 @@ public actor GatewayChannelActor {
(includeDeviceIdentity && explicitPassword == nil && explicitBootstrapToken == nil
? storedToken
: nil)
let authBootstrapToken = authToken == nil ? explicitBootstrapToken : nil
let authBootstrapToken =
authToken == nil && explicitPassword == nil ? explicitBootstrapToken : nil
let authDeviceToken = shouldUseDeviceRetryToken ? storedToken : nil
let authSource: GatewayAuthSource = if authDeviceToken != nil || (explicitToken == nil && authToken != nil) {
.deviceToken

View File

@@ -41,16 +41,32 @@ public enum LoopbackHost {
}
public static func isLocalNetworkHost(_ rawHost: String) -> Bool {
let host = rawHost.trimmingCharacters(in: .whitespacesAndNewlines).lowercased()
let host = self.normalizedHost(rawHost)
guard !host.isEmpty else { return false }
if self.isLoopbackHost(host) { return true }
if host.hasSuffix(".local") { return true }
if host.hasSuffix(".ts.net") { return true }
if host.hasSuffix(".tailscale.net") { return true }
// Allow MagicDNS / LAN hostnames like "peters-mac-studio-1".
if !host.contains("."), !host.contains(":") { return true }
guard let ipv4 = self.parseIPv4(host) else { return false }
return self.isLocalNetworkIPv4(ipv4)
if let ipv4 = self.parseIPv4(host) {
return self.isLocalNetworkIPv4(ipv4)
}
guard let ipv6 = IPv6Address(host) else { return false }
let bytes = Array(ipv6.rawValue)
let isUniqueLocal = (bytes[0] & 0xFE) == 0xFC
let isLinkLocal = bytes[0] == 0xFE && (bytes[1] & 0xC0) == 0x80
return isUniqueLocal || isLinkLocal
}
static func normalizedHost(_ rawHost: String) -> String {
var host = rawHost
.trimmingCharacters(in: .whitespacesAndNewlines)
.lowercased()
.trimmingCharacters(in: CharacterSet(charactersIn: "[]"))
if host.hasSuffix(".") {
host.removeLast()
}
if let zoneIndex = host.firstIndex(of: "%") {
host = String(host[..<zoneIndex])
}
return host
}
static func parseIPv4(_ host: String) -> (UInt8, UInt8, UInt8, UInt8)? {
@@ -73,8 +89,6 @@ public enum LoopbackHost {
if a == 127 { return true }
// 169.254.0.0/16 (link-local)
if a == 169, b == 254 { return true }
// Tailscale: 100.64.0.0/10
if a == 100, (64...127).contains(Int(b)) { return true }
return false
}
}

View File

@@ -1910,6 +1910,7 @@ public struct SessionsCreateParams: Codable, Sendable {
public let label: String?
public let model: String?
public let parentsessionkey: String?
public let emitcommandhooks: Bool?
public let task: String?
public let message: String?
@@ -1919,6 +1920,7 @@ public struct SessionsCreateParams: Codable, Sendable {
label: String?,
model: String?,
parentsessionkey: String?,
emitcommandhooks: Bool?,
task: String?,
message: String?)
{
@@ -1927,6 +1929,7 @@ public struct SessionsCreateParams: Codable, Sendable {
self.label = label
self.model = model
self.parentsessionkey = parentsessionkey
self.emitcommandhooks = emitcommandhooks
self.task = task
self.message = message
}
@@ -1937,6 +1940,7 @@ public struct SessionsCreateParams: Codable, Sendable {
case label
case model
case parentsessionkey = "parentSessionKey"
case emitcommandhooks = "emitCommandHooks"
case task
case message
}
@@ -2630,6 +2634,202 @@ public struct TalkModeParams: Codable, Sendable {
}
}
public struct TalkEvent: Codable, Sendable {
public let id: String
public let type: AnyCodable
public let sessionid: String
public let turnid: String?
public let captureid: String?
public let seq: Int
public let timestamp: String
public let mode: AnyCodable
public let transport: AnyCodable
public let brain: AnyCodable
public let provider: String?
public let final: Bool?
public let callid: String?
public let itemid: String?
public let parentid: String?
public let payload: AnyCodable
public init(
id: String,
type: AnyCodable,
sessionid: String,
turnid: String?,
captureid: String?,
seq: Int,
timestamp: String,
mode: AnyCodable,
transport: AnyCodable,
brain: AnyCodable,
provider: String?,
final: Bool?,
callid: String?,
itemid: String?,
parentid: String?,
payload: AnyCodable)
{
self.id = id
self.type = type
self.sessionid = sessionid
self.turnid = turnid
self.captureid = captureid
self.seq = seq
self.timestamp = timestamp
self.mode = mode
self.transport = transport
self.brain = brain
self.provider = provider
self.final = final
self.callid = callid
self.itemid = itemid
self.parentid = parentid
self.payload = payload
}
private enum CodingKeys: String, CodingKey {
case id
case type
case sessionid = "sessionId"
case turnid = "turnId"
case captureid = "captureId"
case seq
case timestamp
case mode
case transport
case brain
case provider
case final
case callid = "callId"
case itemid = "itemId"
case parentid = "parentId"
case payload
}
}
public struct TalkCatalogParams: Codable, Sendable {}
public struct TalkCatalogResult: Codable, Sendable {
public let modes: [AnyCodable]
public let transports: [AnyCodable]
public let brains: [AnyCodable]
public let speech: [String: AnyCodable]
public let transcription: [String: AnyCodable]
public let realtime: [String: AnyCodable]
public init(
modes: [AnyCodable],
transports: [AnyCodable],
brains: [AnyCodable],
speech: [String: AnyCodable],
transcription: [String: AnyCodable],
realtime: [String: AnyCodable])
{
self.modes = modes
self.transports = transports
self.brains = brains
self.speech = speech
self.transcription = transcription
self.realtime = realtime
}
private enum CodingKeys: String, CodingKey {
case modes
case transports
case brains
case speech
case transcription
case realtime
}
}
public struct TalkClientCreateParams: Codable, Sendable {
public let sessionkey: String?
public let provider: String?
public let model: String?
public let voice: String?
public let mode: AnyCodable?
public let transport: AnyCodable?
public let brain: AnyCodable?
public init(
sessionkey: String?,
provider: String?,
model: String?,
voice: String?,
mode: AnyCodable?,
transport: AnyCodable?,
brain: AnyCodable?)
{
self.sessionkey = sessionkey
self.provider = provider
self.model = model
self.voice = voice
self.mode = mode
self.transport = transport
self.brain = brain
}
private enum CodingKeys: String, CodingKey {
case sessionkey = "sessionKey"
case provider
case model
case voice
case mode
case transport
case brain
}
}
public struct TalkClientToolCallParams: Codable, Sendable {
public let sessionkey: String
public let callid: String
public let name: String
public let args: AnyCodable?
public let relaysessionid: String?
public init(
sessionkey: String,
callid: String,
name: String,
args: AnyCodable?,
relaysessionid: String?)
{
self.sessionkey = sessionkey
self.callid = callid
self.name = name
self.args = args
self.relaysessionid = relaysessionid
}
private enum CodingKeys: String, CodingKey {
case sessionkey = "sessionKey"
case callid = "callId"
case name
case args
case relaysessionid = "relaySessionId"
}
}
public struct TalkClientToolCallResult: Codable, Sendable {
public let runid: String
public let idempotencykey: String
public init(
runid: String,
idempotencykey: String)
{
self.runid = runid
self.idempotencykey = idempotencykey
}
private enum CodingKeys: String, CodingKey {
case runid = "runId"
case idempotencykey = "idempotencyKey"
}
}
public struct TalkConfigParams: Codable, Sendable {
public let includesecrets: Bool?
@@ -2658,22 +2858,100 @@ public struct TalkConfigResult: Codable, Sendable {
}
}
public struct TalkRealtimeSessionParams: Codable, Sendable {
public struct TalkSessionAppendAudioParams: Codable, Sendable {
public let sessionid: String
public let audiobase64: String
public let timestamp: Double?
public init(
sessionid: String,
audiobase64: String,
timestamp: Double?)
{
self.sessionid = sessionid
self.audiobase64 = audiobase64
self.timestamp = timestamp
}
private enum CodingKeys: String, CodingKey {
case sessionid = "sessionId"
case audiobase64 = "audioBase64"
case timestamp
}
}
public struct TalkSessionCancelOutputParams: Codable, Sendable {
public let sessionid: String
public let turnid: String?
public let reason: String?
public init(
sessionid: String,
turnid: String?,
reason: String?)
{
self.sessionid = sessionid
self.turnid = turnid
self.reason = reason
}
private enum CodingKeys: String, CodingKey {
case sessionid = "sessionId"
case turnid = "turnId"
case reason
}
}
public struct TalkSessionCancelTurnParams: Codable, Sendable {
public let sessionid: String
public let turnid: String?
public let reason: String?
public init(
sessionid: String,
turnid: String?,
reason: String?)
{
self.sessionid = sessionid
self.turnid = turnid
self.reason = reason
}
private enum CodingKeys: String, CodingKey {
case sessionid = "sessionId"
case turnid = "turnId"
case reason
}
}
public struct TalkSessionCreateParams: Codable, Sendable {
public let sessionkey: String?
public let provider: String?
public let model: String?
public let voice: String?
public let mode: AnyCodable?
public let transport: AnyCodable?
public let brain: AnyCodable?
public let ttlms: Int?
public init(
sessionkey: String?,
provider: String?,
model: String?,
voice: String?)
voice: String?,
mode: AnyCodable?,
transport: AnyCodable?,
brain: AnyCodable?,
ttlms: Int?)
{
self.sessionkey = sessionkey
self.provider = provider
self.model = model
self.voice = voice
self.mode = mode
self.transport = transport
self.brain = brain
self.ttlms = ttlms
}
private enum CodingKeys: String, CodingKey {
@@ -2681,86 +2959,252 @@ public struct TalkRealtimeSessionParams: Codable, Sendable {
case provider
case model
case voice
case mode
case transport
case brain
case ttlms = "ttlMs"
}
}
public struct TalkRealtimeRelayAudioParams: Codable, Sendable {
public let relaysessionid: String
public let audiobase64: String
public let timestamp: Double?
public struct TalkSessionCreateResult: Codable, Sendable {
public let sessionid: String
public let provider: String?
public let mode: AnyCodable
public let transport: AnyCodable
public let brain: AnyCodable
public let relaysessionid: String?
public let transcriptionsessionid: String?
public let handoffid: String?
public let roomid: String?
public let roomurl: String?
public let token: String?
public let audio: AnyCodable?
public let model: String?
public let voice: String?
public let expiresat: Double?
public init(
relaysessionid: String,
audiobase64: String,
timestamp: Double?)
sessionid: String,
provider: String?,
mode: AnyCodable,
transport: AnyCodable,
brain: AnyCodable,
relaysessionid: String?,
transcriptionsessionid: String?,
handoffid: String?,
roomid: String?,
roomurl: String?,
token: String?,
audio: AnyCodable?,
model: String?,
voice: String?,
expiresat: Double?)
{
self.sessionid = sessionid
self.provider = provider
self.mode = mode
self.transport = transport
self.brain = brain
self.relaysessionid = relaysessionid
self.audiobase64 = audiobase64
self.timestamp = timestamp
self.transcriptionsessionid = transcriptionsessionid
self.handoffid = handoffid
self.roomid = roomid
self.roomurl = roomurl
self.token = token
self.audio = audio
self.model = model
self.voice = voice
self.expiresat = expiresat
}
private enum CodingKeys: String, CodingKey {
case sessionid = "sessionId"
case provider
case mode
case transport
case brain
case relaysessionid = "relaySessionId"
case audiobase64 = "audioBase64"
case timestamp
case transcriptionsessionid = "transcriptionSessionId"
case handoffid = "handoffId"
case roomid = "roomId"
case roomurl = "roomUrl"
case token
case audio
case model
case voice
case expiresat = "expiresAt"
}
}
public struct TalkRealtimeRelayMarkParams: Codable, Sendable {
public let relaysessionid: String
public let markname: String?
public struct TalkSessionJoinParams: Codable, Sendable {
public let sessionid: String
public let token: String
public init(
relaysessionid: String,
markname: String?)
sessionid: String,
token: String)
{
self.relaysessionid = relaysessionid
self.markname = markname
self.sessionid = sessionid
self.token = token
}
private enum CodingKeys: String, CodingKey {
case relaysessionid = "relaySessionId"
case markname = "markName"
case sessionid = "sessionId"
case token
}
}
public struct TalkRealtimeRelayStopParams: Codable, Sendable {
public let relaysessionid: String
public struct TalkSessionJoinResult: Codable, Sendable {
public let id: String
public let roomid: String
public let roomurl: String
public let sessionkey: String
public let sessionid: String?
public let channel: String?
public let target: String?
public let provider: String?
public let model: String?
public let voice: String?
public let mode: AnyCodable
public let transport: AnyCodable
public let brain: AnyCodable
public let createdat: Double
public let expiresat: Double
public let room: [String: AnyCodable]
public init(
relaysessionid: String)
id: String,
roomid: String,
roomurl: String,
sessionkey: String,
sessionid: String?,
channel: String?,
target: String?,
provider: String?,
model: String?,
voice: String?,
mode: AnyCodable,
transport: AnyCodable,
brain: AnyCodable,
createdat: Double,
expiresat: Double,
room: [String: AnyCodable])
{
self.relaysessionid = relaysessionid
self.id = id
self.roomid = roomid
self.roomurl = roomurl
self.sessionkey = sessionkey
self.sessionid = sessionid
self.channel = channel
self.target = target
self.provider = provider
self.model = model
self.voice = voice
self.mode = mode
self.transport = transport
self.brain = brain
self.createdat = createdat
self.expiresat = expiresat
self.room = room
}
private enum CodingKeys: String, CodingKey {
case relaysessionid = "relaySessionId"
case id
case roomid = "roomId"
case roomurl = "roomUrl"
case sessionkey = "sessionKey"
case sessionid = "sessionId"
case channel
case target
case provider
case model
case voice
case mode
case transport
case brain
case createdat = "createdAt"
case expiresat = "expiresAt"
case room
}
}
public struct TalkRealtimeRelayToolResultParams: Codable, Sendable {
public let relaysessionid: String
public struct TalkSessionTurnParams: Codable, Sendable {
public let sessionid: String
public let turnid: String?
public init(
sessionid: String,
turnid: String?)
{
self.sessionid = sessionid
self.turnid = turnid
}
private enum CodingKeys: String, CodingKey {
case sessionid = "sessionId"
case turnid = "turnId"
}
}
public struct TalkSessionTurnResult: Codable, Sendable {
public let ok: Bool
public let turnid: String?
public let events: [TalkEvent]?
public init(
ok: Bool,
turnid: String?,
events: [TalkEvent]?)
{
self.ok = ok
self.turnid = turnid
self.events = events
}
private enum CodingKeys: String, CodingKey {
case ok
case turnid = "turnId"
case events
}
}
public struct TalkSessionSubmitToolResultParams: Codable, Sendable {
public let sessionid: String
public let callid: String
public let result: AnyCodable
public init(
relaysessionid: String,
sessionid: String,
callid: String,
result: AnyCodable)
{
self.relaysessionid = relaysessionid
self.sessionid = sessionid
self.callid = callid
self.result = result
}
private enum CodingKeys: String, CodingKey {
case relaysessionid = "relaySessionId"
case sessionid = "sessionId"
case callid = "callId"
case result
}
}
public struct TalkRealtimeRelayOkResult: Codable, Sendable {
public struct TalkSessionCloseParams: Codable, Sendable {
public let sessionid: String
public init(
sessionid: String)
{
self.sessionid = sessionid
}
private enum CodingKeys: String, CodingKey {
case sessionid = "sessionId"
}
}
public struct TalkSessionOkResult: Codable, Sendable {
public let ok: Bool
public init(
@@ -2903,6 +3347,8 @@ public struct ChannelsStatusResult: Codable, Sendable {
public let channelaccounts: [String: AnyCodable]
public let channeldefaultaccountid: [String: AnyCodable]
public let eventloop: [String: AnyCodable]?
public let partial: Bool?
public let warnings: [String]?
public init(
ts: Int,
@@ -2914,7 +3360,9 @@ public struct ChannelsStatusResult: Codable, Sendable {
channels: [String: AnyCodable],
channelaccounts: [String: AnyCodable],
channeldefaultaccountid: [String: AnyCodable],
eventloop: [String: AnyCodable]?)
eventloop: [String: AnyCodable]?,
partial: Bool?,
warnings: [String]?)
{
self.ts = ts
self.channelorder = channelorder
@@ -2926,6 +3374,8 @@ public struct ChannelsStatusResult: Codable, Sendable {
self.channelaccounts = channelaccounts
self.channeldefaultaccountid = channeldefaultaccountid
self.eventloop = eventloop
self.partial = partial
self.warnings = warnings
}
private enum CodingKeys: String, CodingKey {
@@ -2939,6 +3389,8 @@ public struct ChannelsStatusResult: Codable, Sendable {
case channelaccounts = "channelAccounts"
case channeldefaultaccountid = "channelDefaultAccountId"
case eventloop = "eventLoop"
case partial
case warnings
}
}

View File

@@ -0,0 +1,50 @@
import OpenClawKit
import Testing
@testable import OpenClawChatUI
struct ChatEventTextTests {
@Test func `extracts assistant text from final chat event message`() {
let event = OpenClawChatEventPayload(
runId: "run-1",
sessionKey: "main",
state: "final",
message: AnyCodable([
"role": "assistant",
"content": [
["type": "text", "text": "hello"],
["type": "text", "text": "world"],
],
]),
errorMessage: nil)
#expect(OpenClawChatEventText.assistantText(from: event) == "hello\nworld")
}
@Test func `ignores user messages`() {
let event = OpenClawChatEventPayload(
runId: "run-1",
sessionKey: "main",
state: "delta",
message: AnyCodable([
"role": "user",
"content": [["type": "text", "text": "ignore me"]],
]),
errorMessage: nil)
#expect(OpenClawChatEventText.assistantText(from: event) == nil)
}
@Test func `extracts plain string content`() {
let event = OpenClawChatEventPayload(
runId: "run-1",
sessionKey: "main",
state: "final",
message: AnyCodable([
"role": "assistant",
"content": "plain reply",
]),
errorMessage: nil)
#expect(OpenClawChatEventText.assistantText(from: event) == "plain reply")
}
}

View File

@@ -59,6 +59,40 @@ private func setupCode(from payload: String) -> String {
password: nil))
}
@Test func setupCodeAllowsPrivateLanWs() {
let payload = #"{"url":"ws://192.168.1.20:18789","bootstrapToken":"tok"}"#
#expect(
GatewayConnectDeepLink.fromSetupCode(setupCode(from: payload)) == .init(
host: "192.168.1.20",
port: 18789,
tls: false,
bootstrapToken: "tok",
token: nil,
password: nil))
}
@Test func setupCodeAllowsMDNSWs() {
let payload = #"{"url":"ws://openclaw.local:18789","bootstrapToken":"tok"}"#
#expect(
GatewayConnectDeepLink.fromSetupCode(setupCode(from: payload)) == .init(
host: "openclaw.local",
port: 18789,
tls: false,
bootstrapToken: "tok",
token: nil,
password: nil))
}
@Test func setupCodeRejectsTailnetPlaintextWs() {
let payload = #"{"url":"ws://gateway.tailnet.ts.net:18789","bootstrapToken":"tok"}"#
#expect(GatewayConnectDeepLink.fromSetupCode(setupCode(from: payload)) == nil)
}
@Test func setupCodeRejectsCgnatPlaintextWs() {
let payload = #"{"url":"ws://100.64.0.9:18789","bootstrapToken":"tok"}"#
#expect(GatewayConnectDeepLink.fromSetupCode(setupCode(from: payload)) == nil)
}
@Test func setupCodeParsesHostPayload() {
let payload = #"{"host":"gateway.tailnet.ts.net","port":443,"tls":true,"bootstrapToken":"tok"}"#
#expect(
@@ -88,6 +122,18 @@ private func setupCode(from payload: String) -> String {
#expect(GatewayConnectDeepLink.fromSetupCode(setupCode(from: payload)) == nil)
}
@Test func setupCodeAllowsPrivateLanHostPayload() {
let payload = #"{"host":"openclaw.local","port":18789,"tls":false,"bootstrapToken":"tok"}"#
#expect(
GatewayConnectDeepLink.fromSetupCode(setupCode(from: payload)) == .init(
host: "openclaw.local",
port: 18789,
tls: false,
bootstrapToken: "tok",
token: nil,
password: nil))
}
@Test func setupInputParsesFullCopiedSetupMessage() {
let payload = #"{"url":"wss://gateway.tailnet.ts.net","bootstrapToken":"tok"}"#
let message = """

View File

@@ -249,6 +249,42 @@ struct GatewayNodeSessionTests {
await gateway.disconnect()
}
@Test
func passwordTakesPrecedenceOverBootstrapToken() async throws {
let session = FakeGatewayWebSocketSession()
let gateway = GatewayNodeSession()
let options = GatewayConnectOptions(
role: "operator",
scopes: ["operator.read"],
caps: [],
commands: [],
permissions: [:],
clientId: "openclaw-ios-test",
clientMode: "ui",
clientDisplayName: "iOS Test",
includeDeviceIdentity: false)
try await gateway.connect(
url: URL(string: "ws://example.invalid")!,
token: nil,
bootstrapToken: "stale-bootstrap-token",
password: "shared-password",
connectOptions: options,
sessionBox: WebSocketSessionBox(session: session),
onConnected: {},
onDisconnected: { _ in },
onInvoke: { req in
BridgeInvokeResponse(id: req.id, ok: true, payloadJSON: nil, error: nil)
})
let auth = try #require(session.latestTask()?.latestConnectAuth())
#expect(auth["password"] as? String == "shared-password")
#expect(auth["bootstrapToken"] == nil)
#expect(auth["token"] == nil)
await gateway.disconnect()
}
@Test
func bootstrapHelloStoresAdditionalDeviceTokens() async throws {
let tempDir = FileManager.default.temporaryDirectory

View File

@@ -74,6 +74,7 @@ const rootBundledPluginRuntimeDependencies = [
const config = {
ignoreFiles: [
"scripts/**",
"packages/*/dist/**",
"**/__tests__/**",
"src/test-utils/**",
"**/test-helpers/**",
@@ -134,6 +135,7 @@ const config = {
bundledPluginFile("msteams", "src/polls-store-memory.ts"),
bundledPluginFile("voice-call", "src/providers/index.ts"),
],
ignore: ["packages/*/dist/**"],
workspaces: {
".": {
entry: rootEntries,
@@ -155,6 +157,10 @@ const config = {
entry: ["index.html!", "src/main.ts!", "vite.config.ts!", "vitest*.ts!"],
project: ["src/**/*.{ts,tsx}!"],
},
"packages/sdk": {
entry: ["src/index.ts!"],
project: ["src/**/*.ts!"],
},
"packages/*": {
entry: ["index.js!", "scripts/postinstall.js!"],
project: ["index.js!", "scripts/**/*.js!"],

View File

@@ -1,4 +1,4 @@
c93176f87a1e4576f5951b82037394c4bc9628bb6e056b6b24f96e662d6d636c config-baseline.json
92cbb12ca382f7424e7bd52df21798b10a57621f5c266909fa74e23f6cb973d7 config-baseline.core.json
5dd302a20b8a6347425617323d0ad7875f9b7631acd3ed3935cfaaf7708a32dd config-baseline.json
d192d678668712b81cc2e76ddcb6420893ab5144944ccb830b290019d6a717a4 config-baseline.core.json
cd7c0c7fb1435bc7e59099e9ac334462d5ad444016e9ab4512aae63a238f78dc config-baseline.channel.json
6871e789b74722e4ff2c877940dac256c232433ae26b305fc6ca782b90662097 config-baseline.plugin.json

View File

@@ -1,2 +1,2 @@
fe061b6f35adb2b152d8f48244a94d4934b335143cc5f5aebb8cc96e5ba8b287 plugin-sdk-api-baseline.json
495248d5981456192aaf7da2ed23d5951eaa6d9e59d70c716ab91c3da3620e73 plugin-sdk-api-baseline.jsonl
ce3eef3355f00b88eba1dd54731f932a1ffff9dee64cb19402d7d89b2c363681 plugin-sdk-api-baseline.json
28eb08edb11108d80ec5d5bd12c97108495b064a4d6dd5ca3ecc01d12c2d4c42 plugin-sdk-api-baseline.jsonl

View File

@@ -35,6 +35,10 @@
"source": "Channel message API",
"target": "频道消息 API"
},
{
"source": "Talk mode",
"target": "Talk 模式"
},
{
"source": "Azure Speech",
"target": "Azure Speech"
@@ -59,6 +63,10 @@
"source": "Gateway RPC reference",
"target": "Gateway RPC 参考"
},
{
"source": "Secure file operations",
"target": "安全文件操作"
},
{
"source": "Sessions",
"target": "会话"
@@ -575,6 +583,14 @@
"source": "Manage plugins",
"target": "管理插件"
},
{
"source": "Plugin path ownership",
"target": "插件路径所有权"
},
{
"source": "Docker permissions",
"target": "Docker 权限"
},
{
"source": "Plugin manifest",
"target": "插件清单"
@@ -758,5 +774,9 @@
{
"source": "/cli/config",
"target": "/cli/config"
},
{
"source": "fs-safe Cleanup Plan",
"target": "fs-safe Cleanup Plan"
}
]

View File

@@ -4,7 +4,7 @@ read_when:
- Deciding how to automate work with OpenClaw
- Choosing between heartbeat, cron, commitments, hooks, and standing orders
- Looking for the right automation entry point
title: "Automation & tasks"
title: "Automation and tasks"
---
OpenClaw runs work in the background through tasks, scheduled jobs, inferred

View File

@@ -7,7 +7,7 @@ read_when:
title: "Standing orders"
---
Standing orders grant your agent **permanent operating authority** for defined programs. Instead of giving individual task instructions each time, you define programs with clear scope, triggers, and escalation rules and the agent executes autonomously within those boundaries.
Standing orders grant your agent **permanent operating authority** for defined programs. Instead of giving individual task instructions each time, you define programs with clear scope, triggers, and escalation rules - and the agent executes autonomously within those boundaries.
This is the difference between telling your assistant "send the weekly report" every Friday vs. granting standing authority: "You own the weekly report. Compile it every Friday, send it, and only escalate if something looks wrong."
@@ -33,15 +33,15 @@ Standing orders are defined in your [agent workspace](/concepts/agent-workspace)
Each program specifies:
1. **Scope** what the agent is authorized to do
2. **Triggers** when to execute (schedule, event, or condition)
3. **Approval gates** what requires human sign-off before acting
4. **Escalation rules** when to stop and ask for help
1. **Scope** - what the agent is authorized to do
2. **Triggers** - when to execute (schedule, event, or condition)
3. **Approval gates** - what requires human sign-off before acting
4. **Escalation rules** - when to stop and ask for help
The agent loads these instructions every session via the workspace bootstrap files (see [Agent Workspace](/concepts/agent-workspace) for the full list of auto-injected files) and executes against them, combined with [cron jobs](/automation/cron-jobs) for time-based enforcement.
<Tip>
Put standing orders in `AGENTS.md` to guarantee they're loaded every session. The workspace bootstrap automatically injects `AGENTS.md`, `SOUL.md`, `TOOLS.md`, `IDENTITY.md`, `USER.md`, `HEARTBEAT.md`, `BOOTSTRAP.md`, and `MEMORY.md` but not arbitrary files in subdirectories.
Put standing orders in `AGENTS.md` to guarantee they're loaded every session. The workspace bootstrap automatically injects `AGENTS.md`, `SOUL.md`, `TOOLS.md`, `IDENTITY.md`, `USER.md`, `HEARTBEAT.md`, `BOOTSTRAP.md`, and `MEMORY.md` - but not arbitrary files in subdirectories.
</Tip>
## Anatomy of a standing order
@@ -66,7 +66,7 @@ Put standing orders in `AGENTS.md` to guarantee they're loaded every session. Th
- Do not send reports to external parties
- Do not modify source data
- Do not skip delivery if metrics look bad report accurately
- Do not skip delivery if metrics look bad - report accurately
```
## Standing orders plus cron jobs
@@ -109,7 +109,7 @@ openclaw cron add \
### Weekly cycle
- **Monday:** Review platform metrics and audience engagement
- **TuesdayThursday:** Draft social posts, create blog content
- **Tuesday-Thursday:** Draft social posts, create blog content
- **Friday:** Compile weekly marketing brief → deliver to owner
### Content rules
@@ -176,9 +176,9 @@ openclaw cron add \
Standing orders work best when combined with strict execution discipline. Every task in a standing order should follow this loop:
1. **Execute** Do the actual work (don't just acknowledge the instruction)
2. **Verify** Confirm the result is correct (file exists, message delivered, data parsed)
3. **Report** Tell the owner what was done and what was verified
1. **Execute** - Do the actual work (don't just acknowledge the instruction)
2. **Verify** - Confirm the result is correct (file exists, message delivered, data parsed)
3. **Report** - Tell the owner what was done and what was verified
```markdown
### Execution rules
@@ -188,7 +188,7 @@ Standing orders work best when combined with strict execution discipline. Every
- "Done" without verification is not acceptable. Prove it.
- If execution fails: retry once with adjusted approach.
- If still fails: report failure with diagnosis. Never silently fail.
- Never retry indefinitely 3 attempts max, then escalate.
- Never retry indefinitely - 3 attempts max, then escalate.
```
This pattern prevents the most common agent failure mode: acknowledging a task without completing it.
@@ -228,18 +228,18 @@ Each program should have:
- Start with narrow authority and expand as trust builds
- Define explicit approval gates for high-risk actions
- Include "What NOT to do" sections boundaries matter as much as permissions
- Include "What NOT to do" sections - boundaries matter as much as permissions
- Combine with cron jobs for reliable time-based execution
- Review agent logs weekly to verify standing orders are being followed
- Update standing orders as your needs evolve they're living documents
- Update standing orders as your needs evolve - they're living documents
### Avoid
- Grant broad authority on day one ("do whatever you think is best")
- Skip escalation rules every program needs a "when to stop and ask" clause
- Assume the agent will remember verbal instructions put everything in the file
- Mix concerns in a single program separate programs for separate domains
- Forget to enforce with cron jobs standing orders without triggers become suggestions
- Skip escalation rules - every program needs a "when to stop and ask" clause
- Assume the agent will remember verbal instructions - put everything in the file
- Mix concerns in a single program - separate programs for separate domains
- Forget to enforce with cron jobs - standing orders without triggers become suggestions
## Related

View File

@@ -14,7 +14,7 @@ Looking for scheduling? See [Automation and tasks](/automation) for choosing the
Background tasks track work that runs **outside your main conversation session**: ACP runs, subagent spawns, isolated cron job executions, and CLI-initiated operations.
Tasks do **not** replace sessions, cron jobs, or heartbeats they are the **activity ledger** that records what detached work happened, when, and whether it succeeded.
Tasks do **not** replace sessions, cron jobs, or heartbeats - they are the **activity ledger** that records what detached work happened, when, and whether it succeeded.
<Note>
Not every agent run creates a task. Heartbeat turns and normal interactive chat do not. All cron executions, ACP spawns, subagent spawns, and CLI agent commands do.
@@ -22,7 +22,7 @@ Not every agent run creates a task. Heartbeat turns and normal interactive chat
## TL;DR
- Tasks are **records**, not schedulers cron and heartbeat decide _when_ work runs, tasks track _what happened_.
- 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; if the
@@ -100,7 +100,7 @@ Not every agent run creates a task. Heartbeat turns and normal interactive chat
<AccordionGroup>
<Accordion title="Notify defaults for cron and media">
Main-session cron tasks use `silent` notify policy by default they create records for tracking but do not generate notifications. Isolated cron tasks also default to `silent` but are more visible because they run in their own session.
Main-session cron tasks use `silent` notify policy by default - they create records for tracking but do not generate notifications. Isolated cron tasks also default to `silent` but are more visible because they run in their own session.
Session-backed `music_generate` and `video_generate` runs also use `silent` notify policy. They still create task records, but completion is handed back to the original agent session as an internal wake so the agent can write the follow-up message and attach the finished media itself. Group/channel completions follow the normal visible-reply policy, so the agent uses the message tool when source delivery requires it. If the completion agent fails to produce message-tool delivery evidence in a tool-only route, OpenClaw sends the completion fallback directly to the original channel instead of leaving the media private.
@@ -109,7 +109,7 @@ Not every agent run creates a task. Heartbeat turns and normal interactive chat
While a session-backed `video_generate` task is still active, the tool also acts as a guardrail: repeated `video_generate` calls in that same session return the active task status instead of starting a second concurrent generation. Use `action: "status"` when you want an explicit progress/status lookup from the agent side.
</Accordion>
<Accordion title="What does not create tasks">
- Heartbeat turns main-session; see [Heartbeat](/gateway/heartbeat)
- Heartbeat turns - main-session; see [Heartbeat](/gateway/heartbeat)
- Normal interactive chat turns
- Direct `/command` responses
@@ -140,7 +140,7 @@ stateDiagram-v2
| `cancelled` | Stopped by the operator via `openclaw tasks cancel` |
| `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.
Transitions happen automatically - when the associated agent run ends, the task status updates to match.
Agent run completion is authoritative for active task records. A successful detached run finalizes as `succeeded`, ordinary run errors finalize as `failed`, and timeout or abort outcomes finalize as `timed_out`. If an operator already cancelled the task, or the runtime already recorded a stronger terminal state such as `failed`, `timed_out`, or `lost`, a later success signal does not downgrade that terminal status.
@@ -161,12 +161,12 @@ Agent run completion is authoritative for active task records. A successful deta
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.). 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.
**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.
**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.
<Tip>
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.
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.
@@ -177,7 +177,7 @@ Control how much you hear about each task:
| Policy | What is delivered |
| --------------------- | ----------------------------------------------------------------------- |
| `done_only` (default) | Only terminal state (succeeded, failed, etc.) **this is the default** |
| `done_only` (default) | Only terminal state (succeeded, failed, etc.) - **this is the default** |
| `state_changes` | Every state transition and progress update |
| `silent` | Nothing at all |
@@ -290,9 +290,9 @@ Tasks: 3 queued · 2 running · 1 issues
The summary reports:
- **active** count of `queued` + `running`
- **failures** count of `failed` + `timed_out` + `lost`
- **byRuntime** breakdown by `acp`, `subagent`, `cron`, `cli`
- **active** - count of `queued` + `running`
- **failures** - count of `failed` + `timed_out` + `lost`
- **byRuntime** - breakdown by `acp`, `subagent`, `cron`, `cli`
Both `/status` and the `session_status` tool use a cleanup-aware task snapshot: active tasks are preferred, stale completed rows are hidden, and recent failures only surface when no active work remains. This keeps the status card focused on what matters right now.
@@ -343,13 +343,13 @@ A sweeper runs every **60 seconds** and handles four things:
</Accordion>
<Accordion title="Tasks and cron">
A cron job **definition** lives in `~/.openclaw/cron/jobs.json`; runtime execution state lives beside it in `~/.openclaw/cron/jobs-state.json`. **Every** cron execution creates a task record both main-session and isolated. Main-session cron tasks default to `silent` notify policy so they track without generating notifications.
A cron job **definition** lives in `~/.openclaw/cron/jobs.json`; runtime execution state lives beside it in `~/.openclaw/cron/jobs-state.json`. **Every** cron execution creates a task record - both main-session and isolated. Main-session cron tasks default to `silent` notify policy so they track without generating notifications.
See [Cron Jobs](/automation/cron-jobs).
</Accordion>
<Accordion title="Tasks and heartbeat">
Heartbeat runs are main-session turns they do not create task records. When a task completes, it can trigger a heartbeat wake so you see the result promptly.
Heartbeat runs are main-session turns - they do not create task records. When a task completes, it can trigger a heartbeat wake so you see the result promptly.
See [Heartbeat](/gateway/heartbeat).
@@ -358,14 +358,14 @@ A sweeper runs every **60 seconds** and handles four things:
A task may reference a `childSessionKey` (where work runs) and a `requesterSessionKey` (who started it). Sessions are conversation context; tasks are activity tracking on top of that.
</Accordion>
<Accordion title="Tasks and agent runs">
A task's `runId` links to the agent run doing the work. Agent lifecycle events (start, end, error) automatically update the task status you do not need to manage the lifecycle manually.
A task's `runId` links to the agent run doing the work. Agent lifecycle events (start, end, error) automatically update the task status - you do not need to manage the lifecycle manually.
</Accordion>
</AccordionGroup>
## Related
- [Automation & Tasks](/automation) all automation mechanisms at a glance
- [CLI: Tasks](/cli/tasks) CLI command reference
- [Heartbeat](/gateway/heartbeat) periodic main-session turns
- [Scheduled Tasks](/automation/cron-jobs) scheduling background work
- [Task Flow](/automation/taskflow) flow orchestration above tasks
- [Automation & Tasks](/automation) - all automation mechanisms at a glance
- [CLI: Tasks](/cli/tasks) - CLI command reference
- [Heartbeat](/gateway/heartbeat) - periodic main-session turns
- [Scheduled Tasks](/automation/cron-jobs) - scheduling background work
- [Task Flow](/automation/taskflow) - flow orchestration above tasks

View File

@@ -381,7 +381,7 @@ BlueBubbles supports advanced message actions when enabled in config:
- **reply**: Reply to a specific message (`messageId`, `text`, `to`).
- **sendWithEffect**: Send with iMessage effect (`text`, `to`, `effectId`).
- **renameGroup**: Rename a group chat (`chatGuid`, `displayName`).
- **setGroupIcon**: Set a group chat's icon/photo (`chatGuid`, `media`) flaky on macOS 26 Tahoe (API may return success but the icon does not sync).
- **setGroupIcon**: Set a group chat's icon/photo (`chatGuid`, `media`) - flaky on macOS 26 Tahoe (API may return success but the icon does not sync).
- **addParticipant**: Add someone to a group (`chatGuid`, `address`).
- **removeParticipant**: Remove someone from a group (`chatGuid`, `address`).
- **leaveGroup**: Leave a group chat (`chatGuid`).
@@ -412,12 +412,12 @@ See [Configuration](/gateway/configuration) for template variables.
## Coalescing split-send DMs (command + URL in one composition)
When a user types a command and a URL together in iMessage e.g. `Dump https://example.com/article` Apple splits the send into **two separate webhook deliveries**:
When a user types a command and a URL together in iMessage - e.g. `Dump https://example.com/article` - Apple splits the send into **two separate webhook deliveries**:
1. A text message (`"Dump"`).
2. A URL-preview balloon (`"https://..."`) with OG-preview images as attachments.
The two webhooks arrive at OpenClaw ~0.8-2.0 s apart on most setups. Without coalescing, the agent receives the command alone on turn 1, replies (often "send me the URL"), and only sees the URL on turn 2 at which point the command context is already lost.
The two webhooks arrive at OpenClaw ~0.8-2.0 s apart on most setups. Without coalescing, the agent receives the command alone on turn 1, replies (often "send me the URL"), and only sees the URL on turn 2 - at which point the command context is already lost.
`channels.bluebubbles.coalesceSameSenderDms` opts a DM into merging consecutive same-sender webhooks into a single agent turn. Group chats continue to key per-message so multi-user turn structure is preserved.
@@ -446,7 +446,7 @@ The two webhooks arrive at OpenClaw ~0.8-2.0 s apart on most setups. Without coa
}
```
With the flag on and no explicit `messages.inbound.byChannel.bluebubbles`, the debounce window widens to **2500 ms** (the default for non-coalescing is 500 ms). The wider window is required Apple's split-send cadence of 0.8-2.0 s does not fit in the tighter default.
With the flag on and no explicit `messages.inbound.byChannel.bluebubbles`, the debounce window widens to **2500 ms** (the default for non-coalescing is 500 ms). The wider window is required - Apple's split-send cadence of 0.8-2.0 s does not fit in the tighter default.
To tune the window yourself:
@@ -467,7 +467,7 @@ The two webhooks arrive at OpenClaw ~0.8-2.0 s apart on most setups. Without coa
</Tab>
<Tab title="Trade-offs">
- **Added latency for DM control commands.** With the flag on, DM control-command messages (like `Dump`, `Save`, etc.) now wait up to the debounce window before dispatching, in case a payload webhook is coming. Group-chat commands keep instant dispatch.
- **Merged output is bounded** merged text caps at 4000 chars with an explicit `…[truncated]` marker; attachments cap at 20; source entries cap at 10 (first-plus-latest retained beyond that). Every source `messageId` still reaches inbound-dedupe so a later MessagePoller replay of any individual event is recognized as a duplicate.
- **Merged output is bounded** - merged text caps at 4000 chars with an explicit `…[truncated]` marker; attachments cap at 20; source entries cap at 10 (first-plus-latest retained beyond that). Every source `messageId` still reaches inbound-dedupe so a later MessagePoller replay of any individual event is recognized as a duplicate.
- **Opt-in, per-channel.** Other channels (Telegram, WhatsApp, Slack, …) are unaffected.
</Tab>
@@ -494,7 +494,7 @@ If the flag is on and split-sends still arrive as two turns, check each layer:
grep coalesceSameSenderDms ~/.openclaw/openclaw.json
```
Then `openclaw gateway restart` the flag is read at debouncer-registry creation.
Then `openclaw gateway restart` - the flag is read at debouncer-registry creation.
</Accordion>
<Accordion title="Debounce window wide enough for your setup">
@@ -508,13 +508,13 @@ If the flag is on and split-sends still arrive as two turns, check each layer:
</Accordion>
<Accordion title="Session JSONL timestamps ≠ webhook arrival">
Session event timestamps (`~/.openclaw/agents/<id>/sessions/*.jsonl`) reflect when the gateway hands a message to the agent, **not** when the webhook arrived. A queued-second message tagged `[Queued messages while agent was busy]` means the first turn was still running when the second webhook arrived the coalesce bucket had already flushed. Tune the window against the BB server log, not the session log.
Session event timestamps (`~/.openclaw/agents/<id>/sessions/*.jsonl`) reflect when the gateway hands a message to the agent, **not** when the webhook arrived. A queued-second message tagged `[Queued messages while agent was busy]` means the first turn was still running when the second webhook arrived - the coalesce bucket had already flushed. Tune the window against the BB server log, not the session log.
</Accordion>
<Accordion title="Memory pressure slowing reply dispatch">
On smaller machines (8 GB), agent turns can take long enough that the coalesce bucket flushes before the reply completes, and the URL lands as a queued second turn. Check `memory_pressure` and `ps -o rss -p $(pgrep openclaw-gateway)`; if the gateway is over ~500 MB RSS and the compressor is active, close other heavy processes or bump to a larger host.
</Accordion>
<Accordion title="Reply-quote sends are a different path">
If the user tapped `Dump` as a **reply** to an existing URL-balloon (iMessage shows a "1 Reply" badge on the Dump bubble), the URL lives in `replyToBody`, not in a second webhook. Coalescing does not apply that's a skill/prompt concern, not a debouncer concern.
If the user tapped `Dump` as a **reply** to an existing URL-balloon (iMessage shows a "1 Reply" badge on the Dump bubble), the URL lives in `replyToBody`, not in a second webhook. Coalescing does not apply - that's a skill/prompt concern, not a debouncer concern.
</Accordion>
</AccordionGroup>
@@ -617,15 +617,15 @@ When the same handle has both an iMessage and an SMS chat on the Mac (for exampl
- Edit/unsend require macOS 13+ and a compatible BlueBubbles server version. On macOS 26 (Tahoe), edit is currently broken due to private API changes.
- Group icon updates can be flaky on macOS 26 (Tahoe): the API may return success but the new icon does not sync.
- OpenClaw auto-hides known-broken actions based on the BlueBubbles server's macOS version. If edit still appears on macOS 26 (Tahoe), disable it manually with `channels.bluebubbles.actions.edit=false`.
- `coalesceSameSenderDms` enabled but split-sends (e.g. `Dump` + URL) still arrive as two turns: see the [split-send coalescing troubleshooting](#split-send-coalescing-troubleshooting) checklist common causes are too-tight debounce window, session-log timestamps misread as webhook arrival, or a reply-quote send (which uses `replyToBody`, not a second webhook).
- `coalesceSameSenderDms` enabled but split-sends (e.g. `Dump` + URL) still arrive as two turns: see the [split-send coalescing troubleshooting](#split-send-coalescing-troubleshooting) checklist - common causes are too-tight debounce window, session-log timestamps misread as webhook arrival, or a reply-quote send (which uses `replyToBody`, not a second webhook).
- For status/health info: `openclaw status --all` or `openclaw status --deep`.
For general channel workflow reference, see [Channels](/channels) and the [Plugins](/tools/plugin) guide.
## Related
- [Channel Routing](/channels/channel-routing) session routing for messages
- [Channels Overview](/channels) all supported channels
- [Groups](/channels/groups) group chat behavior and mention gating
- [Pairing](/channels/pairing) DM authentication and pairing flow
- [Security](/gateway/security) access model and hardening
- [Channel Routing](/channels/channel-routing) - session routing for messages
- [Channels Overview](/channels) - all supported channels
- [Groups](/channels/groups) - group chat behavior and mention gating
- [Pairing](/channels/pairing) - DM authentication and pairing flow
- [Security](/gateway/security) - access model and hardening

View File

@@ -14,11 +14,11 @@ host configuration.
## Key terms
- **Channel**: `telegram`, `whatsapp`, `discord`, `irc`, `googlechat`, `slack`, `signal`, `imessage`, `line`, plus plugin channels. `webchat` is the internal WebChat UI channel and is not a configurable outbound channel.
- **AccountId**: perchannel account instance (when supported).
- **AccountId**: per-channel account instance (when supported).
- Optional channel default account: `channels.<channel>.defaultAccount` chooses
which account is used when an outbound path does not specify `accountId`.
- In multi-account setups, set an explicit default (`defaultAccount` or `accounts.default`) when two or more accounts are configured. Without it, fallback routing may pick the first normalized account ID.
- **AgentId**: an isolated workspace + session store (brain).
- **AgentId**: an isolated workspace + session store ("brain").
- **SessionKey**: the bucket key used to store context and control concurrency.
## Outbound target prefixes
@@ -29,7 +29,7 @@ Target-kind and service prefixes such as `channel:<id>`, `user:<id>`, `room:<id>
## Session key shapes (examples)
Direct messages collapse to the agents **main** session by default:
Direct messages collapse to the agent's **main** session by default:
- `agent:<agentId>:<mainKey>` (default: `agent:main:main`)
@@ -55,7 +55,7 @@ Examples:
## Main DM route pinning
When `session.dmScope` is `main`, direct messages may share one main session.
To prevent the sessions `lastRoute` from being overwritten by non-owner DMs,
To prevent the session's `lastRoute` from being overwritten by non-owner DMs,
OpenClaw infers a pinned owner from `allowFrom` when all of these are true:
- `allowFrom` has exactly one non-wildcard entry.
@@ -142,8 +142,8 @@ stores must stay inside that resolved agent root and use a regular
## WebChat behavior
WebChat attaches to the **selected agent** and defaults to the agents main
session. Because of this, WebChat lets you see crosschannel context for that
WebChat attaches to the **selected agent** and defaults to the agent's main
session. Because of this, WebChat lets you see cross-channel context for that
agent in one place.
## Reply context

View File

@@ -6,8 +6,6 @@ read_when:
title: Feishu
---
# Feishu / Lark
Feishu/Lark is an all-in-one collaboration platform where teams chat, share documents, manage calendars, and get work done together.
**Status:** production-ready for bot DMs + group chats. WebSocket is the default mode; webhook mode is optional.
@@ -43,10 +41,10 @@ Requires OpenClaw 2026.4.25 or above. Run `openclaw --version` to check. Upgrade
Configure `dmPolicy` to control who can DM the bot:
- `"pairing"` unknown users receive a pairing code; approve via CLI
- `"allowlist"` only users listed in `allowFrom` can chat (default: bot owner only)
- `"open"` allow public DMs only when `allowFrom` includes `"*"`; with restrictive entries, only matching users can chat
- `"disabled"` disable all DMs
- `"pairing"` - unknown users receive a pairing code; approve via CLI
- `"allowlist"` - only users listed in `allowFrom` can chat (default: bot owner only)
- `"open"` - allow public DMs only when `allowFrom` includes `"*"`; with restrictive entries, only matching users can chat
- `"disabled"` - disable all DMs
**Approve a pairing request:**
@@ -69,8 +67,8 @@ Default: `allowlist`
**Mention requirement** (`channels.feishu.requireMention`):
- `true` require @mention (default)
- `false` respond without @mention
- `true` - require @mention (default)
- `false` - respond without @mention
- Per-group override: `channels.feishu.groups.<chat_id>.requireMention`
- Broadcast-only `@all` and `@_all` are not treated as bot mentions. A message that mentions both `@all` and the bot directly still counts as a bot mention.
@@ -261,8 +259,8 @@ per account.
### Message limits
- `textChunkLimit` outbound text chunk size (default: `2000` chars)
- `mediaMaxMb` media upload/download limit (default: `30` MB)
- `textChunkLimit` - outbound text chunk size (default: `2000` chars)
- `mediaMaxMb` - media upload/download limit (default: `30` MB)
### Streaming
@@ -301,7 +299,7 @@ Reduce the number of Feishu/Lark API calls with two optional flags:
### ACP sessions
Feishu/Lark supports ACP for DMs and group thread messages. Feishu/Lark ACP is text-command driven there are no native slash-command menus, so use `/acp ...` messages directly in the conversation.
Feishu/Lark supports ACP for DMs and group thread messages. Feishu/Lark ACP is text-command driven - there are no native slash-command menus, so use `/acp ...` messages directly in the conversation.
#### Persistent ACP binding
@@ -409,19 +407,19 @@ Full configuration: [Gateway configuration](/gateway/configuration)
| `channels.feishu.domain` | API domain (`feishu` or `lark`) | `feishu` |
| `channels.feishu.connectionMode` | Event transport (`websocket` or `webhook`) | `websocket` |
| `channels.feishu.defaultAccount` | Default account for outbound routing | `default` |
| `channels.feishu.verificationToken` | Required for webhook mode | |
| `channels.feishu.encryptKey` | Required for webhook mode | |
| `channels.feishu.verificationToken` | Required for webhook mode | - |
| `channels.feishu.encryptKey` | Required for webhook mode | - |
| `channels.feishu.webhookPath` | Webhook route path | `/feishu/events` |
| `channels.feishu.webhookHost` | Webhook bind host | `127.0.0.1` |
| `channels.feishu.webhookPort` | Webhook bind port | `3000` |
| `channels.feishu.accounts.<id>.appId` | App ID | |
| `channels.feishu.accounts.<id>.appSecret` | App Secret | |
| `channels.feishu.accounts.<id>.appId` | App ID | - |
| `channels.feishu.accounts.<id>.appSecret` | App Secret | - |
| `channels.feishu.accounts.<id>.domain` | Per-account domain override | `feishu` |
| `channels.feishu.accounts.<id>.tts` | Per-account TTS override | `messages.tts` |
| `channels.feishu.dmPolicy` | DM policy | `allowlist` |
| `channels.feishu.allowFrom` | DM allowlist (open_id list) | [BotOwnerId] |
| `channels.feishu.groupPolicy` | Group policy | `allowlist` |
| `channels.feishu.groupAllowFrom` | Group allowlist | |
| `channels.feishu.groupAllowFrom` | Group allowlist | - |
| `channels.feishu.requireMention` | Require @mention in groups | `true` |
| `channels.feishu.groups.<chat_id>.requireMention` | Per-group @mention override; explicit IDs also admit the group in allowlist mode | inherited |
| `channels.feishu.groups.<chat_id>.enabled` | Enable/disable a specific group | `true` |
@@ -481,16 +479,17 @@ conversion fails, OpenClaw falls back to a file attachment and logs the reason.
For `groupSessionScope: "group_topic"` and `"group_topic_sender"`, native
Feishu/Lark topic groups use the event `thread_id` (`omt_*`) as the canonical
topic session key. Normal group replies that OpenClaw turns into threads keep
using the reply root message ID (`om_*`) so the first turn and follow-up turn
stay in the same session.
topic session key. If a native topic starter event omits `thread_id`, OpenClaw
hydrates it from Feishu before routing the turn. Normal group replies that
OpenClaw turns into threads keep using the reply root message ID (`om_*`) so the
first turn and follow-up turn stay in the same session.
---
## Related
- [Channels Overview](/channels) all supported channels
- [Pairing](/channels/pairing) DM authentication and pairing flow
- [Groups](/channels/groups) group chat behavior and mention gating
- [Channel Routing](/channels/channel-routing) session routing for messages
- [Security](/gateway/security) access model and hardening
- [Channels Overview](/channels) - all supported channels
- [Pairing](/channels/pairing) - DM authentication and pairing flow
- [Groups](/channels/groups) - group chat behavior and mention gating
- [Channel Routing](/channels/channel-routing) - session routing for messages
- [Security](/gateway/security) - access model and hardening

View File

@@ -161,7 +161,7 @@ Configure your tunnel's ingress rules to only route the webhook path:
- Spaces use session key `agent:<agentId>:googlechat:group:<spaceId>`.
4. DM access is pairing by default. Unknown senders receive a pairing code; approve with:
- `openclaw pairing approve googlechat <code>`
5. Group spaces require @-mention by default. Use `botUser` if mention detection needs the apps user name.
5. Group spaces require @-mention by default. Use `botUser` if mention detection needs the app's user name.
## Targets
@@ -210,7 +210,7 @@ Notes:
- Service account credentials can also be passed inline with `serviceAccount` (JSON string).
- `serviceAccountRef` is also supported (env/file SecretRef), including per-account refs under `channels.googlechat.accounts.<id>.serviceAccountRef`.
- Default webhook path is `/googlechat` if `webhookPath` isnt set.
- Default webhook path is `/googlechat` if `webhookPath` isn't set.
- `dangerouslyAllowNameMatching` re-enables mutable email principal matching for allowlists (break-glass compatibility mode).
- Reactions are available via the `reactions` tool and `channels action` when `actions.reactions` is enabled.
- Message actions expose `send` for text and `upload-file` for explicit attachment sends. `upload-file` accepts `media` / `filePath` / `path` plus optional `message`, `filename`, and thread targeting.

View File

@@ -18,13 +18,13 @@ Goal: let OpenClaw sit in WhatsApp groups, wake up only when pinged, and keep th
## Behavior
- Activation modes: `mention` (default) or `always`. `mention` requires a ping (real WhatsApp @-mentions via `mentionedJids`, safe regex patterns, or the bots 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).
- 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`, `/trace 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.
- Sender surfacing: every group batch now ends with `[from: Sender Name (+E164)]` so Pi knows who is speaking.
- Ephemeral/view-once: we unwrap those before extracting text/mentions, so pings inside them still trigger.
- Group system prompt: on the first turn of a group session (and whenever `/activation` changes the mode) we inject a short blurb into the system prompt like `You are replying inside the WhatsApp group "<subject>". Group members: Alice (+44...), Bob (+43...), Activation: trigger-only Address the specific sender noted in the message context.` If metadata isnt available we still tell the agent its a group chat.
- Group system prompt: on the first turn of a group session (and whenever `/activation` changes the mode) we inject a short blurb into the system prompt like `You are replying inside the WhatsApp group "<subject>". Group members: Alice (+44...), Bob (+43...), ... Activation: trigger-only ... Address the specific sender noted in the message context.` If metadata isn't available we still tell the agent it's a group chat.
## Config example (WhatsApp)
@@ -65,14 +65,14 @@ Use the group chat command:
- `/activation mention`
- `/activation always`
Only the owner number (from `channels.whatsapp.allowFrom`, or the bots own E.164 when unset) can change this. Send `/status` as a standalone message in the group to see the current activation mode.
Only the owner number (from `channels.whatsapp.allowFrom`, or the bot's own E.164 when unset) can change this. Send `/status` as a standalone message in the group to see the current activation mode.
## How to use
1. Add your WhatsApp account (the one running OpenClaw) to the group.
2. Say `@openclaw …` (or include the number). Only allowlisted senders can trigger it unless you set `groupPolicy: "open"`.
3. The agent prompt will include recent group context plus the trailing `[from: …]` marker so it can address the right person.
4. Session-level directives (`/verbose on`, `/trace on`, `/think high`, `/new` or `/reset`, `/compact`) apply only to that groups session; send them as standalone messages so they register. Your personal DM session remains independent.
4. Session-level directives (`/verbose on`, `/trace on`, `/think high`, `/new` or `/reset`, `/compact`) apply only to that group's session; send them as standalone messages so they register. Your personal DM session remains independent.
## Testing / verification
@@ -85,7 +85,7 @@ Only the owner number (from `channels.whatsapp.allowFrom`, or the bots own E.
- Heartbeats are intentionally skipped for groups to avoid noisy broadcasts.
- Echo suppression uses the combined batch string; if you send identical text twice without mentions, only the first will get a response.
- Session store entries will appear as `agent:<agentId>:whatsapp:group:<jid>` in the session store (`~/.openclaw/agents/<agentId>/sessions/sessions.json` by default); a missing entry just means the group hasnt triggered a run yet.
- Session store entries will appear as `agent:<agentId>:whatsapp:group:<jid>` in the session store (`~/.openclaw/agents/<agentId>/sessions/sessions.json` by default); a missing entry just means the group hasn't triggered a run yet.
- Typing indicators in groups follow `agents.defaults.typingMode`. When visible replies use the default message-tool-only mode, typing starts immediately by default so group members can see the agent is working even if no automatic final reply is posted. Explicit typing-mode config still wins.
## Related

View File

@@ -21,32 +21,32 @@ 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 (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 (bundled plugin).
- [Google Chat](/channels/googlechat) Google Chat API app via HTTP webhook (downloadable plugin).
- [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 (downloadable plugin).
- [Matrix](/channels/matrix) Matrix protocol (downloadable plugin).
- [Mattermost](/channels/mattermost) Bot API + WebSocket; channels, groups, DMs (downloadable 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 (bundled plugin).
- [Telegram](/channels/telegram) Bot API via grammY; supports groups.
- [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](/channels/wechat) Tencent iLink Bot plugin via QR login; private chats only (external plugin).
- [WhatsApp](/channels/whatsapp) Most popular; uses Baileys and requires QR pairing.
- [Yuanbao](/channels/yuanbao) Tencent Yuanbao bot (external plugin).
- [Zalo](/channels/zalo) Zalo Bot API; Vietnam's popular messenger (bundled plugin).
- [Zalo Personal](/channels/zalouser) Zalo personal account via QR login (bundled plugin).
- [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 (bundled plugin).
- [Google Chat](/channels/googlechat) - Google Chat API app via HTTP webhook (downloadable plugin).
- [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 (downloadable plugin).
- [Matrix](/channels/matrix) - Matrix protocol (downloadable plugin).
- [Mattermost](/channels/mattermost) - Bot API + WebSocket; channels, groups, DMs (downloadable 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 (bundled plugin).
- [Telegram](/channels/telegram) - Bot API via grammY; supports groups.
- [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](/channels/wechat) - Tencent iLink Bot plugin via QR login; private chats only (external plugin).
- [WhatsApp](/channels/whatsapp) - Most popular; uses Baileys and requires QR pairing.
- [Yuanbao](/channels/yuanbao) - Tencent Yuanbao bot (external plugin).
- [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

View File

@@ -47,7 +47,7 @@ openclaw gateway run
## Access control
There are two separate gates for IRC channels:
There are two separate "gates" for IRC channels:
1. **Channel access** (`groupPolicy` + `groups`): whether the bot accepts messages from a channel at all.
2. **Sender access** (`groupAllowFrom` / per-channel `groups["#channel"].allowFrom`): who is allowed to trigger the bot inside that channel.
@@ -68,7 +68,7 @@ If you see logs like:
- `irc: drop group sender alice!ident@host (policy=allowlist)`
it means the sender wasnt allowed for **group/channel** messages. Fix it by either:
...it means the sender wasn't allowed for **group/channel** messages. Fix it by either:
- setting `channels.irc.groupAllowFrom` (global for all channels), or
- setting per-channel sender allowlists: `channels.irc.groups["#channel"].allowFrom`

View File

@@ -42,7 +42,7 @@ openclaw plugins install ./path/to/local/line-plugin
https://gateway-host/line/webhook
```
The gateway responds to LINEs webhook verification (GET) and inbound events (POST).
The gateway responds to LINE's webhook verification (GET) and inbound events (POST).
If you need a custom path, set `channels.line.webhookPath` or
`channels.line.accounts.<id>.webhookPath` and update the URL accordingly.
@@ -68,6 +68,22 @@ Minimal config:
}
```
Public DM config:
```json5
{
channels: {
line: {
enabled: true,
channelAccessToken: "LINE_CHANNEL_ACCESS_TOKEN",
channelSecret: "LINE_CHANNEL_SECRET",
dmPolicy: "open",
allowFrom: ["*"],
},
},
}
```
Env vars (default account only):
- `LINE_CHANNEL_ACCESS_TOKEN`
@@ -119,7 +135,7 @@ openclaw pairing approve line <CODE>
Allowlists and policies:
- `channels.line.dmPolicy`: `pairing | allowlist | open | disabled`
- `channels.line.allowFrom`: allowlisted LINE user IDs for DMs
- `channels.line.allowFrom`: allowlisted LINE user IDs for DMs; `dmPolicy: "open"` requires `["*"]`
- `channels.line.groupPolicy`: `allowlist | open | disabled`
- `channels.line.groupAllowFrom`: allowlisted LINE user IDs for groups
- Per-group overrides: `channels.line.groups.<groupId>.allowFrom`

View File

@@ -30,7 +30,7 @@ openclaw plugins install ./path/to/local/matrix-plugin
1. Create a Matrix account on your homeserver.
2. Configure `channels.matrix` with either `homeserver` + `accessToken`, or `homeserver` + `userId` + `password`.
3. Restart the gateway.
4. Start a DM with the bot, or invite it to a room (see [auto-join](#auto-join) fresh invites only land when `autoJoin` allows them).
4. Start a DM with the bot, or invite it to a room (see [auto-join](#auto-join) - fresh invites only land when `autoJoin` allows them).
### Interactive setup
@@ -80,7 +80,7 @@ Password-based (the token is cached after first login):
`channels.matrix.autoJoin` defaults to `off`. With the default, the bot will not appear in new rooms or DMs from fresh invites until you join manually.
OpenClaw cannot tell at invite time whether an invited room is a DM or a group, so all invites including DM-style invites go through `autoJoin` first. `dm.policy` only applies later, after the bot has joined and the room has been classified.
OpenClaw cannot tell at invite time whether an invited room is a DM or a group, so all invites - including DM-style invites - go through `autoJoin` first. `dm.policy` only applies later, after the bot has joined and the room has been classified.
<Warning>
Set `autoJoin: "allowlist"` plus `autoJoinAllowlist` to restrict which invites the bot accepts, or `autoJoin: "always"` to accept every invite.
@@ -122,7 +122,7 @@ Matrix stores cached credentials under `~/.openclaw/credentials/matrix/`:
- default account: `credentials.json`
- named accounts: `credentials-<account>.json`
When cached credentials exist there, OpenClaw treats Matrix as configured even if the access token is not in the config file that covers setup, `openclaw doctor`, and channel-status probes.
When cached credentials exist there, OpenClaw treats Matrix as configured even if the access token is not in the config file - that covers setup, `openclaw doctor`, and channel-status probes.
### Environment variables
@@ -237,7 +237,7 @@ When an approval prompt is too long for one Matrix event, OpenClaw chunks the vi
### Self-hosted push rules for quiet finalized previews
`streaming: "quiet"` only notifies recipients once a block or turn is finalized a per-user push rule has to match the finalized preview marker. See [Matrix push rules for quiet previews](/channels/matrix-push-rules) for the full recipe (recipient token, pusher check, rule install, per-homeserver notes).
`streaming: "quiet"` only notifies recipients once a block or turn is finalized - a per-user push rule has to match the finalized preview marker. See [Matrix push rules for quiet previews](/channels/matrix-push-rules) for the full recipe (recipient token, pusher check, rule install, per-homeserver notes).
## Bot-to-bot rooms
@@ -270,7 +270,7 @@ Use strict room allowlists and mention requirements when enabling bot-to-bot tra
## Encryption and verification
In encrypted (E2EE) rooms, outbound image events use `thumbnail_file` so image previews are encrypted alongside the full attachment. Unencrypted rooms still use plain `thumbnail_url`. No configuration is needed the plugin detects E2EE state automatically.
In encrypted (E2EE) rooms, outbound image events use `thumbnail_file` so image previews are encrypted alongside the full attachment. Unencrypted rooms still use plain `thumbnail_url`. No configuration is needed - the plugin detects E2EE state automatically.
All `openclaw matrix` commands accept `--verbose` (full diagnostics), `--json` (machine-readable output), and `--account <id>` (multi-account setups). Output is concise by default with quiet internal SDK logging. The examples below show the canonical form; add the flags as needed.
@@ -331,7 +331,7 @@ openclaw matrix verify status --include-recovery-key --json
### Verify this device with a recovery key
The recovery key is sensitive pipe it via stdin instead of passing it on the command line. Set `MATRIX_RECOVERY_KEY` (or `MATRIX_<ID>_RECOVERY_KEY` for a named account):
The recovery key is sensitive - pipe it via stdin instead of passing it on the command line. Set `MATRIX_RECOVERY_KEY` (or `MATRIX_<ID>_RECOVERY_KEY` for a named account):
```bash
printf '%s\n' "$MATRIX_RECOVERY_KEY" | openclaw matrix verify device --recovery-key-stdin
@@ -405,7 +405,7 @@ openclaw matrix verify request --user-id @ops:example.org --device-id ABCDEF
Sends a verification request from this OpenClaw account. `--own-user` requests self-verification (you accept the prompt in another Matrix client of the same user); `--user-id`/`--device-id`/`--room-id` target someone else. `--own-user` cannot be combined with the other targeting flags.
For lower-level lifecycle handling typically while shadowing inbound requests from another client these commands act on a specific request `<id>` (printed by `verify list` and `verify request`):
For lower-level lifecycle handling - typically while shadowing inbound requests from another client - these commands act on a specific request `<id>` (printed by `verify list` and `verify request`):
| Command | Purpose |
| ------------------------------------------ | ------------------------------------------------------------------- |
@@ -435,7 +435,7 @@ Without `--account <id>`, Matrix CLI commands use the implicit default account.
<Accordion title="Verification notices">
Matrix posts verification lifecycle notices into the strict DM verification room as `m.notice` messages: request, ready (with "Verify by emoji" guidance), start/completion, and SAS (emoji/decimal) details when available.
Incoming requests from another Matrix client are tracked and auto-accepted. For self-verification, OpenClaw starts the SAS flow automatically and confirms its own side once emoji verification is available you still need to compare and confirm "They match" in your Matrix client.
Incoming requests from another Matrix client are tracked and auto-accepted. For self-verification, OpenClaw starts the SAS flow automatically and confirms its own side once emoji verification is available - you still need to compare and confirm "They match" in your Matrix client.
Verification system notices are not forwarded to the agent chat pipeline.
@@ -516,7 +516,7 @@ Explicit conversation bindings always win over `sessionScope`, so bound rooms an
- `"inbound"`: reply inside a thread only when the inbound message was already in that thread.
- `"always"`: reply inside a thread rooted at the triggering message; that conversation is routed through a matching thread-scoped session from the first trigger onward.
`dm.threadReplies` overrides this for DMs only for example, keep room threads isolated while keeping DMs flat.
`dm.threadReplies` overrides this for DMs only - for example, keep room threads isolated while keeping DMs flat.
### Thread inheritance and slash commands
@@ -676,7 +676,7 @@ It does not delete old rooms automatically. It picks the healthy DM and updates
Matrix can act as a native approval client. Configure under `channels.matrix.execApprovals` (or `channels.matrix.accounts.<account>.execApprovals` for a per-account override):
- `enabled`: deliver approvals through Matrix-native prompts. When unset or `"auto"`, Matrix auto-enables once at least one approver can be resolved. Set `false` to disable explicitly.
- `approvers`: Matrix user IDs (`@owner:example.org`) allowed to approve exec requests. Optional falls back to `channels.matrix.dm.allowFrom`.
- `approvers`: Matrix user IDs (`@owner:example.org`) allowed to approve exec requests. Optional - falls back to `channels.matrix.dm.allowFrom`.
- `target`: where prompts go. `"dm"` (default) sends to approver DMs; `"channel"` sends to the originating Matrix room or DM; `"both"` sends to both.
- `agentFilter` / `sessionFilter`: optional allowlists for which agents/sessions trigger Matrix delivery.
@@ -693,7 +693,7 @@ Both kinds share Matrix reaction shortcuts and message updates. Approvers see re
Fallback slash commands: `/approve <id> allow-once`, `/approve <id> allow-always`, `/approve <id> deny`.
Only resolved approvers can approve or deny. Channel delivery for exec approvals includes the command text only enable `channel` or `both` in trusted rooms.
Only resolved approvers can approve or deny. Channel delivery for exec approvals includes the command text - only enable `channel` or `both` in trusted rooms.
Related: [Exec approvals](/tools/exec-approvals).
@@ -742,7 +742,7 @@ Authorization rules still apply: command senders must satisfy the same DM or roo
- Set `defaultAccount` to pick the named account that implicit routing, probing, and CLI commands prefer.
- If you have multiple accounts and one is literally named `default`, OpenClaw uses it implicitly even when `defaultAccount` is unset.
- If you have multiple named accounts and no default is selected, CLI commands refuse to guess set `defaultAccount` or pass `--account <id>`.
- If you have multiple named accounts and no default is selected, CLI commands refuse to guess - set `defaultAccount` or pass `--account <id>`.
- The top-level `channels.matrix.*` block is only treated as the implicit `default` account when its auth is complete (`homeserver` + `accessToken`, or `homeserver` + `userId` + `password`). Named accounts remain discoverable from `homeserver` + `userId` once cached credentials cover auth.
**Promotion:**
@@ -907,8 +907,8 @@ Allowlist-style fields (`groupAllowFrom`, `dm.allowFrom`, `groups.<room>.users`)
## Related
- [Channels Overview](/channels) all supported channels
- [Pairing](/channels/pairing) DM authentication and pairing flow
- [Groups](/channels/groups) group chat behavior and mention gating
- [Channel Routing](/channels/channel-routing) session routing for messages
- [Security](/gateway/security) access model and hardening
- [Channels Overview](/channels) - all supported channels
- [Pairing](/channels/pairing) - DM authentication and pairing flow
- [Groups](/channels/groups) - group chat behavior and mention gating
- [Channel Routing](/channels/channel-routing) - session routing for messages
- [Security](/gateway/security) - access model and hardening

View File

@@ -361,7 +361,7 @@ When a user clicks a button:
<AccordionGroup>
<Accordion title="Implementation notes">
- Button callbacks use HMAC-SHA256 verification (automatic, no config needed).
- Mattermost strips callback data from its API responses (security feature), so all buttons are removed on click partial removal is not possible.
- Mattermost strips callback data from its API responses (security feature), so all buttons are removed on click - partial removal is not possible.
- Action IDs containing hyphens or underscores are sanitized automatically (Mattermost routing limitation).
</Accordion>
@@ -391,7 +391,7 @@ External scripts and webhooks can post buttons directly via the Mattermost REST
{
actions: [
{
id: "mybutton01", // alphanumeric only see below
id: "mybutton01", // alphanumeric only - see below
type: "button", // required, or clicks are silently ignored
name: "Approve", // display label
style: "primary", // optional: "default", "primary", "danger"
@@ -416,11 +416,11 @@ External scripts and webhooks can post buttons directly via the Mattermost REST
**Critical rules**
1. Attachments go in `props.attachments`, not top-level `attachments` (silently ignored).
2. Every action needs `type: "button"` without it, clicks are swallowed silently.
3. Every action needs an `id` field Mattermost ignores actions without IDs.
2. Every action needs `type: "button"` - without it, clicks are swallowed silently.
3. Every action needs an `id` field - Mattermost ignores actions without IDs.
4. Action `id` must be **alphanumeric only** (`[a-zA-Z0-9]`). Hyphens and underscores break Mattermost's server-side action routing (returns 404). Strip them before use.
5. `context.action_id` must match the button's `id` so the confirmation message shows the button name (e.g., "Approve") instead of a raw ID.
6. `context.action_id` is required the interaction handler returns 400 without it.
6. `context.action_id` is required - the interaction handler returns 400 without it.
</Warning>
@@ -467,7 +467,7 @@ context = {**ctx, "_token": token}
<Accordion title="Common HMAC pitfalls">
- Python's `json.dumps` adds spaces by default (`{"key": "val"}`). Use `separators=(",", ":")` to match JavaScript's compact output (`{"key":"val"}`).
- Always sign **all** context fields (minus `_token`). The gateway strips `_token` then signs everything remaining. Signing a subset causes silent verification failure.
- Use `sort_keys=True` the gateway sorts keys before signing, and Mattermost may reorder context fields when storing the payload.
- Use `sort_keys=True` - the gateway sorts keys before signing, and Mattermost may reorder context fields when storing the payload.
- Derive the secret from the bot token (deterministic), not random bytes. The secret must be the same across the process that creates buttons and the gateway that verifies.
</Accordion>
@@ -477,7 +477,7 @@ context = {**ctx, "_token": token}
The Mattermost plugin includes a directory adapter that resolves channel and user names via the Mattermost API. This enables `#channel-name` and `@username` targets in `openclaw message send` and cron/webhook deliveries.
No configuration is needed the adapter uses the bot token from the account config.
No configuration is needed - the adapter uses the bot token from the account config.
## Multi-account
@@ -531,8 +531,8 @@ Mattermost supports multiple accounts under `channels.mattermost.accounts`:
## Related
- [Channel Routing](/channels/channel-routing) session routing for messages
- [Channels Overview](/channels) all supported channels
- [Groups](/channels/groups) group chat behavior and mention gating
- [Pairing](/channels/pairing) DM authentication and pairing flow
- [Security](/gateway/security) access model and hardening
- [Channel Routing](/channels/channel-routing) - session routing for messages
- [Channels Overview](/channels) - all supported channels
- [Groups](/channels/groups) - group chat behavior and mention gating
- [Pairing](/channels/pairing) - DM authentication and pairing flow
- [Security](/gateway/security) - access model and hardening

View File

@@ -79,9 +79,9 @@ This single command:
- Creates an Entra ID (Azure AD) application
- Generates a client secret
- Builds and uploads a Teams app manifest (with icons)
- Registers the bot (Teams-managed by default no Azure subscription needed)
- Registers the bot (Teams-managed by default - no Azure subscription needed)
The output will show `CLIENT_ID`, `CLIENT_SECRET`, `TENANT_ID`, and a **Teams App ID** note these for the next steps. It also offers to install the app in Teams directly.
The output will show `CLIENT_ID`, `CLIENT_SECRET`, `TENANT_ID`, and a **Teams App ID** - note these for the next steps. It also offers to install the app in Teams directly.
**4. Configure OpenClaw** using the credentials from the output:
@@ -103,7 +103,7 @@ Or use environment variables directly: `MSTEAMS_APP_ID`, `MSTEAMS_APP_PASSWORD`,
**5. Install the app in Teams**
`teams app create` will prompt you to install the app select "Install in Teams". If you skipped it, you can get the link later:
`teams app create` will prompt you to install the app - select "Install in Teams". If you skipped it, you can get the link later:
```bash
teams app get <teamsAppId> --install-link
@@ -147,14 +147,14 @@ Disable with:
- Default: `channels.msteams.dmPolicy = "pairing"`. Unknown senders are ignored until approved.
- `channels.msteams.allowFrom` should use stable AAD object IDs.
- Do not rely on UPN/display-name matching for allowlists they can change. OpenClaw disables direct name matching by default; opt in explicitly with `channels.msteams.dangerouslyAllowNameMatching: true`.
- Do not rely on UPN/display-name matching for allowlists - they can change. OpenClaw disables direct name matching by default; opt in explicitly with `channels.msteams.dangerouslyAllowNameMatching: true`.
- The wizard can resolve names to IDs via Microsoft Graph when credentials allow.
**Group access**
- Default: `channels.msteams.groupPolicy = "allowlist"` (blocked unless you add `groupAllowFrom`). Use `channels.defaults.groupPolicy` to override the default when unset.
- `channels.msteams.groupAllowFrom` controls which senders can trigger in group chats/channels (falls back to `channels.msteams.allowFrom`).
- Set `groupPolicy: "open"` to allow any member (still mentiongated by default).
- Set `groupPolicy: "open"` to allow any member (still mention-gated by default).
- To allow **no channels**, set `channels.msteams.groupPolicy: "disabled"`.
Example:
@@ -174,7 +174,7 @@ Example:
- Scope group/channel replies by listing teams and channels under `channels.msteams.teams`.
- Keys should use stable Teams conversation IDs from Teams links, not mutable display names.
- When `groupPolicy="allowlist"` and a teams allowlist is present, only listed teams/channels are accepted (mentiongated).
- When `groupPolicy="allowlist"` and a teams allowlist is present, only listed teams/channels are accepted (mention-gated).
- The configure wizard accepts `Team/Channel` entries and stores them for you.
- On startup, OpenClaw resolves team/channel and user allowlist names to IDs (when Graph permissions allow)
and logs the mapping; unresolved team/channel names are kept as typed but ignored for routing by default unless `channels.msteams.dangerouslyAllowNameMatching: true` is enabled.
@@ -416,7 +416,7 @@ For AKS deployments using workload identity:
azure.workload.identity/use: "true"
```
5. **Ensure network access** to IMDS (`169.254.169.254`) if using NetworkPolicy, add an egress rule allowing traffic to `169.254.169.254/32` on port 80.
5. **Ensure network access** to IMDS (`169.254.169.254`) - if using NetworkPolicy, add an egress rule allowing traffic to `169.254.169.254/32` on port 80.
### Auth type comparison
@@ -702,7 +702,7 @@ Key settings (see `/gateway/configuration` for shared channel patterns):
- `toolsBySender` keys should use explicit prefixes:
`id:`, `e164:`, `username:`, `name:` (legacy unprefixed keys still map to `id:` only).
- `channels.msteams.actions.memberInfo`: enable or disable the Graph-backed member info action (default: enabled when Graph credentials are available).
- `channels.msteams.authType`: authentication type `"secret"` (default) or `"federated"`.
- `channels.msteams.authType`: authentication type - `"secret"` (default) or `"federated"`.
- `channels.msteams.certificatePath`: path to PEM certificate file (federated + certificate auth).
- `channels.msteams.certificateThumbprint`: certificate thumbprint (optional, not required for auth).
- `channels.msteams.useManagedIdentity`: enable managed identity auth (federated mode).
@@ -1014,8 +1014,8 @@ Bots have limited support in private channels:
## Related
- [Channels Overview](/channels) all supported channels
- [Pairing](/channels/pairing) DM authentication and pairing flow
- [Groups](/channels/groups) group chat behavior and mention gating
- [Channel Routing](/channels/channel-routing) session routing for messages
- [Security](/gateway/security) access model and hardening
- [Channels Overview](/channels) - all supported channels
- [Pairing](/channels/pairing) - DM authentication and pairing flow
- [Groups](/channels/groups) - group chat behavior and mention gating
- [Channel Routing](/channels/channel-routing) - session routing for messages
- [Security](/gateway/security) - access model and hardening

View File

@@ -134,12 +134,11 @@ That bootstrap token carries the built-in pairing bootstrap profile:
Treat the setup code like a password while it is valid.
For Tailscale, public, or other non-loopback mobile pairing, use Tailscale
Serve/Funnel or another `wss://` Gateway URL. Direct non-loopback `ws://` setup
URLs are rejected before QR/setup-code issuance. Plaintext `ws://` setup codes
are limited to loopback URLs; private-network `ws://` clients still require the explicit
`OPENCLAW_ALLOW_INSECURE_PRIVATE_WS=1` break-glass described in the remote
Gateway guide.
For Tailscale, public, or other remote mobile pairing, use Tailscale Serve/Funnel
or another `wss://` Gateway URL. Plaintext `ws://` setup codes are accepted only
for loopback, private LAN addresses, `.local` Bonjour hosts, and the Android
emulator host. Tailnet CGNAT addresses, `.ts.net` names, and public hosts still
fail closed before QR/setup-code issuance.
### Approve a node device

View File

@@ -7,7 +7,7 @@ read_when:
- You are iterating on end-to-end QA automation
---
`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.
`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
@@ -38,20 +38,20 @@ read_when:
Account keys:
- `enabled` master toggle for this account.
- `name` optional display label.
- `baseUrl` synthetic bus URL.
- `botUserId` Matrix-style bot user id used in target grammar.
- `botDisplayName` display name for outbound messages.
- `pollTimeoutMs` long-poll wait window. Integer between 100 and 30000.
- `allowFrom` sender allowlist (user ids or `"*"`).
- `defaultTo` fallback target when none is supplied.
- `actions.messages` / `actions.reactions` / `actions.search` / `actions.threads` per-action tool gating.
- `enabled` - master toggle for this account.
- `name` - optional display label.
- `baseUrl` - synthetic bus URL.
- `botUserId` - Matrix-style bot user id used in target grammar.
- `botDisplayName` - display name for outbound messages.
- `pollTimeoutMs` - long-poll wait window. Integer between 100 and 30000.
- `allowFrom` - sender allowlist (user ids or `"*"`).
- `defaultTo` - fallback target when none is supplied.
- `actions.messages` / `actions.reactions` / `actions.search` / `actions.threads` - per-action tool gating.
Multi-account keys at the top level:
- `accounts` record of named per-account overrides keyed by account id.
- `defaultAccount` preferred account id when multiple are configured.
- `accounts` - record of named per-account overrides keyed by account id.
- `defaultAccount` - preferred account id when multiple are configured.
## Runners
@@ -81,8 +81,8 @@ Builds the QA site, starts the Docker-backed gateway + QA Lab stack, and prints
## Related
- [QA overview](/concepts/qa-e2e-automation) overall stack, transport adapters, scenario authoring
- [Matrix QA](/concepts/qa-matrix) example live-transport runner that drives a real channel
- [QA overview](/concepts/qa-e2e-automation) - overall stack, transport adapters, scenario authoring
- [Matrix QA](/concepts/qa-matrix) - example live-transport runner that drives a real channel
- [Pairing](/channels/pairing)
- [Groups](/channels/groups)
- [Channels overview](/channels)

View File

@@ -226,7 +226,7 @@ Groups:
- Use `message action=react` with `channel=signal`.
- Targets: sender E.164 or UUID (use `uuid:<id>` from pairing output; bare UUID works too).
- `messageId` is the Signal timestamp for the message youre reacting to.
- `messageId` is the Signal timestamp for the message you're reacting to.
- Group reactions require `targetAuthor` or `targetAuthorUuid`.
Examples:

View File

@@ -278,7 +278,7 @@ curl "https://api.telegram.org/bot<bot_token>/getUpdates"
Requirement:
- `channels.telegram.streaming` is `off | partial | block | progress` (default: `partial`)
- `progress` keeps one editable status draft and updates it with tool progress until final delivery
- `progress` keeps one editable status draft for tool progress, clears it at completion, and sends the final answer as a normal message
- `streaming.preview.toolProgress` controls whether tool/progress updates reuse the same edited preview message (default: `true` when preview streaming is active)
- `streaming.preview.commandText` controls command/exec detail inside those tool-progress lines: `raw` (default, preserves released behavior) or `status` (tool label only)
- legacy `channels.telegram.streamMode` and boolean `streaming` values are detected; run `openclaw doctor --fix` to migrate them to `channels.telegram.streaming.mode`
@@ -317,7 +317,7 @@ curl "https://api.telegram.org/bot<bot_token>/getUpdates"
}
```
For progress-draft mode, put the same command-text policy under `streaming.progress`:
Use `progress` mode when you want visible tool progress without editing the final answer into that same message. Put the command-text policy under `streaming.progress`:
```json
{
@@ -343,10 +343,10 @@ curl "https://api.telegram.org/bot<bot_token>/getUpdates"
For text-only replies:
- short DM/group/topic previews: OpenClaw keeps the same preview message and performs a final edit in place, unless a visible non-preview message was sent after the preview appeared
- short DM/group/topic previews: OpenClaw keeps the same preview message and performs the final edit in place
- long text finals that split into multiple Telegram messages reuse the existing preview as the first final chunk when possible, then send only the remaining chunks
- previews followed by visible non-preview output: OpenClaw sends the completed reply as a fresh final message and cleans up the older preview, so the final answer appears after intermediate output
- previews older than about one minute: OpenClaw sends the completed reply as a fresh final message and then cleans up the preview, so Telegram's visible timestamp reflects completion time instead of the preview creation time
- progress-mode finals clear the status draft and use normal final delivery instead of editing the draft into the answer
- if the final edit fails before the completed text is confirmed, OpenClaw uses normal final delivery and cleans up the stale preview
For complex replies (for example media payloads), OpenClaw falls back to normal final delivery and then cleans up the preview message.

View File

@@ -6,8 +6,6 @@ read_when:
title: Yuanbao
---
# Yuanbao
Tencent Yuanbao is Tencent's AI assistant platform. The OpenClaw channel plugin
connects Yuanbao bots to OpenClaw over WebSocket so they can interact with users
through direct messages and group chats.
@@ -53,10 +51,10 @@ Follow the prompts to enter your App ID and App Secret.
Configure `dmPolicy` to control who can DM the bot:
- `"pairing"` unknown users receive a pairing code; approve via CLI
- `"allowlist"` only users listed in `allowFrom` can chat
- `"open"` allow all users (default)
- `"disabled"` disable all DMs
- `"pairing"` - unknown users receive a pairing code; approve via CLI
- `"allowlist"` - only users listed in `allowFrom` can chat
- `"open"` - allow all users (default)
- `"disabled"` - disable all DMs
**Approve a pairing request:**
@@ -69,8 +67,8 @@ openclaw pairing approve yuanbao <CODE>
**Mention requirement** (`channels.yuanbao.requireMention`):
- `true` require @mention (default)
- `false` respond without @mention
- `true` - require @mention (default)
- `false` - respond without @mention
Replying to the bot's message in a group chat is treated as an implicit mention.
@@ -228,9 +226,9 @@ Replying to the bot's message in a group chat is treated as an implicit mention.
### Message limits
- `maxChars` single message max character count (default: `3000` chars)
- `mediaMaxMb` media upload/download limit (default: `20` MB)
- `overflowPolicy` behavior when message exceeds limit: `"split"` (default) or `"stop"`
- `maxChars` - single message max character count (default: `3000` chars)
- `mediaMaxMb` - media upload/download limit (default: `20` MB)
- `overflowPolicy` - behavior when message exceeds limit: `"split"` (default) or `"stop"`
### Streaming
@@ -358,13 +356,13 @@ Full configuration: [Gateway configuration](/gateway/configuration)
| ------------------------------------------ | ------------------------------------------------- | -------------------------------------- |
| `channels.yuanbao.enabled` | Enable/disable the channel | `true` |
| `channels.yuanbao.defaultAccount` | Default account for outbound routing | `default` |
| `channels.yuanbao.accounts.<id>.appKey` | App Key (used for signing and ticket generation) | |
| `channels.yuanbao.accounts.<id>.appSecret` | App Secret (used for signing) | |
| `channels.yuanbao.accounts.<id>.token` | Pre-signed token (skips automatic ticket signing) | |
| `channels.yuanbao.accounts.<id>.name` | Account display name | |
| `channels.yuanbao.accounts.<id>.appKey` | App Key (used for signing and ticket generation) | - |
| `channels.yuanbao.accounts.<id>.appSecret` | App Secret (used for signing) | - |
| `channels.yuanbao.accounts.<id>.token` | Pre-signed token (skips automatic ticket signing) | - |
| `channels.yuanbao.accounts.<id>.name` | Account display name | - |
| `channels.yuanbao.accounts.<id>.enabled` | Enable/disable a specific account | `true` |
| `channels.yuanbao.dm.policy` | DM policy | `open` |
| `channels.yuanbao.dm.allowFrom` | DM allowlist (user ID list) | |
| `channels.yuanbao.dm.allowFrom` | DM allowlist (user ID list) | - |
| `channels.yuanbao.requireMention` | Require @mention in groups | `true` |
| `channels.yuanbao.overflowPolicy` | Long message handling (`split` or `stop`) | `split` |
| `channels.yuanbao.replyToMode` | Group reply-to strategy (`off`, `first`, `all`) | `first` |
@@ -411,8 +409,8 @@ Full configuration: [Gateway configuration](/gateway/configuration)
## Related
- [Channels Overview](/channels) all supported channels
- [Pairing](/channels/pairing) DM authentication and pairing flow
- [Groups](/channels/groups) group chat behavior and mention gating
- [Channel Routing](/channels/channel-routing) session routing for messages
- [Security](/gateway/security) access model and hardening
- [Channels Overview](/channels) - all supported channels
- [Pairing](/channels/pairing) - DM authentication and pairing flow
- [Groups](/channels/groups) - group chat behavior and mention gating
- [Channel Routing](/channels/channel-routing) - session routing for messages
- [Security](/gateway/security) - access model and hardening

View File

@@ -91,15 +91,15 @@ gh workflow run full-release-validation.yml --ref main -f ref=<branch-or-sha>
## Runners
| Runner | Jobs |
| -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ubuntu-24.04` | `preflight`, fast security jobs and aggregates (`security-scm-fast`, `security-dependency-audit`, `security-fast`), fast protocol/contract/bundled checks, sharded channel contract checks, `check` shards except lint, `check-additional` shards and aggregates, Node test aggregate verifiers, docs checks, Python skills, workflow-sanity, labeler, auto-response; install-smoke preflight also uses GitHub-hosted Ubuntu so the Blacksmith matrix can queue earlier |
| `blacksmith-4vcpu-ubuntu-2404` | `CodeQL Critical Quality`, lower-weight extension shards, `checks-fast-core`, `checks-node-compat-node22`, `check-prod-types`, and `check-test-types` |
| `blacksmith-8vcpu-ubuntu-2404` | `build-artifacts`, build-smoke, Linux Node test shards, bundled plugin test shards, `android` |
| `blacksmith-16vcpu-ubuntu-2404` | `check-lint` (CPU-sensitive enough that 8 vCPU cost more than they saved); install-smoke Docker builds (32-vCPU queue time cost more than it saved) |
| `blacksmith-16vcpu-windows-2025` | `checks-windows` |
| `blacksmith-6vcpu-macos-latest` | `macos-node` on `openclaw/openclaw`; forks fall back to `macos-latest` |
| `blacksmith-12vcpu-macos-latest` | `macos-swift` on `openclaw/openclaw`; forks fall back to `macos-latest` |
| Runner | Jobs |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `ubuntu-24.04` | `preflight`, fast security jobs and aggregates (`security-scm-fast`, `security-dependency-audit`, `security-fast`), fast protocol/contract/bundled checks, sharded channel contract checks, `check` shards except lint, `check-additional` aggregates, Node test aggregate verifiers, docs checks, Python skills, workflow-sanity, labeler, auto-response; install-smoke preflight also uses GitHub-hosted Ubuntu so the Blacksmith matrix can queue earlier |
| `blacksmith-4vcpu-ubuntu-2404` | `CodeQL Critical Quality`, lower-weight extension shards, `checks-fast-core`, `checks-node-compat-node22`, `check-prod-types`, and `check-test-types` |
| `blacksmith-8vcpu-ubuntu-2404` | `build-artifacts`, build-smoke, Linux Node test shards, bundled plugin test shards, `check-additional` shards, `android` |
| `blacksmith-16vcpu-ubuntu-2404` | `check-lint` (CPU-sensitive enough that 8 vCPU cost more than they saved); install-smoke Docker builds (32-vCPU queue time cost more than it saved) |
| `blacksmith-16vcpu-windows-2025` | `checks-windows` |
| `blacksmith-6vcpu-macos-latest` | `macos-node` on `openclaw/openclaw`; forks fall back to `macos-latest` |
| `blacksmith-12vcpu-macos-latest` | `macos-swift` on `openclaw/openclaw`; forks fall back to `macos-latest` |
## Local equivalents

View File

@@ -118,7 +118,7 @@ Permission model (client debug mode):
- `read` auto-approval is scoped to the current working directory (`--cwd` when set).
- ACP only auto-approves narrow readonly classes: scoped `read` calls under the active cwd plus readonly search tools (`search`, `web_search`, `memory_search`). Unknown/non-core tools, out-of-scope reads, exec-capable tools, control-plane tools, mutating tools, and interactive flows always require explicit prompt approval.
- Server-provided `toolCall.kind` is treated as untrusted metadata (not an authorization source).
- This ACP bridge policy is separate from ACPX harness permissions. If you run OpenClaw through the `acpx` backend, `plugins.entries.acpx.config.permissionMode=approve-all` is the break-glass yolo switch for that harness session.
- This ACP bridge policy is separate from ACPX harness permissions. If you run OpenClaw through the `acpx` backend, `plugins.entries.acpx.config.permissionMode=approve-all` is the break-glass "yolo" switch for that harness session.
## How to use this
@@ -218,7 +218,7 @@ pull contextual information from an OpenClaw agent without scraping a terminal.
## Zed editor setup
Add a custom ACP agent in `~/.config/zed/settings.json` (or use Zeds Settings UI):
Add a custom ACP agent in `~/.config/zed/settings.json` (or use Zed's Settings UI):
```json
{
@@ -256,7 +256,7 @@ To target a specific Gateway or agent:
}
```
In Zed, open the Agent panel and select OpenClaw ACP to start a thread.
In Zed, open the Agent panel and select "OpenClaw ACP" to start a thread.
## Session mapping

View File

@@ -2,7 +2,7 @@
summary: "CLI reference for `openclaw dns` (wide-area discovery helpers)"
read_when:
- You want wide-area discovery (DNS-SD) via Tailscale + CoreDNS
- Youre setting up split DNS for a custom discovery domain (example: openclaw.internal)
- You're setting up split DNS for a custom discovery domain (example: openclaw.internal)
title: "DNS"
---

View File

@@ -1,7 +1,7 @@
---
summary: "CLI reference for `openclaw health` (gateway health snapshot via RPC)"
read_when:
- You want to quickly check the running Gateways health
- You want to quickly check the running Gateway's health
title: "Health"
---

View File

@@ -164,7 +164,8 @@ openclaw infer model run --local --model ollama/qwen2.5vl:7b --prompt "Describe
Notes:
- Local `model run` is the narrowest CLI smoke for provider/model/auth health because it sends only the supplied prompt to the selected model.
- Local `model run` is the narrowest CLI smoke for provider/model/auth health because, for non-Codex providers, it sends only the supplied prompt to the selected model.
- `openai-codex/*` local probes are the narrow exception: OpenClaw adds a minimal system instruction so the Codex Responses transport can populate its required `instructions` field, without adding full agent context, tools, memory, or session transcript.
- Local `model run --file` keeps that lean path and attaches image content directly to the single user message. Common image files such as PNG, JPEG, and WebP work when their MIME type is detected as `image/*`; unsupported or unrecognized files fail before the provider is called.
- `model run --file` is best when you want to test the selected multimodal text model directly. Use `infer image describe` when you want OpenClaw's image-understanding provider selection and default image-model routing.
- The selected model must support image input; text-only models may reject the request at the provider layer.

View File

@@ -36,7 +36,7 @@ In `--json` output, `auth.providers` is the env/config/store-aware provider
overview, while `auth.oauth` is auth-store profile health only.
Add `--probe` to run live auth probes against each configured provider profile.
Probes are real requests (may consume tokens and trigger rate limits).
Use `--agent <id>` to inspect a configured agents model/auth state. When omitted,
Use `--agent <id>` to inspect a configured agent's model/auth state. When omitted,
the command uses `OPENCLAW_AGENT_DIR`/`PI_CODING_AGENT_DIR` if set, otherwise the
configured default agent.
Probe rows can come from auth profiles, env credentials, or `models.json`.
@@ -176,7 +176,7 @@ provider you choose.
printing token, API-key, or OAuth secret material. Use `--provider <id>` to
filter to one provider, such as `openai-codex`, and `--json` for scripting.
`models auth login` runs a provider plugins auth flow (OAuth/API key). Use
`models auth login` runs a provider plugin's auth flow (OAuth/API key). Use
`openclaw plugins list` to see which providers are installed.
Use `openclaw models auth --agent <id> <subcommand>` to write auth results to a
specific configured agent store. The parent `--agent` flag is honored by

View File

@@ -74,6 +74,7 @@ openclaw plugins search "calendar" # search ClawHub plugins
openclaw plugins install <package> # npm by default
openclaw plugins install clawhub:<package> # ClawHub only
openclaw plugins install npm:<package> # npm only
openclaw plugins install npm-pack:<path.tgz> # local npm pack through npm install semantics
openclaw plugins install git:github.com/<owner>/<repo> # git repo
openclaw plugins install git:github.com/<owner>/<repo>@<ref>
openclaw plugins install <package> --force # overwrite existing install
@@ -150,6 +151,12 @@ is available, then fall back to `latest`.
<Accordion title="Archives">
Supported archives: `.zip`, `.tgz`, `.tar.gz`, `.tar`. Native OpenClaw plugin archives must contain a valid `openclaw.plugin.json` at the extracted plugin root; archives that only contain `package.json` are rejected before OpenClaw writes install records.
Use `npm-pack:<path.tgz>` when the file is an npm-pack tarball and you want
to test the same managed npm-root install path used by registry installs,
including `package-lock.json` verification, hoisted dependency scanning, and
npm install records. Plain archive paths still install as local archives
under the plugin extensions root.
Claude marketplace installs are also supported.
</Accordion>

View File

@@ -38,7 +38,7 @@ openclaw qr --url wss://gateway.example/ws
- In the built-in node/operator bootstrap flow, the primary node token still lands with `scopes: []`.
- If bootstrap handoff also issues an operator token, it stays bounded to the bootstrap allowlist: `operator.approvals`, `operator.read`, `operator.talk.secrets`, `operator.write`.
- Bootstrap scope checks are role-prefixed. That operator allowlist only satisfies operator requests; non-operator roles still need scopes under their own role prefix.
- Mobile pairing fails closed for Tailscale/public `ws://` gateway URLs. Private LAN `ws://` remains supported, but Tailscale/public mobile routes should use Tailscale Serve/Funnel or a `wss://` gateway URL.
- Mobile pairing fails closed for Tailscale/public `ws://` gateway URLs. Private LAN addresses and `.local` Bonjour hosts remain supported over `ws://`, but Tailscale/public mobile routes should use Tailscale Serve/Funnel or a `wss://` gateway URL.
- With `--remote`, OpenClaw requires either `gateway.remote.url` or
`gateway.tailscale.mode=serve|funnel`.
- With `--remote`, if effectively active remote credentials are configured as SecretRefs and you do not pass `--token` or `--password`, the command resolves them from the active gateway snapshot. If gateway is unavailable, the command fails fast.

View File

@@ -2,12 +2,10 @@
summary: "CLI reference for `openclaw status` (diagnostics, probes, usage snapshots)"
read_when:
- You want a quick diagnosis of channel health + recent session recipients
- You want a pasteable all status for debugging
title: "Status"
- You want a pasteable "all" status for debugging
title: "openclaw status"
---
# `openclaw status`
Diagnostics for channels + sessions.
```bash
@@ -34,8 +32,8 @@ Notes:
- Overview includes update channel + git SHA (for source checkouts).
- Update info surfaces in the Overview; if an update is available, status prints a hint to run `openclaw update` (see [Updating](/install/updating)).
- Read-only status surfaces (`status`, `status --json`, `status --all`) resolve supported SecretRefs for their targeted config paths when possible.
- If a supported channel SecretRef is configured but unavailable in the current command path, status stays read-only and reports degraded output instead of crashing. Human output shows warnings such as configured token unavailable in this command path, and JSON output includes `secretDiagnostics`.
- When command-local SecretRef resolution succeeds, status prefers the resolved snapshot and clears transient secret unavailable channel markers from the final output.
- If a supported channel SecretRef is configured but unavailable in the current command path, status stays read-only and reports degraded output instead of crashing. Human output shows warnings such as "configured token unavailable in this command path", and JSON output includes `secretDiagnostics`.
- When command-local SecretRef resolution succeeds, status prefers the resolved snapshot and clears transient "secret unavailable" channel markers from the final output.
- `status --all` includes a Secrets overview row and a diagnosis section that summarizes secret diagnostics (truncated for readability) without stopping report generation.
## Related

View File

@@ -6,8 +6,8 @@ read_when:
title: "Agent loop"
---
An agentic loop is the full real run of an agent: intake → context assembly → model inference →
tool execution → streaming replies → persistence. Its the authoritative path that turns a message
An agentic loop is the full "real" run of an agent: intake → context assembly → model inference →
tool execution → streaming replies → persistence. It's the authoritative path that turns a message
into actions and a final reply, while keeping session state consistent.
In OpenClaw, a loop is a single, serialized run per session that emits lifecycle and stream events
@@ -67,7 +67,7 @@ wired end-to-end.
## Prompt assembly + system prompt
- System prompt is built from OpenClaws base prompt, skills prompt, bootstrap context, and per-run overrides.
- System prompt is built from OpenClaw's base prompt, skills prompt, bootstrap context, and per-run overrides.
- Model-specific limits and compaction reserve tokens are enforced.
- See [System prompt](/concepts/system-prompt) for what the model sees.

View File

@@ -60,40 +60,40 @@ Older installs may have created `~/openclaw`. Keeping multiple workspace directo
These are the standard files OpenClaw expects inside the workspace:
<AccordionGroup>
<Accordion title="AGENTS.md operating instructions">
<Accordion title="AGENTS.md - operating instructions">
Operating instructions for the agent and how it should use memory. Loaded at the start of every session. Good place for rules, priorities, and "how to behave" details.
</Accordion>
<Accordion title="SOUL.md persona and tone">
<Accordion title="SOUL.md - persona and tone">
Persona, tone, and boundaries. Loaded every session. Guide: [SOUL.md personality guide](/concepts/soul).
</Accordion>
<Accordion title="USER.md who the user is">
<Accordion title="USER.md - who the user is">
Who the user is and how to address them. Loaded every session.
</Accordion>
<Accordion title="IDENTITY.md name, vibe, emoji">
<Accordion title="IDENTITY.md - name, vibe, emoji">
The agent's name, vibe, and emoji. Created/updated during the bootstrap ritual.
</Accordion>
<Accordion title="TOOLS.md local tool conventions">
<Accordion title="TOOLS.md - local tool conventions">
Notes about your local tools and conventions. Does not control tool availability; it is only guidance.
</Accordion>
<Accordion title="HEARTBEAT.md heartbeat checklist">
<Accordion title="HEARTBEAT.md - heartbeat checklist">
Optional tiny checklist for heartbeat runs. Keep it short to avoid token burn.
</Accordion>
<Accordion title="BOOT.md startup checklist">
<Accordion title="BOOT.md - startup checklist">
Optional startup checklist run automatically on gateway restart (when [internal hooks](/automation/hooks) are enabled). Keep it short; use the message tool for outbound sends.
</Accordion>
<Accordion title="BOOTSTRAP.md first-run ritual">
<Accordion title="BOOTSTRAP.md - first-run ritual">
One-time first-run ritual. Only created for a brand-new workspace. Delete it after the ritual is complete.
</Accordion>
<Accordion title="memory/YYYY-MM-DD.md daily memory log">
<Accordion title="memory/YYYY-MM-DD.md - daily memory log">
Daily memory log (one file per day). Recommended to read today + yesterday on session start.
</Accordion>
<Accordion title="MEMORY.md curated long-term memory (optional)">
<Accordion title="MEMORY.md - curated long-term memory (optional)">
Curated long-term memory. Only load in the main, private session (not shared/group contexts). See [Memory](/concepts/memory) for the workflow and automatic memory flush.
</Accordion>
<Accordion title="skills/ workspace skills (optional)">
<Accordion title="skills/ - workspace skills (optional)">
Workspace-specific skills. Highest-precedence skill location for that workspace. Overrides project agent skills, personal agent skills, managed skills, bundled skills, and `skills.load.extraDirs` when names collide.
</Accordion>
<Accordion title="canvas/ Canvas UI files (optional)">
<Accordion title="canvas/ - Canvas UI files (optional)">
Canvas UI files for node displays (for example `canvas/index.html`).
</Accordion>
</AccordionGroup>
@@ -224,7 +224,7 @@ Suggested `.gitignore` starter:
## Related
- [Heartbeat](/gateway/heartbeat) HEARTBEAT.md workspace file
- [Sandboxing](/gateway/sandboxing) workspace access in sandboxed environments
- [Session](/concepts/session) session storage paths
- [Standing orders](/automation/standing-orders) persistent instructions in workspace files
- [Heartbeat](/gateway/heartbeat) - HEARTBEAT.md workspace file
- [Sandboxing](/gateway/sandboxing) - workspace access in sandboxed environments
- [Session](/concepts/session) - session storage paths
- [Standing orders](/automation/standing-orders) - persistent instructions in workspace files

View File

@@ -5,14 +5,14 @@ read_when:
title: "Agent runtime"
---
OpenClaw runs a **single embedded agent runtime** one agent process per
OpenClaw runs a **single embedded agent runtime** - one agent process per
Gateway, with its own workspace, bootstrap files, and session store. This page
covers that runtime contract: what the workspace must contain, which files get
injected, and how sessions bootstrap against it.
## Workspace (required)
OpenClaw uses a single agent workspace directory (`agents.defaults.workspace`) as the agents **only** working directory (`cwd`) for tools and context.
OpenClaw uses a single agent workspace directory (`agents.defaults.workspace`) as the agent's **only** working directory (`cwd`) for tools and context.
Recommended: use `openclaw setup` to create `~/.openclaw/openclaw.json` if missing and initialize the workspace files.
@@ -26,18 +26,18 @@ per-session workspaces under `agents.defaults.sandbox.workspaceRoot` (see
Inside `agents.defaults.workspace`, OpenClaw expects these user-editable files:
- `AGENTS.md` operating instructions + memory
- `SOUL.md` persona, boundaries, tone
- `TOOLS.md` user-maintained tool notes (e.g. `imsg`, `sag`, conventions)
- `BOOTSTRAP.md` one-time first-run ritual (deleted after completion)
- `IDENTITY.md` agent name/vibe/emoji
- `USER.md` user profile + preferred address
- `AGENTS.md` - operating instructions + "memory"
- `SOUL.md` - persona, boundaries, tone
- `TOOLS.md` - user-maintained tool notes (e.g. `imsg`, `sag`, conventions)
- `BOOTSTRAP.md` - one-time first-run ritual (deleted after completion)
- `IDENTITY.md` - agent name/vibe/emoji
- `USER.md` - user profile + preferred address
On the first turn of a new session, OpenClaw injects the contents of these files into the system prompt's Project Context.
Blank files are skipped. Large files are trimmed and truncated with a marker so prompts stay lean (read the file for full content).
If a file is missing, OpenClaw injects a single missing file marker line (and `openclaw setup` will create a safe default template).
If a file is missing, OpenClaw injects a single "missing file" marker line (and `openclaw setup` will create a safe default template).
`BOOTSTRAP.md` is only created for a **brand new workspace** (no other bootstrap files present). While it is pending, OpenClaw keeps it in Project Context and adds system-prompt bootstrap guidance for the initial ritual instead of copying it into the user message. If you delete it after completing the ritual, it should not be recreated on later restarts.
@@ -51,7 +51,7 @@ To disable bootstrap file creation entirely (for pre-seeded workspaces), set:
Core tools (read/exec/edit/write and related system tools) are always available,
subject to tool policy. `apply_patch` is optional and gated by
`tools.exec.applyPatch`. `TOOLS.md` does **not** control which tools exist; its
`tools.exec.applyPatch`. `TOOLS.md` does **not** control which tools exist; it's
guidance for how _you_ want them used.
## Skills
@@ -100,7 +100,7 @@ Block streaming sends completed assistant blocks as soon as they finish; it is
**off by default** (`agents.defaults.blockStreamingDefault: "off"`).
Tune the boundary via `agents.defaults.blockStreamingBreak` (`text_end` vs `message_end`; defaults to text_end).
Control soft block chunking with `agents.defaults.blockStreamingChunk` (defaults to
8001200 chars; prefers paragraph breaks, then newlines; sentences last).
800-1200 chars; prefers paragraph breaks, then newlines; sentences last).
Coalesce streamed chunks with `agents.defaults.blockStreamingCoalesce` to reduce
single-line spam (idle-based merging before send). Non-Telegram channels require
explicit `*.blockStreaming: true` to enable block replies.

View File

@@ -7,7 +7,7 @@ title: "Gateway architecture"
## Overview
- A single longlived **Gateway** owns all messaging surfaces (WhatsApp via
- A single long-lived **Gateway** owns all messaging surfaces (WhatsApp via
Baileys, Telegram via grammY, Slack, Discord, Signal, iMessage, WebChat).
- Control-plane clients (macOS app, CLI, web UI, automations) connect to the
Gateway over **WebSocket** on the configured bind host (default
@@ -25,7 +25,7 @@ title: "Gateway architecture"
### Gateway (daemon)
- Maintains provider connections.
- Exposes a typed WS API (requests, responses, serverpush events).
- Exposes a typed WS API (requests, responses, server-push events).
- Validates inbound frames against JSON Schema.
- Emits events like `agent`, `chat`, `presence`, `health`, `heartbeat`, `cron`.
@@ -38,7 +38,7 @@ title: "Gateway architecture"
### Nodes (macOS / iOS / Android / headless)
- Connect to the **same WS server** with `role: node`.
- Provide a device identity in `connect`; pairing is **devicebased** (role `node`) and
- Provide a device identity in `connect`; pairing is **device-based** (role `node`) and
approval lives in the device pairing store.
- Expose commands like `canvas.*`, `camera.*`, `screen.record`, `location.get`.
@@ -90,8 +90,8 @@ sequenceDiagram
instead of `connect.params.auth.*`.
- Private-ingress `gateway.auth.mode: "none"` disables shared-secret auth
entirely; keep that mode off public/untrusted ingress.
- Idempotency keys are required for sideeffecting methods (`send`, `agent`) to
safely retry; the server keeps a shortlived dedupe cache.
- Idempotency keys are required for side-effecting methods (`send`, `agent`) to
safely retry; the server keeps a short-lived dedupe cache.
- Nodes must include `role: "node"` plus caps/commands/permissions in `connect`.
## Pairing + local trust
@@ -109,7 +109,7 @@ sequenceDiagram
- Signature payload `v3` also binds `platform` + `deviceFamily`; the gateway
pins paired metadata on reconnect and requires repair pairing for metadata
changes.
- **Nonlocal** connects still require explicit approval.
- **Non-local** connects still require explicit approval.
- Gateway auth (`gateway.auth.*`) still applies to **all** connections, local or
remote.
@@ -138,12 +138,12 @@ Details: [Gateway protocol](/gateway/protocol), [Pairing](/channels/pairing),
- Start: `openclaw gateway` (foreground, logs to stdout).
- Health: `health` over WS (also included in `hello-ok`).
- Supervision: launchd/systemd for autorestart.
- Supervision: launchd/systemd for auto-restart.
## Invariants
- Exactly one Gateway controls a single Baileys session per host.
- Handshake is mandatory; any nonJSON or nonconnect first frame is a hard close.
- Handshake is mandatory; any non-JSON or non-connect first frame is a hard close.
- Events are not replayed; clients must refresh on gaps.
## Related

View File

@@ -10,7 +10,7 @@ sidebarTitle: "Context engine"
A **context engine** controls how OpenClaw builds model context for each run: which messages to include, how to summarize older history, and how to manage context across subagent boundaries.
OpenClaw ships with a built-in `legacy` engine and uses it by default most users never need to change this. Install and select a plugin engine only when you want different assembly, compaction, or cross-session recall behavior.
OpenClaw ships with a built-in `legacy` engine and uses it by default - most users never need to change this. Install and select a plugin engine only when you want different assembly, compaction, or cross-session recall behavior.
## Quick start
@@ -61,7 +61,7 @@ OpenClaw ships with a built-in `legacy` engine and uses it by default — most u
</Step>
<Step title="Switch back to legacy (optional)">
Set `contextEngine` to `"legacy"` (or remove the key entirely `"legacy"` is the default).
Set `contextEngine` to `"legacy"` (or remove the key entirely - `"legacy"` is the default).
</Step>
</Steps>
@@ -200,13 +200,13 @@ Required members:
<ParamField path="promptAuthority" type='"assembled" | "preassembly_may_overflow"'>
Controls which token estimate the runner uses for preemptive overflow
prechecks. Defaults to `"assembled"`, which means only the assembled
prompt's estimate is checked appropriate for engines that return a
prompt's estimate is checked - appropriate for engines that return a
windowed, self-contained context. Set to `"preassembly_may_overflow"` only
when your assembled view can hide overflow risk in the underlying
transcript; the runner then takes the maximum of the assembled estimate
and the pre-assembly (unwindowed) session-history estimate when deciding
whether to preemptively compact. Either way, the messages you return are
still what the model sees `promptAuthority` only affects the precheck.
still what the model sees - `promptAuthority` only affects the precheck.
</ParamField>
`compact` returns a `CompactResult`. When compaction rotates the active
@@ -222,7 +222,7 @@ Optional members:
| `afterTurn(params)` | Method | Post-run lifecycle work (persist state, trigger background compaction). |
| `prepareSubagentSpawn(params)` | Method | Set up shared state for a child session before it starts. |
| `onSubagentEnded(params)` | Method | Clean up after a subagent ends. |
| `dispose()` | Method | Release resources. Called during gateway shutdown or plugin reload not per-session. |
| `dispose()` | Method | Release resources. Called during gateway shutdown or plugin reload - not per-session. |
### ownsCompaction
@@ -269,7 +269,7 @@ A no-op `compact()` is unsafe for an active non-owning engine because it disable
```
<Note>
The slot is exclusive at run time only one registered context engine is resolved for a given run or compaction operation. Other enabled `kind: "context-engine"` plugins can still load and run their registration code; `plugins.slots.contextEngine` only selects which registered engine id OpenClaw resolves when it needs a context engine.
The slot is exclusive at run time - only one registered context engine is resolved for a given run or compaction operation. Other enabled `kind: "context-engine"` plugins can still load and run their registration code; `plugins.slots.contextEngine` only selects which registered engine id OpenClaw resolves when it needs a context engine.
</Note>
<Note>
@@ -283,7 +283,7 @@ The slot is exclusive at run time — only one registered context engine is reso
Compaction is one responsibility of the context engine. The legacy engine delegates to OpenClaw's built-in summarization. Plugin engines can implement any compaction strategy (DAG summaries, vector retrieval, etc.).
</Accordion>
<Accordion title="Memory plugins">
Memory plugins (`plugins.slots.memory`) are separate from context engines. Memory plugins provide search/retrieval; context engines control what the model sees. They can work together a context engine might use memory plugin data during assembly. Plugin engines that want the active memory prompt path should prefer `buildMemorySystemPromptAddition(...)` from `openclaw/plugin-sdk/core`, which converts the active memory prompt sections into a ready-to-prepend `systemPromptAddition`. If an engine needs lower-level control, it can still pull raw lines from `openclaw/plugin-sdk/memory-host-core` via `buildActiveMemoryPromptSection(...)`.
Memory plugins (`plugins.slots.memory`) are separate from context engines. Memory plugins provide search/retrieval; context engines control what the model sees. They can work together - a context engine might use memory plugin data during assembly. Plugin engines that want the active memory prompt path should prefer `buildMemorySystemPromptAddition(...)` from `openclaw/plugin-sdk/core`, which converts the active memory prompt sections into a ready-to-prepend `systemPromptAddition`. If an engine needs lower-level control, it can still pull raw lines from `openclaw/plugin-sdk/memory-host-core` via `buildActiveMemoryPromptSection(...)`.
</Accordion>
<Accordion title="Session pruning">
Trimming old tool results in-memory still runs regardless of which context engine is active.
@@ -299,8 +299,8 @@ The slot is exclusive at run time — only one registered context engine is reso
## Related
- [Compaction](/concepts/compaction) summarizing long conversations
- [Context](/concepts/context) how context is built for agent turns
- [Plugin Architecture](/plugins/architecture) registering context engine plugins
- [Plugin manifest](/plugins/manifest) plugin manifest fields
- [Plugins](/tools/plugin) plugin overview
- [Compaction](/concepts/compaction) - summarizing long conversations
- [Context](/concepts/context) - how context is built for agent turns
- [Plugin Architecture](/plugins/architecture) - registering context engine plugins
- [Plugin manifest](/plugins/manifest) - plugin manifest fields
- [Plugins](/tools/plugin) - plugin overview

View File

@@ -1,26 +1,26 @@
---
summary: "Context: what the model sees, how it is built, and how to inspect it"
read_when:
- You want to understand what context means in OpenClaw
- You are debugging why the model knows something (or forgot it)
- You want to understand what "context" means in OpenClaw
- You are debugging why the model "knows" something (or forgot it)
- You want to reduce context overhead (/context, /status, /compact)
title: "Context"
---
Context is **everything OpenClaw sends to the model for a run**. It is bounded by the models **context window** (token limit).
"Context" is **everything OpenClaw sends to the model for a run**. It is bounded by the model's **context window** (token limit).
Beginner mental model:
- **System prompt** (OpenClaw-built): rules, tools, skills list, time/runtime, and injected workspace files.
- **Conversation history**: your messages + the assistants messages for this session.
- **Conversation history**: your messages + the assistant's messages for this session.
- **Tool calls/results + attachments**: command output, file reads, images/audio, etc.
Context is _not the same thing_ as memory: memory can be stored on disk and reloaded later; context is whats inside the models current window.
Context is _not the same thing_ as "memory": memory can be stored on disk and reloaded later; context is what's inside the model's current window.
## Quick start (inspect context)
- `/status` → quick how full is my window? view + session settings.
- `/context list` → whats injected + rough sizes (per file + totals).
- `/status` → quick "how full is my window?" view + session settings.
- `/context list` → what's injected + rough sizes (per file + totals).
- `/context detail` → deeper breakdown: per-file, per-tool schema sizes, per-skill entry sizes, and system prompt size.
- `/usage tokens` → append per-reply usage footer to normal replies.
- `/compact` → summarize older history into a compact entry to free window space.
@@ -29,7 +29,7 @@ See also: [Slash commands](/tools/slash-commands), [Token use & costs](/referenc
## Example output
Values vary by model, provider, tool policy, and whats in your workspace.
Values vary by model, provider, tool policy, and what's in your workspace.
### `/context list`
@@ -83,7 +83,7 @@ Everything the model receives counts, including:
- Tool calls + tool results.
- Attachments/transcripts (images/audio/files).
- Compaction summaries and pruning artifacts.
- Provider wrappers or hidden headers (not visible, still counted).
- Provider "wrappers" or hidden headers (not visible, still counted).
## How OpenClaw builds the system prompt
@@ -118,14 +118,14 @@ When truncation occurs, the runtime can inject an in-prompt warning block under
The system prompt includes a compact **skills list** (name + description + location). This list has real overhead.
Skill instructions are _not_ included by default. The model is expected to `read` the skills `SKILL.md` **only when needed**.
Skill instructions are _not_ included by default. The model is expected to `read` the skill's `SKILL.md` **only when needed**.
## Tools: there are two costs
Tools affect context in two ways:
1. **Tool list text** in the system prompt (what you see as Tooling).
2. **Tool schemas** (JSON). These are sent to the model so it can call tools. They count toward context even though you dont see them as plain text.
1. **Tool list text** in the system prompt (what you see as "Tooling").
2. **Tool schemas** (JSON). These are sent to the model so it can call tools. They count toward context even though you don't see them as plain text.
`/context detail` breaks down the biggest tool schemas so you can see what dominates.
@@ -137,7 +137,7 @@ Slash commands are handled by the Gateway. There are a few different behaviors:
- **Directives**: `/think`, `/verbose`, `/trace`, `/reasoning`, `/elevated`, `/model`, `/queue` are stripped before the model sees the message.
- Directive-only messages persist session settings.
- Inline directives in a normal message act as per-message hints.
- **Inline shortcuts** (allowlisted senders only): certain `/...` tokens inside a normal message can run immediately (example: hey /status), and are stripped before the model sees the remaining text.
- **Inline shortcuts** (allowlisted senders only): certain `/...` tokens inside a normal message can run immediately (example: "hey /status"), and are stripped before the model sees the remaining text.
Details: [Slash commands](/tools/slash-commands).
@@ -147,7 +147,7 @@ What persists across messages depends on the mechanism:
- **Normal history** persists in the session transcript until compacted/pruned by policy.
- **Compaction** persists a summary into the transcript and keeps recent messages intact.
- **Pruning** drops old tool results from the _in-memory_ prompt to free context-window space, but does not rewrite the session transcript the full history is still inspectable on disk.
- **Pruning** drops old tool results from the _in-memory_ prompt to free context-window space, but does not rewrite the session transcript - the full history is still inspectable on disk.
Docs: [Session](/concepts/session), [Compaction](/concepts/compaction), [Session pruning](/concepts/session-pruning).
@@ -165,13 +165,23 @@ pluggable interface, lifecycle hooks, and configuration.
`/context` prefers the latest **run-built** system prompt report when available:
- `System prompt (run)` = captured from the last embedded (tool-capable) run and persisted in the session store.
- `System prompt (estimate)` = computed on the fly when no run report exists (or when running via a CLI backend that doesnt generate the report).
- `System prompt (estimate)` = computed on the fly when no run report exists (or when running via a CLI backend that doesn't generate the report).
Either way, it reports sizes and top contributors; it does **not** dump the full system prompt or tool schemas.
## Related
- [Context Engine](/concepts/context-engine) — custom context injection via plugins
- [Compaction](/concepts/compaction) — summarizing long conversations
- [System Prompt](/concepts/system-prompt) — how the system prompt is built
- [Agent Loop](/concepts/agent-loop) — the full agent execution cycle
<CardGroup cols={2}>
<Card title="Context engine" href="/concepts/context-engine" icon="puzzle-piece">
Custom context injection via plugins.
</Card>
<Card title="Compaction" href="/concepts/compaction" icon="compress">
Summarizing long conversations to keep them inside the model window.
</Card>
<Card title="System prompt" href="/concepts/system-prompt" icon="message-lines">
How the system prompt is built and what it injects each turn.
</Card>
<Card title="Agent loop" href="/concepts/agent-loop" icon="arrows-rotate">
The full agent execution cycle from inbound message to final reply.
</Card>
</CardGroup>

View File

@@ -5,7 +5,7 @@ read_when: "You want an agent with its own identity that acts on behalf of human
status: active
---
Goal: run OpenClaw as a **named delegate** an agent with its own identity that acts "on behalf of" people in an organization. The agent never impersonates a human. It sends, reads, and schedules under its own account with explicit delegation permissions.
Goal: run OpenClaw as a **named delegate** - an agent with its own identity that acts "on behalf of" people in an organization. The agent never impersonates a human. It sends, reads, and schedules under its own account with explicit delegation permissions.
This extends [Multi-Agent Routing](/concepts/multi-agent) from personal use into organizational deployments.
@@ -14,15 +14,15 @@ This extends [Multi-Agent Routing](/concepts/multi-agent) from personal use into
A **delegate** is an OpenClaw agent that:
- Has its **own identity** (email address, display name, calendar).
- Acts **on behalf of** one or more humans never pretends to be them.
- Acts **on behalf of** one or more humans - never pretends to be them.
- Operates under **explicit permissions** granted by the organization's identity provider.
- Follows **[standing orders](/automation/standing-orders)** rules defined in the agent's `AGENTS.md` that specify what it may do autonomously vs. what requires human approval (see [Cron Jobs](/automation/cron-jobs) for scheduled execution).
- Follows **[standing orders](/automation/standing-orders)** - rules defined in the agent's `AGENTS.md` that specify what it may do autonomously vs. what requires human approval (see [Cron Jobs](/automation/cron-jobs) for scheduled execution).
The delegate model maps directly to how executive assistants work: they have their own credentials, send mail "on behalf of" their principal, and follow a defined scope of authority.
## Why delegates?
OpenClaw's default mode is a **personal assistant** one human, one agent. Delegates extend this to organizations:
OpenClaw's default mode is a **personal assistant** - one human, one agent. Delegates extend this to organizations:
| Personal mode | Delegate mode |
| --------------------------- | ---------------------------------------------- |
@@ -48,7 +48,7 @@ The delegate can **read** organizational data and **draft** messages for human r
- Calendar: read events, surface conflicts, summarize the day.
- Files: read shared documents, summarize content.
This tier requires only read permissions from the identity provider. The agent does not write to any mailbox or calendar drafts and proposals are delivered via chat for the human to act on.
This tier requires only read permissions from the identity provider. The agent does not write to any mailbox or calendar - drafts and proposals are delivered via chat for the human to act on.
### Tier 2: Send on Behalf
@@ -93,7 +93,7 @@ These rules load every session. They are the last line of defense regardless of
### Tool restrictions
Use per-agent tool policy (v2026.1.6+) to enforce boundaries at the Gateway level. This operates independently of the agent's personality files even if the agent is instructed to bypass its rules, the Gateway blocks the tool call:
Use per-agent tool policy (v2026.1.6+) to enforce boundaries at the Gateway level. This operates independently of the agent's personality files - even if the agent is instructed to bypass its rules, the Gateway blocks the tool call:
```json5
{
@@ -159,7 +159,7 @@ Configure the delegate's personality in its workspace files:
### 2. Configure identity provider delegation
The delegate needs its own account in your identity provider with explicit delegation permissions. **Apply the principle of least privilege** start with Tier 1 (read-only) and escalate only when the use case demands it.
The delegate needs its own account in your identity provider with explicit delegation permissions. **Apply the principle of least privilege** - start with Tier 1 (read-only) and escalate only when the use case demands it.
#### Microsoft 365
@@ -286,7 +286,7 @@ A complete delegate configuration for an organizational assistant that handles e
}
```
The delegate's `AGENTS.md` defines its autonomous authority what it may do without asking, what requires approval, and what is forbidden. [Cron Jobs](/automation/cron-jobs) drive its daily schedule.
The delegate's `AGENTS.md` defines its autonomous authority - what it may do without asking, what requires approval, and what is forbidden. [Cron Jobs](/automation/cron-jobs) drive its daily schedule.
If you grant `sessions_history`, remember it is a bounded, safety-filtered
recall view. OpenClaw redacts credential/token-like text, truncates long
@@ -304,13 +304,13 @@ instead of returning a raw transcript dump.
The delegate model works for any small organization:
1. **Create one delegate agent** per organization.
2. **Harden first** tool restrictions, sandbox, hard blocks, audit trail.
2. **Harden first** - tool restrictions, sandbox, hard blocks, audit trail.
3. **Grant scoped permissions** via the identity provider (least privilege).
4. **Define [standing orders](/automation/standing-orders)** for autonomous operations.
5. **Schedule cron jobs** for recurring tasks.
6. **Review and adjust** the capability tier as trust builds.
Multiple organizations can share one Gateway server using multi-agent routing each org gets its own isolated agent, workspace, and credentials.
Multiple organizations can share one Gateway server using multi-agent routing - each org gets its own isolated agent, workspace, and credentials.
## Related

View File

@@ -21,67 +21,11 @@ Treat them differently from normal config:
## Currently documented flags
| Surface | Key | Use it when | More |
| ------------------------------- | --------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| Local model runtime | `agents.defaults.experimental.localModelLean` | A smaller or stricter local backend chokes on OpenClaw's full default tool surface | [Local Models](/gateway/local-models) |
| Agent command runtime isolation | `agents.defaults.experimental.runtimeIsolation` | You want `/agent` command attempts to run in a Node worker compartment while testing parallel-agent isolation | [Agent command runtime isolation](#agent-command-runtime-isolation) |
| Memory search | `agents.defaults.memorySearch.experimental.sessionMemory` | You want `memory_search` to index prior session transcripts and accept the extra storage/indexing cost | [Memory configuration reference](/reference/memory-config#session-memory-search-experimental) |
| Structured planning tool | `tools.experimental.planTool` | You want the structured `update_plan` tool exposed for multi-step work tracking in compatible runtimes and UIs | [Gateway configuration reference](/gateway/config-tools#toolsexperimental) |
## Agent command runtime isolation
`agents.defaults.experimental.runtimeIsolation.mode: "worker"` runs `/agent`
command attempts in a Node worker thread. The parent process still owns command
routing, model fallback policy, final session-store updates, delivery, and
lifecycle reporting; the worker owns the in-repo command runtime attempt itself.
Normal inbound Gateway replies remain on the in-process embedded runner for now.
That path owns live streaming and delivery callbacks in the parent process and
needs a dedicated callback bridge before it can move into this worker
compartment.
This is a compartment boundary, not a general speed switch. It can help when
several in-repo command agents run at once and you want each run to have its own
event loop, worker lifetime, and future filesystem permission scope. It will not
make remote model calls faster, and CLI/ACP harnesses such as Codex may still
spawn their own child processes inside the worker.
Session-store writes still go through the normal `updateSessionStore(...)` path.
That writer uses a `sessions.json.lock` file lock so worker-thread updates for
different agents do not overwrite each other when they share the same store.
### Enable
```json5
{
agents: {
defaults: {
experimental: {
runtimeIsolation: {
mode: "worker",
},
},
},
},
}
```
For developer-only overrides, `OPENCLAW_AGENT_RUNTIME_WORKER=1` forces the
worker path and `OPENCLAW_AGENT_RUNTIME_WORKER=0` forces the in-process path.
The older `OPENCLAW_AGENT_WORKER_EXPERIMENT` env var is also accepted while the
experiment is in flight.
### Worker permissions
`runtimeIsolation.permissions: true` also starts the worker with Node permission
flags scoped to the agent workspace, agent directory, session transcript,
session store and lock files, OpenClaw runtime bundle/development source,
bundled plugin source, and runtime dependencies.
Keep this off unless you are explicitly testing filesystem hardening. Node
permission behavior is stricter and more runtime-sensitive than worker
isolation itself, so package reads or child-process based harnesses may need
additional design before this becomes broadly usable.
| Surface | Key | Use it when | More |
| ------------------------ | --------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| Local model runtime | `agents.defaults.experimental.localModelLean` | A smaller or stricter local backend chokes on OpenClaw's full default tool surface | [Local Models](/gateway/local-models) |
| Memory search | `agents.defaults.memorySearch.experimental.sessionMemory` | You want `memory_search` to index prior session transcripts and accept the extra storage/indexing cost | [Memory configuration reference](/reference/memory-config#session-memory-search-experimental) |
| Structured planning tool | `tools.experimental.planTool` | You want the structured `update_plan` tool exposed for multi-step work tracking in compatible runtimes and UIs | [Gateway configuration reference](/gateway/config-tools#toolsexperimental) |
## Local model lean mode

View File

@@ -75,5 +75,17 @@ title: "Features"
## Related
- [Experimental features](/concepts/experimental-features)
- [Agent runtime](/concepts/agent)
<CardGroup cols={2}>
<Card title="Experimental features" href="/concepts/experimental-features" icon="flask">
Opt-in features that have not yet shipped to the default surface.
</Card>
<Card title="Agent runtime" href="/concepts/agent" icon="robot">
Agent runtime model and how runs are dispatched.
</Card>
<Card title="Channels" href="/channels" icon="message-square">
Connect Telegram, WhatsApp, Discord, Slack, and more from one Gateway.
</Card>
<Card title="Plugins" href="/tools/plugin" icon="plug">
Bundled and third-party plugins that extend OpenClaw.
</Card>
</CardGroup>

View File

@@ -5,7 +5,7 @@ read_when:
- Debugging slow Mantis Slack desktop runs
- Choosing source, prehydrated, or warm-lease mode
- Posting screenshot and video evidence to a PR
title: "Mantis Slack Desktop Runbook"
title: "Mantis Slack desktop runbook"
---
Mantis Slack desktop QA is the real-UI lane for Slack-class bugs that need a
@@ -14,7 +14,7 @@ videos, and a PR evidence comment.
Use it when unit tests or the headless Slack live lane cannot prove the bug.
## Storage Model
## Storage model
Mantis uses three different storage layers:
@@ -31,7 +31,7 @@ Mantis uses three different storage layers:
Never put secrets, browser cookies, Slack login state, repository checkouts,
`node_modules`, or `dist/` into a prebaked provider image.
## GitHub Dispatch
## GitHub dispatch
Run the workflow from `main`:
@@ -116,7 +116,7 @@ Use `--hydrate-mode prehydrated` only when the reused remote workspace already
has `node_modules` and a built `dist/`. Mantis fails closed if those are
missing.
## Hydrate Modes
## Hydrate modes
| Mode | Use when | Remote behavior | Tradeoff |
| ------------- | ----------------------------------------- | ------------------------------------------------------------------------------------- | -------------------------------------------------------- |
@@ -127,7 +127,7 @@ GitHub Actions always prepares the candidate checkout before the VM run. Its
pnpm store is cached by OS, Node version, and lockfile. The VM source run also
uses `/var/cache/crabbox/pnpm` when present.
## Timing Interpretation
## Timing interpretation
`mantis-slack-desktop-smoke-report.md` includes phase timings:
@@ -152,7 +152,7 @@ If the run is slow:
ready, or the gateway/browser/Slack setup is slow;
- artifact copy dominates: inspect video size and artifact directory contents.
## Evidence Checklist
## Evidence checklist
A good PR comment should show:
@@ -168,7 +168,7 @@ A good PR comment should show:
Do not commit screenshots or videos into the repository. Keep them in GitHub
Actions artifacts or the PR comment.
## Failure Handling
## Failure handling
If the workflow fails before the VM run, inspect the Actions job first. Typical
causes are untrusted `candidate_ref`, missing environment secrets, or candidate
@@ -195,8 +195,8 @@ crabbox stop --provider aws <cbx_id-or-slug>
If Slack login expired, repair it in VNC on a kept lease and rerun with
`--lease-id`. Do not bake that browser profile into a provider image.
Related docs:
## Related
- [QA overview](qa-e2e-automation.md)
- [Slack channel](../channels/slack.md)
- [Testing](../help/testing.md)
- [QA overview](/concepts/qa-e2e-automation)
- [Slack channel](/channels/slack)
- [Testing](/help/testing)

View File

@@ -33,7 +33,7 @@ browser UI where humans can visually confirm what the transport showed.
- Post concise status to an operator Discord channel when the run is blocked,
needs manual VNC help, or finishes.
## Non Goals
## Non goals
- Mantis is not a replacement for unit tests. A Mantis run should usually become
a smaller regression test after the fix is understood.
@@ -62,7 +62,7 @@ Mantis lives in the OpenClaw QA stack.
This boundary keeps transport knowledge in OpenClaw, machine scheduling in
Crabbox, and maintainer workflow glue in ClawSweeper.
## Command Shape
## Command shape
The first local command verifies the Discord bot, guild, channel, message send,
reaction send, and artifact path:
@@ -125,9 +125,31 @@ Useful desktop smoke flags:
- `--lease-id <cbx_...>` or `OPENCLAW_MANTIS_CRABBOX_LEASE_ID` reuses a warmed desktop.
- `--browser-url <url>` changes the page opened in the visible browser.
- `--html-file <path>` renders a repo-local HTML artifact in the visible browser. Mantis uses this to capture the generated Discord status-reaction timeline through a real Crabbox desktop.
- `--browser-profile-dir <remote-path>` reuses a remote Chrome user-data-dir so a persistent Mantis desktop can stay logged in between runs. Use this for the long-lived Discord Web viewer profile.
- `--browser-profile-archive-env <name>` restores a base64 `.tgz` Chrome user-data-dir archive from the named environment variable before launching the browser. Use this for logged-in witnesses such as Discord Web. The default env var is `OPENCLAW_MANTIS_BROWSER_PROFILE_TGZ_B64`.
- `--video-duration <seconds>` controls the MP4 capture length. Use a longer duration for slow logged-in web apps that need time to settle.
- `--keep-lease` or `OPENCLAW_MANTIS_KEEP_VM=1` keeps a newly created passing lease open for VNC inspection. Failed runs keep the lease by default when one was created so an operator can reconnect.
- `--class`, `--idle-timeout`, and `--ttl` tune machine size and lease lifetime.
For Discord Web evidence, Mantis uses a dedicated viewer account instead of a
bot token. The live Discord API scenario remains the oracle: it creates the real
thread, sends the SUT `thread-reply`, and checks the attachment through Discord
REST. When `OPENCLAW_QA_DISCORD_CAPTURE_UI_METADATA=1` is set, the scenario also
writes a Discord Web URL artifact. When `OPENCLAW_QA_DISCORD_KEEP_THREADS=1` is
set, it leaves that thread available long enough for a logged-in browser to open
and record it.
The GitHub workflow opens the candidate thread URL in Discord Web, captures a
screenshot, records an MP4, and generates a trimmed GIF preview when Crabbox
media tooling is available. Prefer a persistent viewer profile path configured
through `MANTIS_DISCORD_VIEWER_CHROME_PROFILE_DIR`, because full Chrome profile
archives can outgrow GitHub's secret-size limit. For small/bootstrap profiles,
the workflow can also restore a base64 `.tgz` archive from
`MANTIS_DISCORD_VIEWER_CHROME_PROFILE_TGZ_B64`. If neither profile source is
configured, the workflow still publishes the deterministic baseline/candidate
attachment screenshots and logs a notice that the logged-in Discord Web witness
was skipped.
The first full desktop transport primitive is the Slack desktop smoke:
```bash
@@ -295,7 +317,7 @@ The first command is explicit and scenario-focused. The second can later map a P
or issue to recommended Mantis scenarios from labels, changed files, and
ClawSweeper review findings.
## Run Lifecycle
## Run lifecycle
1. Acquire credentials.
2. Allocate or reuse a VM.
@@ -390,7 +412,7 @@ polls the real Discord triggering message and expects the observed sequence
`discord-status-reactions-tool-only-timeline.html`, and
`discord-status-reactions-tool-only-timeline.png`.
## Existing QA Pieces
## Existing QA pieces
Mantis should build on the existing private QA stack instead of starting from
zero:
@@ -408,7 +430,7 @@ zero:
The first Mantis implementation can be a thin before/after runner over these
pieces, plus one visual evidence layer.
## Evidence Model
## Evidence model
Every run writes a stable artifact directory:
@@ -451,7 +473,7 @@ private channel names, user names, or message content may appear. For public PRs
prefer GitHub Actions artifact links over inline images until the redaction story
is stronger.
## Browser And VNC
## Browser and VNC
The browser lane has two modes:
@@ -539,7 +561,7 @@ guild, channel, and message ids. The GitHub smoke workflow enables
If a token is accidentally pasted into an issue, PR, chat, or log, rotate it
after the new secret has been stored.
## GitHub Artifacts And PR Comments
## GitHub artifacts and PR comments
Mantis workflows should upload the full evidence bundle as a short-lived Actions
artifact. When the workflow is run for a bug report or fix PR, it should also
@@ -578,7 +600,7 @@ candidate showed the expected queued -> thinking -> done sequence.
When the run fails because the harness failed, the comment must say that instead
of implying the candidate failed.
## Private Deployment Notes
## Private deployment notes
A private deployment may already have a Mantis Discord application. Reuse that
application instead of creating another app when it has the right bot
@@ -592,7 +614,7 @@ Do not put guild ids, channel ids, bot tokens, browser cookies, or VNC passwords
in this document. Store them in GitHub secrets, the credential broker, or the
operator's local secret store.
## Adding A Scenario
## Adding a scenario
A Mantis scenario should declare:
@@ -621,7 +643,7 @@ Scenarios should prefer small, typed oracles:
Vision checks should be additive. If a platform API can prove the bug, use the
API as the pass/fail oracle and keep screenshots for human confidence.
## Provider Expansion
## Provider expansion
After Discord, the same runner can add:
@@ -635,7 +657,7 @@ After Discord, the same runner can add:
Each transport should have one cheap smoke scenario and one or more bug-class
scenarios. Expensive visual scenarios should stay opt-in.
## Open Questions
## Open questions
- Which Discord bot should be the driver, and which should be the SUT, when the
existing Mantis bot is reused?

View File

@@ -39,14 +39,14 @@ stay consistent across channels.
Input Markdown:
```markdown
Hello **world** see [docs](https://docs.openclaw.ai).
Hello **world** - see [docs](https://docs.openclaw.ai).
```
IR (schematic):
```json
{
"text": "Hello world see docs.",
"text": "Hello world - see docs.",
"styles": [{ "start": 6, "end": 11, "style": "bold" }],
"links": [{ "start": 19, "end": 23, "href": "https://docs.openclaw.ai" }]
}
@@ -129,5 +129,11 @@ SPOILER style ranges. Other channels treat them as plain text.
## Related
- [Streaming and chunking](/concepts/streaming)
- [System prompt](/concepts/system-prompt)
<CardGroup cols={2}>
<Card title="Streaming and chunking" href="/concepts/streaming" icon="bars-staggered">
Outbound streaming behavior, chunk boundaries, and channel-specific delivery.
</Card>
<Card title="System prompt" href="/concepts/system-prompt" icon="message-lines">
What the model sees before the conversation, including injected workspace files.
</Card>
</CardGroup>

View File

@@ -75,7 +75,7 @@ non-durable policy.
- Structured OpenClaw-origin metadata for operational/system output so visible
gateway failures do not re-enter shared bot-enabled rooms as fresh prompts.
## Non Goals
## Non goals
- Do not remove `runtime.channel.turn.*` in the first phase.
- Do not force every channel into the same native transport behavior.
@@ -84,7 +84,7 @@ non-durable policy.
- Do not publish all internal migration helpers as stable SDK API.
- Do not make retries replay completed non-idempotent platform operations.
## Reference Model
## Reference model
Vercel Chat has a good public mental model:
@@ -114,7 +114,7 @@ What OpenClaw needs beyond that model:
`thread.post()` style promises are not enough for OpenClaw. They hide the
transaction boundary that decides whether a send is recoverable.
## Core Model
## Core model
The new domain should live under an internal core namespace such as
`src/channels/message/*`.
@@ -137,7 +137,7 @@ core.messages.state(...)
`state` owns durable intent storage, receipts, idempotency, recovery, locks, and
dedupe.
## Message Terms
## Message terms
### Message
@@ -284,7 +284,7 @@ A receipt can describe one platform message or a multi-part delivery. Chunked
text, media plus text, voice plus text, and card fallbacks must preserve all
platform ids while still exposing a primary id for threading and later edits.
## Receive Context
## Receive context
Receiving should not be a bare helper call. The core needs a context that knows
dedupe, routing, session recording, and platform ack policy.
@@ -382,7 +382,7 @@ source if we need platform-level redelivery beyond OpenClaw's restart
watermark. Webhook platforms may need immediate HTTP ack, but they still need
inbound dedupe and durable outbound send intents because webhooks can redeliver.
## Send Context
## Send context
Sending is also context based:
@@ -504,7 +504,7 @@ fallback with no durable record for the remaining payloads. Recovery must know
which units already have receipts and either replay only missing units or mark
the batch `unknown_after_send` until the adapter reconciles it.
## Live Context
## Live context
Preview, edit, progress, and stream behavior should be one opt-in lifecycle.
@@ -552,7 +552,7 @@ This should cover current behavior:
- Teams native progress stream.
- QQ Bot stream or accumulated fallback.
## Adapter Surface
## Adapter surface
The public SDK target should be one subpath:
@@ -651,7 +651,7 @@ type MessageCapabilities = {
};
```
## Public SDK Reduction
## Public SDK reduction
The new public surface should absorb or deprecate these conceptual areas:
@@ -672,7 +672,7 @@ Bundled plugins may keep internal helper imports through reserved runtime
subpaths while migrating. Public docs should steer plugin authors to
`plugin-sdk/channel-message` once it exists.
## Relationship To Channel Turn
## Relationship to channel turn
`runtime.channel.turn.*` should stay during migration.
@@ -699,7 +699,7 @@ After all bundled plugins and known third-party compatibility paths are bridged,
published SDK migration path and contract tests proving old plugins still work
or fail with a clear version error.
## Compatibility Guardrails
## Compatibility guardrails
During migration, generic durable delivery is opt-in for any channel whose
existing delivery callback has side effects beyond "send this payload".
@@ -775,7 +775,7 @@ Concrete migration hazards to preserve:
Channels must not implement this with visible-text prefix filters except as a
short emergency stopgap; the durable contract is structured origin metadata.
## Internal Storage
## Internal storage
The durable queue should store message send intents, not reply payloads.
@@ -822,7 +822,7 @@ load pending or sending intents
The queue should keep enough identity to replay through the same account,
thread, target, formatting policy, and media rules after restart.
## Failure Classes
## Failure classes
Channel adapters classify transport failures into closed categories:
@@ -852,7 +852,7 @@ Core policy:
commit becomes `unknown_after_send` unless the adapter can prove the platform
operation did not happen.
## Channel Mapping
## Channel mapping
| Channel | Target migration |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -879,7 +879,7 @@ Core policy:
| Zalo | Simple receive plus send adapter. |
| Zalo Personal | Simple receive plus send adapter. |
## Migration Plan
## Migration plan
### Phase 1: Internal Message Domain
@@ -984,7 +984,7 @@ messages".
- Remove or hide old internal helpers only after no bundled plugin needs them
and third-party contracts have a stable replacement.
## Test Plan
## Test plan
Unit tests:
@@ -1067,7 +1067,7 @@ Validation:
- Live or qa-channel smoke for at least one edit-capable channel and one
simple send-only channel before removing compatibility wrappers.
## Open Questions
## Open questions
- Whether Telegram should eventually replace the grammY runner source with a
fully durable polling source that can control platform-level redelivery, not
@@ -1086,7 +1086,7 @@ Validation:
- Which channels have native origin metadata, which need persisted outbound
registries, and which cannot offer reliable cross-bot echo suppression.
## Acceptance Criteria
## Acceptance criteria
- Every bundled message channel sends final visible output through
`messages.send`.

View File

@@ -181,7 +181,7 @@ Details: [Configuration](/gateway/config-agents#messages) and channel docs.
## Silent replies
The exact silent token `NO_REPLY` / `no_reply` means do not deliver a user-visible reply.
The exact silent token `NO_REPLY` / `no_reply` means "do not deliver a user-visible reply".
When a turn also has pending tool media, such as generated TTS audio, OpenClaw
strips the silent text but still delivers the media attachment.
OpenClaw resolves that behavior by conversation type:

View File

@@ -106,7 +106,7 @@ When a provider has multiple profiles, OpenClaw chooses an order like this:
</Step>
</Steps>
If no explicit order is configured, OpenClaw uses a roundrobin order:
If no explicit order is configured, OpenClaw uses a round-robin order:
- **Primary key:** profile type (**OAuth before API keys**).
- **Secondary key:** `usageStats.lastUsed` (oldest first, within each type).
@@ -128,7 +128,7 @@ Auto-pinned profiles (selected by the session router) are treated as a **prefere
### Why OAuth can "look lost"
If you have both an OAuth profile and an API key profile for the same provider, roundrobin can switch between them across messages unless pinned. To force a single profile:
If you have both an OAuth profile and an API key profile for the same provider, round-robin can switch between them across messages unless pinned. To force a single profile:
- Pin with `auth.order[provider] = ["provider:profileId"]`, or
- Use a per-session override via `/model …` with a profile override (when supported by your UI/chat surface).

View File

@@ -82,7 +82,7 @@ Provider-owned runner behavior lives on explicit provider hooks such as replay p
## Built-in providers (pi-ai catalog)
OpenClaw ships with the piai catalog. These providers require **no** `models.providers` config; just set auth + pick a model.
OpenClaw ships with the pi-ai catalog. These providers require **no** `models.providers` config; just set auth + pick a model.
### OpenAI
@@ -150,6 +150,7 @@ Anthropic staff told us OpenClaw-style Claude CLI usage is allowed again, so Ope
- Policy note: OpenAI Codex OAuth is explicitly supported for external tools/workflows like OpenClaw.
- For the common subscription plus native Codex runtime route, sign in with `openai-codex` auth but configure `openai/gpt-5.5` plus `agents.defaults.agentRuntime.id: "codex"`.
- Use `openai-codex/gpt-5.5` only when you want the Codex OAuth/subscription route through PI; use `openai/gpt-5.5` without the Codex runtime override when your API-key setup and local catalog expose the public API route.
- Older `openai-codex/gpt-5.1*`, `openai-codex/gpt-5.2*`, and `openai-codex/gpt-5.3*` refs are suppressed because ChatGPT/Codex OAuth accounts reject them; use `openai-codex/gpt-5.5` or the native Codex runtime route instead.
```json5
{
@@ -295,11 +296,11 @@ See [/providers/kilocode](/providers/kilocode) for setup details.
| ----------------------- | -------------------------------- | ------------------------------------------------------------ | --------------------------------------------- |
| BytePlus | `byteplus` / `byteplus-plan` | `BYTEPLUS_API_KEY` | `byteplus-plan/ark-code-latest` |
| Cerebras | `cerebras` | `CEREBRAS_API_KEY` | `cerebras/zai-glm-4.7` |
| Cloudflare AI Gateway | `cloudflare-ai-gateway` | `CLOUDFLARE_AI_GATEWAY_API_KEY` | |
| Cloudflare AI Gateway | `cloudflare-ai-gateway` | `CLOUDFLARE_AI_GATEWAY_API_KEY` | - |
| DeepInfra | `deepinfra` | `DEEPINFRA_API_KEY` | `deepinfra/deepseek-ai/DeepSeek-V3.2` |
| DeepSeek | `deepseek` | `DEEPSEEK_API_KEY` | `deepseek/deepseek-v4-flash` |
| GitHub Copilot | `github-copilot` | `COPILOT_GITHUB_TOKEN` / `GH_TOKEN` / `GITHUB_TOKEN` | |
| Groq | `groq` | `GROQ_API_KEY` | |
| GitHub Copilot | `github-copilot` | `COPILOT_GITHUB_TOKEN` / `GH_TOKEN` / `GITHUB_TOKEN` | - |
| Groq | `groq` | `GROQ_API_KEY` | - |
| Hugging Face Inference | `huggingface` | `HUGGINGFACE_HUB_TOKEN` or `HF_TOKEN` | `huggingface/deepseek-ai/DeepSeek-R1` |
| Kilo Gateway | `kilocode` | `KILOCODE_API_KEY` | `kilocode/kilo/auto` |
| Kimi Coding | `kimi` | `KIMI_API_KEY` or `KIMICODE_API_KEY` | `kimi/kimi-code` |
@@ -312,7 +313,7 @@ See [/providers/kilocode](/providers/kilocode) for setup details.
| Qwen Cloud | `qwen` | `QWEN_API_KEY` / `MODELSTUDIO_API_KEY` / `DASHSCOPE_API_KEY` | `qwen/qwen3.5-plus` |
| StepFun | `stepfun` / `stepfun-plan` | `STEPFUN_API_KEY` | `stepfun/step-3.5-flash` |
| Together | `together` | `TOGETHER_API_KEY` | `together/moonshotai/Kimi-K2.5` |
| Venice | `venice` | `VENICE_API_KEY` | |
| Venice | `venice` | `VENICE_API_KEY` | - |
| Vercel AI Gateway | `vercel-ai-gateway` | `AI_GATEWAY_API_KEY` | `vercel-ai-gateway/anthropic/claude-opus-4.6` |
| Volcano Engine (Doubao) | `volcengine` / `volcengine-plan` | `VOLCANO_ENGINE_API_KEY` | `volcengine-plan/ark-code-latest` |
| xAI | `xai` | `XAI_API_KEY` | `xai/grok-4.3` |
@@ -343,7 +344,7 @@ See [/providers/kilocode](/providers/kilocode) for setup details.
## Providers via `models.providers` (custom/base URL)
Use `models.providers` (or `models.json`) to add **custom** providers or OpenAI/Anthropiccompatible proxies.
Use `models.providers` (or `models.json`) to add **custom** providers or OpenAI/Anthropic-compatible proxies.
Many of the bundled provider plugins below already publish a default catalog. Use explicit `models.providers.<id>` entries only when you want to override the default base URL, headers, or model list.
@@ -635,7 +636,7 @@ See [/providers/sglang](/providers/sglang) for details.
### Local proxies (LM Studio, vLLM, LiteLLM, etc.)
Example (OpenAIcompatible):
Example (OpenAI-compatible):
```json5
{
@@ -708,7 +709,7 @@ See also: [Configuration](/gateway/configuration) for full configuration example
## Related
- [Configuration reference](/gateway/config-agents#agent-defaults) model config keys
- [Model failover](/concepts/model-failover) fallback chains and retry behavior
- [Models](/concepts/models) model configuration and aliases
- [Providers](/providers) per-provider setup guides
- [Configuration reference](/gateway/config-agents#agent-defaults) - model config keys
- [Model failover](/concepts/model-failover) - fallback chains and retry behavior
- [Models](/concepts/models) - model configuration and aliases
- [Providers](/providers) - per-provider setup guides

View File

@@ -8,7 +8,7 @@ read_when:
title: "OAuth"
---
OpenClaw supports subscription auth via OAuth for providers that offer it
OpenClaw supports "subscription auth" via OAuth for providers that offer it
(notably **OpenAI Codex (ChatGPT OAuth)**). For Anthropic, the practical split
is now:
@@ -25,7 +25,7 @@ For Anthropic in production, API key auth is the safer recommended path.
- where tokens are **stored** (and why)
- how to handle **multiple accounts** (profiles + per-session overrides)
OpenClaw also supports **provider plugins** that ship their own OAuth or APIkey
OpenClaw also supports **provider plugins** that ship their own OAuth or API-key
flows. Run them via:
```bash
@@ -38,7 +38,7 @@ OAuth providers commonly mint a **new refresh token** during login/refresh flows
Practical symptom:
- you log in via OpenClaw _and_ via Claude Code / Codex CLI → one of them randomly gets logged out later
- you log in via OpenClaw _and_ via Claude Code / Codex CLI → one of them randomly gets "logged out" later
To reduce that, OpenClaw treats `auth-profiles.json` as a **token sink**:
@@ -105,7 +105,7 @@ Claude login on the host, onboarding/configure can reuse it directly.
## OAuth exchange (how login works)
OpenClaws interactive login flows are implemented in `@mariozechner/pi-ai` and wired into the wizards/commands.
OpenClaw's interactive login flows are implemented in `@mariozechner/pi-ai` and wired into the wizards/commands.
### Anthropic setup-token
@@ -125,7 +125,7 @@ Flow shape (PKCE):
1. generate PKCE verifier/challenge + random `state`
2. open `https://auth.openai.com/oauth/authorize?...`
3. try to capture callback on `http://127.0.0.1:1455/auth/callback`
4. if callback cant bind (or youre remote/headless), paste the redirect URL/code
4. if callback can't bind (or you're remote/headless), paste the redirect URL/code
5. exchange at `https://auth.openai.com/oauth/token`
6. extract `accountId` from the access token and store `{ access, refresh, expires, accountId }`
@@ -156,7 +156,7 @@ Two patterns:
### 1) Preferred: separate agents
If you want personal and work to never interact, use isolated agents (separate sessions + credentials + workspace):
If you want "personal" and "work" to never interact, use isolated agents (separate sessions + credentials + workspace):
```bash
openclaw agents add work
@@ -189,6 +189,6 @@ Related docs:
## Related
- [Authentication](/gateway/authentication) model provider auth overview
- [Secrets](/gateway/secrets) credential storage and SecretRef
- [Configuration Reference](/gateway/configuration-reference#auth-storage) auth config keys
- [Authentication](/gateway/authentication) - model provider auth overview
- [Secrets](/gateway/secrets) - credential storage and SecretRef
- [Configuration Reference](/gateway/configuration-reference#auth-storage) - auth config keys

View File

@@ -21,7 +21,7 @@ resources.
register providers, channels, tools, hooks, or trusted runtimes.
</Note>
## What Ships Today
## What ships today
`@openclaw/sdk` ships with:
@@ -54,7 +54,7 @@ The SDK also exports the core types used by those surfaces:
`EnvironmentSelection`, `WorkspaceSelection`, `ApprovalMode`, and related
result types.
## Connect To A Gateway
## Connect to a Gateway
Create a client with an explicit Gateway URL, or inject a custom transport for
tests and embedded app runtimes.
@@ -89,7 +89,7 @@ const oc = new OpenClaw({
});
```
## Run An Agent
## Run an agent
Use `oc.agents.get(id)` when the app wants an agent handle, then call
`agent.run()`.
@@ -124,7 +124,7 @@ while the run is still active returns `status: "accepted"` instead of pretending
the run itself timed out. Runtime timeouts, aborted runs, and cancelled runs are
normalized into `timed_out` or `cancelled`.
## Create And Reuse Sessions
## Create and reuse sessions
Use sessions when the app wants durable transcript state.
@@ -147,7 +147,7 @@ await session.patch({ label: "renamed-session" });
await session.compact({ maxLines: 200 });
```
## Stream Events
## Stream events
The SDK normalizes raw Gateway events into a stable `OpenClawEvent` envelope:
@@ -208,7 +208,7 @@ for await (const event of run.events()) {
For app-wide streams, use `oc.events()`. For raw Gateway frames, use
`oc.rawEvents()`.
## Models, Tools, Artifacts, And Approvals
## Models, tools, artifacts, and approvals
Model helpers map to current Gateway methods:
@@ -261,7 +261,7 @@ const { environments } = await oc.environments.list();
await oc.environments.status(environments[0].id);
```
## Explicitly Unsupported Today
## Explicitly unsupported today
The SDK includes names for the product model we want, but it does not silently
pretend Gateway RPCs exist. These calls currently throw explicit unsupported
@@ -282,7 +282,7 @@ the `agent` RPC. If callers pass them, the SDK throws before submitting the run
so work does not accidentally execute with default workspace, runtime,
environment, or approval behavior.
## App SDK Versus Plugin SDK
## App SDK vs Plugin SDK
Use the App SDK when code lives outside OpenClaw:
@@ -304,7 +304,7 @@ Use the Plugin SDK when code runs inside OpenClaw:
App SDK code should import from `@openclaw/sdk`. Plugin code should import from
documented `openclaw/plugin-sdk/*` subpaths. Do not mix the two contracts.
## Related Docs
## Related
- [OpenClaw App SDK API design](/reference/openclaw-sdk-api-design)
- [Gateway RPC reference](/reference/rpc)

View File

@@ -7,12 +7,12 @@ read_when:
title: "Presence"
---
OpenClaw presence is a lightweight, besteffort view of:
OpenClaw "presence" is a lightweight, best-effort view of:
- the **Gateway** itself, and
- **clients connected to the Gateway** (mac app, WebChat, CLI, etc.)
Presence is used primarily to render the macOS apps **Instances** tab and to
Presence is used primarily to render the macOS app's **Instances** tab and to
provide quick operator visibility.
## Presence fields (what shows up)
@@ -20,12 +20,12 @@ provide quick operator visibility.
Presence entries are structured objects with fields like:
- `instanceId` (optional but strongly recommended): stable client identity (usually `connect.client.instanceId`)
- `host`: humanfriendly host name
- `ip`: besteffort IP address
- `host`: human-friendly host name
- `ip`: best-effort IP address
- `version`: client version string
- `deviceFamily` / `modelIdentifier`: hardware hints
- `mode`: `ui`, `webchat`, `cli`, `backend`, `probe`, `test`, `node`, ...
- `lastInputSeconds`: seconds since last user input (if known)
- `lastInputSeconds`: "seconds since last user input" (if known)
- `reason`: `self`, `connect`, `node-connected`, `periodic`, ...
- `ts`: last update timestamp (ms since epoch)
@@ -35,7 +35,7 @@ Presence entries are produced by multiple sources and **merged**.
### 1) Gateway self entry
The Gateway always seeds a self entry at startup so UIs show the gateway host
The Gateway always seeds a "self" entry at startup so UIs show the gateway host
even before any clients connect.
### 2) WebSocket connect
@@ -45,7 +45,7 @@ Gateway upserts a presence entry for that connection.
#### Why one-off CLI commands do not show up
The CLI often connects for short, oneoff commands. To avoid spamming the
The CLI often connects for short, one-off commands. To avoid spamming the
Instances list, `client.mode === "cli"` is **not** turned into a presence entry.
### 3) `system-event` beacons
@@ -60,11 +60,11 @@ upserts a presence entry for that node (same flow as other WS clients).
## Merge + dedupe rules (why `instanceId` matters)
Presence entries are stored in a single inmemory map:
Presence entries are stored in a single in-memory map:
- Entries are keyed by a **presence key**.
- The best key is a stable `instanceId` (from `connect.client.instanceId`) that survives restarts.
- Keys are caseinsensitive.
- Keys are case-insensitive.
If a client reconnects without a stable `instanceId`, it may show up as a
**duplicate** row.
@@ -81,7 +81,7 @@ This keeps the list fresh and avoids unbounded memory growth.
## Remote/tunnel caveat (loopback IPs)
When a client connects over an SSH tunnel / local port forward, the Gateway may
see the remote address as `127.0.0.1`. To avoid overwriting a good clientreported
see the remote address as `127.0.0.1`. To avoid overwriting a good client-reported
IP, loopback remote addresses are ignored.
## Consumers
@@ -97,9 +97,21 @@ indicator (Active/Idle/Stale) based on the age of the last update.
- If you see duplicates:
- confirm clients send a stable `client.instanceId` in the handshake
- confirm periodic beacons use the same `instanceId`
- check whether the connectionderived entry is missing `instanceId` (duplicates are expected)
- check whether the connection-derived entry is missing `instanceId` (duplicates are expected)
## Related
- [Typing indicators](/concepts/typing-indicators)
- [Streaming and chunking](/concepts/streaming)
<CardGroup cols={2}>
<Card title="Typing indicators" href="/concepts/typing-indicators" icon="ellipsis">
When typing indicators are sent and how to tune them.
</Card>
<Card title="Streaming and chunking" href="/concepts/streaming" icon="bars-staggered">
Outbound streaming, chunking, and per-channel formatting.
</Card>
<Card title="Gateway architecture" href="/concepts/architecture" icon="diagram-project">
Gateway components and the WebSocket protocol that drives presence updates.
</Card>
<Card title="Gateway protocol" href="/gateway/protocol" icon="plug">
The wire protocol for `connect`, `system-event`, and `system-presence`.
</Card>
</CardGroup>

View File

@@ -26,7 +26,7 @@ Shelling...
Use progress drafts when you want one tidy status message during tool-heavy work
and the final answer when the turn is done.
## Quick Start
## Quick start
Enable progress drafts per channel with `streaming.mode: "progress"`:
@@ -47,7 +47,7 @@ until work lasts at least five seconds or emits a second work event, add compact
progress lines while useful work happens, and suppress duplicate standalone
progress chatter for that turn.
## What Users See
## What users see
A progress draft has two parts:
@@ -67,7 +67,7 @@ The final answer replaces the draft when possible; otherwise
OpenClaw sends the final answer normally and cleans up or stops updating the
draft according to the channel's transport.
## Choose A Mode
## Choose a mode
`channels.<channel>.streaming.mode` controls the visible in-progress behavior:
@@ -88,7 +88,7 @@ Discord and Telegram, `streaming.mode: "block"` is still preview streaming, not
normal block delivery. Use `streaming.block.enabled` or legacy
`blockStreaming` when you want normal block replies.
## Configure Labels
## Configure labels
Progress labels live under `channels.<channel>.streaming.progress`.
@@ -170,7 +170,7 @@ Hide the label and show only progress lines:
}
```
## Control Progress Lines
## Control progress lines
Progress lines are enabled by default in progress mode. They come from real run
events: tool starts, item updates, task plans, approvals, command output, patch
@@ -265,7 +265,7 @@ With `toolProgress: false`, OpenClaw still suppresses the older standalone
tool-progress messages for that turn. The channel stays visually quiet until the
final answer, except for the label if one is configured.
## Channel Behavior
## Channel behavior
Each channel uses the cleanest transport it supports:

View File

@@ -119,6 +119,11 @@ timeline, or `--scenario discord-thread-reply-filepath-attachment` to create a
real Discord thread and verify that `message.thread-reply` preserves a
`filePath` attachment. These scenarios stay out of the default live Discord lane
because they are before/after repro probes rather than broad smoke coverage.
The thread-attachment Mantis workflow can also add a logged-in Discord Web
witness video when `MANTIS_DISCORD_VIEWER_CHROME_PROFILE_DIR` or
`MANTIS_DISCORD_VIEWER_CHROME_PROFILE_TGZ_B64` is configured in the QA
environment. That viewer profile is only for visual capture; the pass/fail
decision still comes from the Discord REST oracle.
CI uses the same command surface in `.github/workflows/qa-live-transports-convex.yml`. Scheduled and default manual runs execute the fast Matrix profile with live frontier credentials, `--fast`, and `OPENCLAW_QA_MATRIX_NO_REPLY_WINDOW_MS=3000`. Manual `matrix_profile=all` fans out into the five profile shards so the exhaustive catalog can run in parallel while keeping one artifact directory per shard.
@@ -235,7 +240,7 @@ can write back through the mounted workspace.
## Telegram, Discord, and Slack QA reference
Matrix has a [dedicated page](/concepts/qa-matrix) because of its scenario count and Docker-backed homeserver provisioning. Telegram, Discord, and Slack are smaller a handful of scenarios each, no profile system, against pre-existing real channels so their reference lives here.
Matrix has a [dedicated page](/concepts/qa-matrix) because of its scenario count and Docker-backed homeserver provisioning. Telegram, Discord, and Slack are smaller - a handful of scenarios each, no profile system, against pre-existing real channels - so their reference lives here.
### Shared CLI flags
@@ -243,7 +248,7 @@ These lanes register through `extensions/qa-lab/src/live-transports/shared/live-
| Flag | Default | Description |
| ------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| `--scenario <id>` | | Run only this scenario. Repeatable. |
| `--scenario <id>` | - | Run only this scenario. Repeatable. |
| `--output-dir <path>` | `<repo>/.artifacts/qa-e2e/{telegram,discord,slack}-<timestamp>` | Where reports/summary/observed messages and the output log are written. Relative paths resolve against `--repo-root`. |
| `--repo-root <path>` | `process.cwd()` | Repository root when invoking from a neutral cwd. |
| `--sut-account <id>` | `sut` | Temporary account id inside the QA gateway config. |
@@ -265,7 +270,7 @@ Targets one real private Telegram group with two distinct bots (driver + SUT). T
Required env when `--credential-source env`:
- `OPENCLAW_QA_TELEGRAM_GROUP_ID` numeric chat id (string).
- `OPENCLAW_QA_TELEGRAM_GROUP_ID` - numeric chat id (string).
- `OPENCLAW_QA_TELEGRAM_DRIVER_BOT_TOKEN`
- `OPENCLAW_QA_TELEGRAM_SUT_BOT_TOKEN`
@@ -289,8 +294,8 @@ Scenarios (`extensions/qa-lab/src/live-transports/telegram/telegram-live.runtime
Output artifacts:
- `telegram-qa-report.md`
- `telegram-qa-summary.json` includes per-reply RTT (driver send → observed SUT reply) starting with the canary.
- `telegram-qa-observed-messages.json` bodies redacted unless `OPENCLAW_QA_TELEGRAM_CAPTURE_CONTENT=1`.
- `telegram-qa-summary.json` - includes per-reply RTT (driver send → observed SUT reply) starting with the canary.
- `telegram-qa-observed-messages.json` - bodies redacted unless `OPENCLAW_QA_TELEGRAM_CAPTURE_CONTENT=1`.
### Discord QA
@@ -306,7 +311,7 @@ Required env when `--credential-source env`:
- `OPENCLAW_QA_DISCORD_CHANNEL_ID`
- `OPENCLAW_QA_DISCORD_DRIVER_BOT_TOKEN`
- `OPENCLAW_QA_DISCORD_SUT_BOT_TOKEN`
- `OPENCLAW_QA_DISCORD_SUT_APPLICATION_ID` must match the SUT bot user id returned by Discord (the lane fails fast otherwise).
- `OPENCLAW_QA_DISCORD_SUT_APPLICATION_ID` - must match the SUT bot user id returned by Discord (the lane fails fast otherwise).
Optional:
@@ -317,7 +322,7 @@ Scenarios (`extensions/qa-lab/src/live-transports/discord/discord-live.runtime.t
- `discord-canary`
- `discord-mention-gating`
- `discord-native-help-command-registration`
- `discord-status-reactions-tool-only` opt-in Mantis scenario. Runs by itself because it switches the SUT to always-on, tool-only guild replies with `messages.statusReactions.enabled=true`, then captures a REST reaction timeline plus HTML/PNG visual artifacts. Mantis before/after reports also preserve scenario-provided MP4 artifacts as `baseline.mp4` and `candidate.mp4`.
- `discord-status-reactions-tool-only` - opt-in Mantis scenario. Runs by itself because it switches the SUT to always-on, tool-only guild replies with `messages.statusReactions.enabled=true`, then captures a REST reaction timeline plus HTML/PNG visual artifacts. Mantis before/after reports also preserve scenario-provided MP4 artifacts as `baseline.mp4` and `candidate.mp4`.
Run the Mantis status-reaction scenario explicitly:
@@ -334,7 +339,7 @@ Output artifacts:
- `discord-qa-report.md`
- `discord-qa-summary.json`
- `discord-qa-observed-messages.json` bodies redacted unless `OPENCLAW_QA_DISCORD_CAPTURE_CONTENT=1`.
- `discord-qa-observed-messages.json` - bodies redacted unless `OPENCLAW_QA_DISCORD_CAPTURE_CONTENT=1`.
- `discord-qa-reaction-timelines.json` and `discord-status-reactions-tool-only-timeline.png` when the status-reaction scenario runs.
### Slack QA
@@ -370,16 +375,16 @@ Output artifacts:
- `slack-qa-report.md`
- `slack-qa-summary.json`
- `slack-qa-observed-messages.json` bodies redacted unless `OPENCLAW_QA_SLACK_CAPTURE_CONTENT=1`.
- `slack-qa-observed-messages.json` - bodies redacted unless `OPENCLAW_QA_SLACK_CAPTURE_CONTENT=1`.
#### Setting up the Slack workspace
The lane needs two distinct Slack apps in one workspace, plus a channel both bots are members of:
- `channelId` the `Cxxxxxxxxxx` id of a channel both bots have been invited to. Use a dedicated channel; the lane posts on every run.
- `driverBotToken` bot token (`xoxb-...`) of the **Driver** app.
- `sutBotToken` bot token (`xoxb-...`) of the **SUT** app, which must be a separate Slack app from the driver so its bot user id is distinct.
- `sutAppToken` app-level token (`xapp-...`) of the SUT app with `connections:write`, used by Socket Mode so the SUT app can receive events.
- `channelId` - the `Cxxxxxxxxxx` id of a channel both bots have been invited to. Use a dedicated channel; the lane posts on every run.
- `driverBotToken` - bot token (`xoxb-...`) of the **Driver** app.
- `sutBotToken` - bot token (`xoxb-...`) of the **SUT** app, which must be a separate Slack app from the driver so its bot user id is distinct.
- `sutAppToken` - app-level token (`xapp-...`) of the SUT app with `connections:write`, used by Socket Mode so the SUT app can receive events.
Prefer a Slack workspace dedicated to QA over reusing a production workspace.
@@ -412,7 +417,7 @@ Go to [api.slack.com/apps](https://api.slack.com/apps) → _Create New App_ →
}
```
Copy the _Bot User OAuth Token_ (`xoxb-...`) that becomes `driverBotToken`. The driver only needs to post messages and identify itself; no events, no Socket Mode.
Copy the _Bot User OAuth Token_ (`xoxb-...`) - that becomes `driverBotToken`. The driver only needs to post messages and identify itself; no events, no Socket Mode.
**2. Create the SUT app**
@@ -499,7 +504,7 @@ In the QA workspace, create a channel (e.g. `#openclaw-qa`) and invite both bots
/invite @OpenClaw QA SUT
```
Copy the `Cxxxxxxxxxx` id from _channel info → About → Channel ID_ that becomes `channelId`. A public channel works; if you use a private channel both apps already have `groups:history` so the harness's history reads will still succeed.
Copy the `Cxxxxxxxxxx` id from _channel info → About → Channel ID_ - that becomes `channelId`. A public channel works; if you use a private channel both apps already have `groups:history` so the harness's history reads will still succeed.
**4. Register the credentials**
@@ -540,7 +545,7 @@ pnpm openclaw qa slack \
--output-dir .artifacts/qa-e2e/slack-local
```
A green run completes in well under 30 seconds and `slack-qa-report.md` shows both `slack-canary` and `slack-mention-gating` at status `pass`. If the lane hangs for ~90 seconds and exits with `Convex credential pool exhausted for kind "slack"`, either the pool is empty or every row is leased `qa credentials list --kind slack --status all --json` will tell you which.
A green run completes in well under 30 seconds and `slack-qa-report.md` shows both `slack-canary` and `slack-mention-gating` at status `pass`. If the lane hangs for ~90 seconds and exits with `Convex credential pool exhausted for kind "slack"`, either the pool is empty or every row is leased - `qa credentials list --kind slack --status all --json` will tell you which.
### Convex credential pool
@@ -548,9 +553,9 @@ Telegram, Discord, and Slack lanes can lease credentials from a shared Convex po
Payload shapes the broker validates on `admin/add`:
- Telegram (`kind: "telegram"`): `{ groupId: string, driverToken: string, sutToken: string }` `groupId` must be a numeric chat-id string.
- Telegram (`kind: "telegram"`): `{ groupId: string, driverToken: string, sutToken: string }` - `groupId` must be a numeric chat-id string.
- Discord (`kind: "discord"`): `{ guildId: string, channelId: string, driverBotToken: string, sutBotToken: string, sutApplicationId: string }`.
- Slack (`kind: "slack"`): `{ channelId: string, driverBotToken: string, sutBotToken: string, sutAppToken: string }` `channelId` must match `^[A-Z][A-Z0-9]+$` (a Slack id like `Cxxxxxxxxxx`). See [Setting up the Slack workspace](#setting-up-the-slack-workspace) for app and scope provisioning.
- Slack (`kind: "slack"`): `{ channelId: string, driverBotToken: string, sutBotToken: string, sutAppToken: string }` - `channelId` must match `^[A-Z][A-Z0-9]+$` (a Slack id like `Cxxxxxxxxxx`). See [Setting up the Slack workspace](#setting-up-the-slack-workspace) for app and scope provisioning.
Operational env vars and the Convex broker endpoint contract live in [Testing → Shared Telegram credentials via Convex](/help/testing#shared-telegram-credentials-via-convex-v1) (the section name predates Discord support; the broker semantics are identical for both kinds).
@@ -685,7 +690,7 @@ Preferred generic helpers for new scenarios:
- `formatTransportTranscript`
- `resetTransport`
Compatibility aliases remain available for existing scenarios `waitForQaChannelReady`, `waitForOutboundMessage`, `waitForNoOutbound`, `formatConversationTranscript`, `resetBus` but new scenario authoring should use the generic names. The aliases exist to avoid a flag-day migration, not as the model going forward.
Compatibility aliases remain available for existing scenarios - `waitForQaChannelReady`, `waitForOutboundMessage`, `waitForNoOutbound`, `formatConversationTranscript`, `resetBus` - but new scenario authoring should use the generic names. The aliases exist to avoid a flag-day migration, not as the model going forward.
## Reporting
@@ -697,7 +702,7 @@ The report should answer:
- What stayed blocked
- What follow-up scenarios are worth adding
For the inventory of available scenarios useful when sizing follow-up work or wiring a new transport run `pnpm openclaw qa coverage` (add `--json` for machine-readable output).
For the inventory of available scenarios - useful when sizing follow-up work or wiring a new transport - run `pnpm openclaw qa coverage` (add `--json` for machine-readable output).
For character and style checks, run the same scenario across multiple live model
refs and write a judged Markdown report:

View File

@@ -9,7 +9,7 @@ title: "Matrix QA"
The Matrix QA lane runs the bundled `@openclaw/matrix` plugin against a disposable Tuwunel homeserver in Docker, with temporary driver, SUT, and observer accounts plus seeded rooms. It is the live transport-real coverage for Matrix.
This is maintainer-only tooling. Packaged OpenClaw releases intentionally omit `qa-lab`, so `openclaw qa` is only available from a source checkout. Source checkouts load the bundled runner directly no plugin install step is needed.
This is maintainer-only tooling. Packaged OpenClaw releases intentionally omit `qa-lab`, so `openclaw qa` is only available from a source checkout. Source checkouts load the bundled runner directly - no plugin install step is needed.
For broader QA framework context, see [QA overview](/concepts/qa-e2e-automation).
@@ -24,7 +24,7 @@ Plain `pnpm openclaw qa matrix` runs `--profile all` and does not stop on first
## What the lane does
1. Provisions a disposable Tuwunel homeserver in Docker (default image `ghcr.io/matrix-construct/tuwunel:v1.5.1`, server name `matrix-qa.test`, port `28008`).
2. Registers three temporary users `driver` (sends inbound traffic), `sut` (the OpenClaw Matrix account under test), `observer` (third-party traffic capture).
2. Registers three temporary users - `driver` (sends inbound traffic), `sut` (the OpenClaw Matrix account under test), `observer` (third-party traffic capture).
3. Seeds rooms required by the selected scenarios (main, threading, media, restart, secondary, allowlist, E2EE, verification DM, etc.).
4. Starts a child OpenClaw gateway with the real Matrix plugin scoped to the SUT account; `qa-channel` is not loaded in the child.
5. Runs scenarios in sequence, observing events through the driver/observer Matrix clients.
@@ -42,7 +42,7 @@ pnpm openclaw qa matrix [options]
| --------------------- | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| `--profile <profile>` | `all` | Scenario profile. See [Profiles](#profiles). |
| `--fail-fast` | off | Stop after the first failed check or scenario. |
| `--scenario <id>` | | Run only this scenario. Repeatable. See [Scenarios](#scenarios). |
| `--scenario <id>` | - | Run only this scenario. Repeatable. See [Scenarios](#scenarios). |
| `--output-dir <path>` | `<repo>/.artifacts/qa-e2e/matrix-<timestamp>` | Where reports, summary, observed events, and the output log are written. Relative paths resolve against `--repo-root`. |
| `--repo-root <path>` | `process.cwd()` | Repository root when invoking from a neutral working directory. |
| `--sut-account <id>` | `sut` | Matrix account id inside the QA gateway config. |
@@ -70,7 +70,7 @@ The selected profile decides which scenarios run.
| `fast` | Release-gate subset that exercises the live transport contract: canary, mention gating, allowlist block, reply shape, restart resume, thread follow-up, thread isolation, reaction observation, and exec approval metadata delivery. |
| `transport` | Transport-level threading, DM, room, autojoin, mention/allowlist, approval, and reaction scenarios. |
| `media` | Image, audio, video, PDF, EPUB attachment coverage. |
| `e2ee-smoke` | Minimum E2EE coverage basic encrypted reply, thread follow-up, bootstrap success. |
| `e2ee-smoke` | Minimum E2EE coverage - basic encrypted reply, thread follow-up, bootstrap success. |
| `e2ee-deep` | Exhaustive E2EE state-loss, backup, key, and recovery scenarios. |
| `e2ee-cli` | `openclaw matrix encryption setup` and `verify *` CLI scenarios driven through the QA harness. |
@@ -80,17 +80,17 @@ The exact mapping lives in `extensions/qa-matrix/src/runners/contract/scenario-c
The full scenario id list is the `MatrixQaScenarioId` union in `extensions/qa-matrix/src/runners/contract/scenario-catalog.ts:15`. Categories include:
- threading `matrix-thread-*`, `matrix-subagent-thread-spawn`
- top-level / DM / room `matrix-top-level-reply-shape`, `matrix-room-*`, `matrix-dm-*`
- streaming and tool progress `matrix-room-partial-streaming-preview`, `matrix-room-quiet-streaming-preview`, `matrix-room-tool-progress-*`, `matrix-room-block-streaming`
- media `matrix-media-type-coverage`, `matrix-room-image-understanding-attachment`, `matrix-attachment-only-ignored`, `matrix-unsupported-media-safe`
- routing `matrix-room-autojoin-invite`, `matrix-secondary-room-*`
- reactions `matrix-reaction-*`
- approvals `matrix-approval-*` (exec/plugin metadata, chunked fallback, deny reactions, threads, and `target: "both"` routing)
- restart and replay `matrix-restart-*`, `matrix-stale-sync-replay-dedupe`, `matrix-room-membership-loss`, `matrix-homeserver-restart-resume`, `matrix-initial-catchup-then-incremental`
- mention gating, bot-to-bot, and allowlists `matrix-mention-*`, `matrix-allowbots-*`, `matrix-allowlist-*`, `matrix-multi-actor-ordering`, `matrix-inbound-edit-*`, `matrix-mxid-prefixed-command-block`, `matrix-observer-allowlist-override`
- E2EE `matrix-e2ee-*` (basic reply, thread follow-up, bootstrap, recovery key lifecycle, state-loss variants, server backup behavior, device hygiene, SAS / QR / DM verification, restart, artifact redaction)
- E2EE CLI `matrix-e2ee-cli-*` (encryption setup, idempotent setup, bootstrap failure, recovery-key lifecycle, multi-account, gateway-reply round-trip, self-verification)
- threading - `matrix-thread-*`, `matrix-subagent-thread-spawn`
- top-level / DM / room - `matrix-top-level-reply-shape`, `matrix-room-*`, `matrix-dm-*`
- streaming and tool progress - `matrix-room-partial-streaming-preview`, `matrix-room-quiet-streaming-preview`, `matrix-room-tool-progress-*`, `matrix-room-block-streaming`
- media - `matrix-media-type-coverage`, `matrix-room-image-understanding-attachment`, `matrix-attachment-only-ignored`, `matrix-unsupported-media-safe`
- routing - `matrix-room-autojoin-invite`, `matrix-secondary-room-*`
- reactions - `matrix-reaction-*`
- approvals - `matrix-approval-*` (exec/plugin metadata, chunked fallback, deny reactions, threads, and `target: "both"` routing)
- restart and replay - `matrix-restart-*`, `matrix-stale-sync-replay-dedupe`, `matrix-room-membership-loss`, `matrix-homeserver-restart-resume`, `matrix-initial-catchup-then-incremental`
- mention gating, bot-to-bot, and allowlists - `matrix-mention-*`, `matrix-allowbots-*`, `matrix-allowlist-*`, `matrix-multi-actor-ordering`, `matrix-inbound-edit-*`, `matrix-mxid-prefixed-command-block`, `matrix-observer-allowlist-override`
- E2EE - `matrix-e2ee-*` (basic reply, thread follow-up, bootstrap, recovery key lifecycle, state-loss variants, server backup behavior, device hygiene, SAS / QR / DM verification, restart, artifact redaction)
- E2EE CLI - `matrix-e2ee-cli-*` (encryption setup, idempotent setup, bootstrap failure, recovery-key lifecycle, multi-account, gateway-reply round-trip, self-verification)
Pass `--scenario <id>` (repeatable) to run a hand-picked set; combine with `--profile all` to ignore profile gating.
@@ -112,10 +112,10 @@ Pass `--scenario <id>` (repeatable) to run a hand-picked set; combine with `--pr
Written to `--output-dir`:
- `matrix-qa-report.md` Markdown protocol report (what passed, failed, was skipped, and why).
- `matrix-qa-summary.json` Structured summary suitable for CI parsing and dashboards.
- `matrix-qa-observed-events.json` Observed Matrix events from the driver and observer clients. Bodies are redacted unless `OPENCLAW_QA_MATRIX_CAPTURE_CONTENT=1`; approval metadata is summarized with selected safe fields and truncated command preview.
- `matrix-qa-output.log` Combined stdout/stderr from the run. If `OPENCLAW_RUN_NODE_OUTPUT_LOG` is set, the outer launcher's log is reused instead.
- `matrix-qa-report.md` - Markdown protocol report (what passed, failed, was skipped, and why).
- `matrix-qa-summary.json` - Structured summary suitable for CI parsing and dashboards.
- `matrix-qa-observed-events.json` - Observed Matrix events from the driver and observer clients. Bodies are redacted unless `OPENCLAW_QA_MATRIX_CAPTURE_CONTENT=1`; approval metadata is summarized with selected safe fields and truncated command preview.
- `matrix-qa-output.log` - Combined stdout/stderr from the run. If `OPENCLAW_RUN_NODE_OUTPUT_LOG` is set, the outer launcher's log is reused instead.
The default output dir is `<repo>/.artifacts/qa-e2e/matrix-<timestamp>` so successive runs do not overwrite each other.
@@ -133,7 +133,7 @@ Matrix is one of three live transport lanes (Matrix, Telegram, Discord) that sha
## Related
- [QA overview](/concepts/qa-e2e-automation) overall QA stack and live transport contract
- [QA Channel](/channels/qa-channel) synthetic channel adapter for repo-backed scenarios
- [Testing](/help/testing) running tests and adding QA coverage
- [Matrix](/channels/matrix) the channel plugin under test
- [QA overview](/concepts/qa-e2e-automation) - overall QA stack and live transport contract
- [QA Channel](/channels/qa-channel) - synthetic channel adapter for repo-backed scenarios
- [Testing](/help/testing) - running tests and adding QA coverage
- [Matrix](/channels/matrix) - the channel plugin under test

View File

@@ -113,7 +113,7 @@ keys.
## Troubleshooting
- If commands seem stuck, enable verbose logs and look for queued for ms lines to confirm the queue is draining.
- If commands seem stuck, enable verbose logs and look for "queued for ...ms" lines to confirm the queue is draining.
- If you need queue depth, enable verbose logs and watch for queue timing lines.
- Codex app-server runs that accept a turn and then stop emitting progress are interrupted by the Codex adapter so the active session lane can release instead of waiting for the outer run timeout.
- When diagnostics are enabled, sessions that remain in `processing` past `diagnostics.stuckSessionWarnMs` with no observed reply, tool, status, block, or ACP progress are classified by current activity. Active work logs as `session.long_running`; active work with no recent progress logs as `session.stalled`; `session.stuck` is reserved for stale session bookkeeping with no active work, and only that path can release the affected session lane so queued work drains. Repeated `session.stuck` diagnostics back off while the session remains unchanged.

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