Skip to content

Commit e41d949

Browse files
committed
Merge remote-tracking branch 'origin/main' into pr-129782-prep
* origin/main: (24 commits) fix(gateway): reject rootless session permission modes (#128149) docs(memory): document shipped turn-taint propagation for network tool output (#129837) fix(ui): pool reply-less wake activity into one chat rollup (#128442) fix(package): prevent installs from deleting validated runtime assets (#129724) fix(nodes): approve silent initial node surfaces and name the pending surface approval (#129795) fix(backup): preserve configured agent state roots (#129773) fix(ui): own chat history issuance with a closed state machine (#129776) fix(cron): preserve cancellation reason after late finalization (#129331) fix(cron): prevent run waits from failing after clock changes (#129805) fix(telegram): route commentary through one frozen progress owner (#128259) fix(release): start approved VCR mirror recovery jobs (#129829) test: complete current-plugin-metadata-snapshot mock factories (#129791) test(telegram): remove duplicate reaction case (#129848) fix(channels): honor supported account reply-threading policies (#129679) refactor(cli): deduplicate lazy subcommand registration (#129351) fix(ai): report interrupted local-model streams instead of empty success (#129794) refactor(cli): consolidate Gateway fallback and hook ownership (#129802) fix(qa): reject token confidence lanes without executed evidence (#129830) fix(tui): fence session state and delayed actions (#129810) fix(control-ui): keep task progress full width on hover (#129832) ...
2 parents 3a6de25 + ceb074e commit e41d949

150 files changed

Lines changed: 6093 additions & 2955 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/vercel-container-registry-publish.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
runs-on: ubuntu-24.04
8282
timeout-minutes: 30
8383
# Release mirroring is advisory; approved recovery must fail visibly.
84-
continue-on-error: ${{ inputs.advisory }}
84+
continue-on-error: ${{ inputs.advisory == true }}
8585
permissions:
8686
contents: read
8787
steps:

‎config/assertion-safety-baseline.txt‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2412,7 +2412,7 @@ src/cli/gateway-cli/qa-parent-watchdog.ts 3
24122412
src/cli/gateway-cli/register.ts 4
24132413
src/cli/gateway-cli/run.ts 12
24142414
src/cli/gateway-cli/suspend-cli.ts 2
2415-
src/cli/hooks-cli.ts 2
2415+
src/cli/hooks-cli.ts 1
24162416
src/cli/logs-cli.ts 1
24172417
src/cli/mcp-cli.ts 1
24182418
src/cli/models-cli.ts 19
@@ -2494,7 +2494,6 @@ src/commands/backup-git.ts 1
24942494
src/commands/backup-restore.ts 1
24952495
src/commands/backup-schedule.ts 2
24962496
src/commands/backup-shared.ts 1
2497-
src/commands/backup-verify-manifest.ts 1
24982497
src/commands/backup-verify.ts 2
24992498
src/commands/channel-setup/channel-plugin-resolution.ts 1
25002499
src/commands/channel-setup/config-compatibility.ts 2
@@ -3147,7 +3146,7 @@ src/infra/approval-handler-runtime.ts 15
31473146
src/infra/approval-presentation.ts 3
31483147
src/infra/backup-archive-publication.ts 6
31493148
src/infra/backup-create-stream.ts 3
3150-
src/infra/backup-create.ts 3
3149+
src/infra/backup-create.ts 1
31513150
src/infra/backup-tar-retry.ts 4
31523151
src/infra/backup-volatile-stat-cache.ts 1
31533152
src/infra/bonjour-discovery.ts 5

‎config/max-lines-baseline.txt‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,6 @@ src/gateway/worker-environments/store.ts
693693
src/hooks/install.ts
694694
src/infra/approval-handler-runtime.ts
695695
src/infra/backup-create.test.ts
696-
src/infra/backup-create.ts
697696
src/infra/clawhub-install-trust.ts
698697
src/infra/command-explainer/extract.ts
699698
src/infra/device-pairing.test.ts

‎docs/channels/feishu.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,7 @@ Full configuration: [Gateway configuration](/gateway/configuration)
646646
| `channels.feishu.accounts.<id>.appId` | App ID | - |
647647
| `channels.feishu.accounts.<id>.appSecret` | App Secret | - |
648648
| `channels.feishu.accounts.<id>.domain` | Per-account domain override | `feishu` |
649+
| `channels.feishu.accounts.<id>.replyToMode` | Per-account reply-reference mode | inherited |
649650
| `channels.feishu.accounts.<id>.tts` | Per-account TTS override | `tts` |
650651
| `channels.feishu.dmPolicy` | DM policy (`pairing`, `allowlist`, `open`) | `pairing` |
651652
| `channels.feishu.allowFrom` | DM allowlist (open_id list) | - |
@@ -658,6 +659,7 @@ Full configuration: [Gateway configuration](/gateway/configuration)
658659
| `channels.feishu.groups.<chat_id>.enabled` | Enable/disable a specific group | `true` |
659660
| `channels.feishu.groups.<chat_id>.allowFrom` | Per-group sender allowlist (overrides `groupSenderAllowFrom`) | - |
660661
| `channels.feishu.groupSessionScope` | Group session mapping (`group`, `group_sender`, `group_topic`, `group_topic_sender`) | `group` |
662+
| `channels.feishu.replyToMode` | Reply-reference mode (`off`, `first`, `all`, `batched`) | `all` |
661663
| `channels.feishu.replyInThread` | Bot replies create/continue topic threads (`disabled`, `enabled`) | `disabled` |
662664
| `channels.feishu.reactionNotifications` | Inbound reaction events (`off`, `own`, `all`) | `own` |
663665
| `channels.feishu.vcAutoJoin` | Join invited VC meetings after normal DM authorization | `false` |

‎docs/channels/irc.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,11 @@ IRC does not provide a replayable delivery ID or resend messages missed by a dis
6060
| `realname` | `OpenClaw` | Realname/GECOS field |
6161
| `password` / `passwordFile` | none | Server password; file must be a regular file |
6262
| `channels` | none | Channels to join (`["#openclaw"]`) |
63+
| `replyToMode` | `all` | Reply-reference mode: `off`, `first`, `all`, or `batched` |
6364
| `accounts` / `defaultAccount` | none | Multi-account setup; env vars fill only the default account |
6465

66+
Named accounts inherit the channel-wide reply mode; override it with `channels.irc.accounts.<id>.replyToMode`.
67+
6568
## Security defaults
6669

6770
- IRC uses raw TCP/TLS sockets outside OpenClaw operator-managed forward proxy routing. In deployments that require all egress through that forward proxy, set `channels.irc.enabled=false` unless direct IRC egress is explicitly approved.

‎docs/channels/nextcloud-talk.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ Provider options:
160160
- `channels.nextcloud-talk.streaming.chunkMode`: `length` (default) or `newline` to split on blank lines (paragraph boundaries) before length chunking.
161161
- `channels.nextcloud-talk.streaming.block.enabled`: enable or disable block streaming for this channel.
162162
- `channels.nextcloud-talk.streaming.block.coalesce`: block streaming coalesce tuning.
163+
- `channels.nextcloud-talk.replyToMode`: reply-reference mode (`off | first | all | batched`; default: `all`). Named accounts can override it with `channels.nextcloud-talk.accounts.<id>.replyToMode`.
163164
- `channels.nextcloud-talk.responsePrefix`: outbound reply prefix.
164165
- `channels.nextcloud-talk.markdown.tables`: markdown table rendering mode (`off | bullets | code | block`).
165166
- `channels.nextcloud-talk.mediaMaxMb`: inbound media cap (MB).

‎docs/cli/backup.md‎

Lines changed: 66 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Archive `create`, `verify`, and `restore`, plus SQLite `create`, `list`, `verify
4242

4343
## Notes
4444

45-
- The archive embeds a `manifest.json` with the resolved source paths and archive layout.
45+
- The archive embeds a schema-version-1 `manifest.json` with the resolved source paths and archive layout. Additive ownership metadata records configured agent ids and roots, including agent roots already covered by another asset; existing archive layout and older archives remain supported.
4646
- Default output is a timestamped `.tar.gz` archive in the current working directory. Timestamped filenames use your machine's local timezone and include the UTC offset. If the current working directory is inside a backed-up source tree, OpenClaw falls back to your home directory for the default archive location.
4747
- Existing archive files are never overwritten. Output paths inside the source state/workspace trees are rejected to avoid self-inclusion.
4848
- `openclaw backup verify <archive>` checks that the archive contains exactly one root manifest, rejects traversal-style archive paths, unsafe symbolic links, and SQLite sidecars, confirms every manifest-declared payload exists, validates every SQLite snapshot's file shape, and runs full integrity and role checks on canonical OpenClaw databases. Dedicated plugin schemas remain opaque because they may require owner-defined SQLite capabilities. `openclaw backup create --verify` runs that validation immediately after writing the archive.
@@ -57,12 +57,13 @@ live state directory:
5757
openclaw backup restore <archive.tar.gz> --target <fresh-directory>
5858
```
5959

60-
The target must not exist or must be an empty directory. Restore verifies the
61-
archive and its SQLite databases before creating or writing the target, refuses
62-
a non-empty target, and removes an incomplete extraction if anything fails. It
63-
never restores in place and has no `--force` mode. The extracted layout retains
64-
the archive root, manifest, and `payload/` paths exactly as recorded in the
65-
archive.
60+
The target must not exist or must be an empty directory, and it cannot be inside
61+
the live state directory or any configured live agent directory. Restore
62+
verifies the archive and its SQLite databases before creating or writing the
63+
target, refuses a non-empty target, and removes an incomplete extraction if
64+
anything fails. It never restores in place and has no `--force` mode. The
65+
extracted layout retains the archive root, manifest, and `payload/` paths
66+
exactly as recorded in the archive.
6667

6768
<Warning>
6869
Restoring an archive is time travel. Messaging-channel credentials with
@@ -78,15 +79,19 @@ archive.
7879
Activation is a separate offline operator step. Stop the Gateway, move the
7980
restored state asset into place or point `OPENCLAW_STATE_DIR` at that asset,
8081
then run `openclaw doctor` before restarting. Use `manifest.json` as the source
81-
of truth for the state, config, credentials, and workspace asset paths. See
82+
of truth for the state, config, credentials, workspace, and configured agent
83+
paths. Restore custom agent roots to the locations configured by `agentDir`, or
84+
update those settings to their new locations before restarting. See
8285
[Restore a full archive](/install/backups#restore-a-full-archive) for the full
8386
disaster-recovery sequence.
8487

8588
## SQLite snapshots
8689

8790
Use `openclaw backup sqlite` when you need a portable artifact for one OpenClaw-owned SQLite database instead of a broad state archive.
8891

89-
Snapshot creation accepts exactly one named source:
92+
Snapshot creation accepts exactly one named source. Agent sources always use
93+
the current configuration's resolved `<agentDir>/openclaw-agent.sqlite`, even
94+
when `agentDir` is outside the state directory:
9095

9196
| Command | Database |
9297
| --------------------------------------------------------------- | ---------------------- |
@@ -134,7 +139,8 @@ agents/<agentId>/schema.sql
134139
agents/<agentId>/tables/<table>.jsonl
135140
```
136141

137-
Initialize the repository, then create a snapshot of all registered databases:
142+
Initialize the repository, then create a snapshot of the shared database and
143+
all configured agent databases:
138144

139145
```bash
140146
openclaw backup git init --repository ~/Backups/openclaw-git --remote <private-git-url>
@@ -153,7 +159,7 @@ scope. With `--all`, it validates every existing entry under `agents/` before
153159
removing stale backup-owned agent scopes, so an unowned entry aborts the cleanup
154160
before anything is deleted.
155161

156-
You can also select `--global`, repeat `--agent <id>`, or combine the shared database with selected agents. Snapshot creation uses the same online backup, sanitizer, `VACUUM`, owner validation, and integrity checks as `backup sqlite create`; it never reads live SQLite files directly. Rows and schema entries have deterministic ordering, and integers and blobs use lossless encodings. The command creates one commit named `openclaw backup <ISO8601>`. If the database content is unchanged, it prints `no changes` and creates no commit.
162+
You can also select `--global`, repeat `--agent <id>`, or combine the shared database with selected agents. Explicit agent selections, `--all`, and scheduled backups resolve each database from its configured `agentDir`; historical artifact verification and restore use the artifact's recorded agent id without requiring that agent to remain in the current configuration. Snapshot creation uses the same online backup, sanitizer, `VACUUM`, owner validation, and integrity checks as `backup sqlite create`; it never reads live SQLite files directly. Rows and schema entries have deterministic ordering, and integers and blobs use lossless encodings. The command creates one commit named `openclaw backup <ISO8601>`. If the database content is unchanged, it prints `no changes` and creates no commit.
157163

158164
Git staging is restricted to the backup-owned `global` and `agents` paths;
159165
unrelated files elsewhere in an adopted repository are never staged.
@@ -237,13 +243,27 @@ Every real archive, SQLite snapshot, and Git create attempt records a compact ou
237243
- The state directory (usually `~/.openclaw`)
238244
- The active config file path
239245
- The resolved `credentials/` directory when it exists outside the state directory
246+
- Every configured agent directory, including custom `agentDir` roots outside the state directory
240247
- Workspace directories discovered from the current config, unless you pass `--no-include-workspace`
241-
242-
Auth profiles and other per-agent runtime state live in SQLite under the state directory (`agents/<agentId>/agent/openclaw-agent.sqlite`), so they are covered by the state backup entry automatically.
243-
244-
`--only-config` skips state, credentials-directory, and workspace discovery and archives only the active config file path.
245-
246-
OpenClaw canonicalizes paths before building the archive: if config, the credentials directory, or a workspace already live inside the state directory, they are not duplicated as separate top-level backup sources. Missing paths are skipped.
248+
- Durable resources declared by effectively activated, loadable plugin manifests
249+
250+
Auth profiles and other per-agent runtime state live in
251+
`<agentDir>/openclaw-agent.sqlite`. The default agent root is
252+
`<stateDir>/agents/<agentId>/agent`, but a custom root remains authoritative
253+
whether it is outside the state directory, inside a workspace, or nested under
254+
an otherwise regenerable managed state root. `--no-include-workspace` omits
255+
ordinary workspace sources, not configured agent directories.
256+
257+
`--only-config` skips state, agent, credentials-directory, workspace, and
258+
plugin-resource discovery and archives only the active config file path.
259+
260+
OpenClaw builds one immutable, configuration-derived ownership inventory before
261+
planning sources, SQLite snapshots, exclusions, results, and the embedded
262+
manifest. Paths are canonicalized: config, credentials, workspaces, and agents
263+
already covered by another included root are not duplicated as top-level
264+
sources. A custom agent root becomes a distinct `agent` asset only when no
265+
existing asset covers it; the manifest still records its agent id and root when
266+
another asset contains it. Missing paths are reported as skipped.
247267

248268
During archive creation, OpenClaw excludes known live-mutation paths before `tar` reads them. This avoids races between a file's recorded size and concurrent writes. The filter applies these state-relative rules under each backed-up state directory:
249269

@@ -263,7 +283,16 @@ These rules do not filter workspace files outside the state directory. They also
263283

264284
Chromium singleton entries coordinate one running browser on one host and are recreated when that profile starts; the rest of the profile's `user-data/` remains in the archive. Sandbox skills workspaces are generated copies of current skill sources and are materialized again when OpenClaw prepares the next sandbox context after restore; adjacent sandbox registry and other durable state remain included.
265285

266-
SQLite databases under the state directory are captured with SQLite's online backup API and compacted offline with `VACUUM` so deleted-page remnants do not enter the archive, and live WAL/SHM files are not copied. A plugin-owned database that requires unavailable owner-defined SQLite capabilities fails closed rather than falling back to a direct file copy. SQLite files included through workspace backups are copied as workspace files and are not covered by the compaction guarantee.
286+
SQLite databases owned by the state directory or any configured agent directory
287+
are captured with SQLite's online backup API and compacted offline with
288+
`VACUUM`, including custom agent roots covered by a workspace or managed state
289+
asset. Committed WAL changes are included, deleted-page remnants and transient
290+
leases are removed, sidecars are omitted, and canonical OpenClaw databases must
291+
match their expected role and agent owner. Unsafe aliasing or an owner mismatch
292+
fails closed. A plugin-owned database that requires unavailable owner-defined
293+
SQLite capabilities also fails closed rather than falling back to a direct file
294+
copy. Other workspace SQLite files outside configured agent roots remain raw
295+
workspace files and do not receive the SQLite snapshot or compaction guarantee.
267296

268297
Installed plugin source and manifest files under the state directory's `extensions/` tree are included, but their nested `node_modules/` dependency trees are skipped as rebuildable install artifacts. After restoring an archive, use `openclaw plugins update <id>` or reinstall with `openclaw plugins install <spec> --force` if a restored plugin reports missing dependencies.
269298

@@ -273,15 +302,32 @@ Agent-scoped temporary trees under `agents/<agentId>/agent/**/{tmp,.tmp}/` are a
273302

274303
Symbolic links are archived as link metadata and are never followed. Relative links are retained only when both the link and its lexical target remain within backup assets declared in `manifest.json`; links between declared assets and dangling links within an asset are allowed. Absolute links, links containing backslashes, and links escaping the archive root or every declared asset are rejected during both creation and verification.
275304

276-
Installer-managed and rebuildable runtime roots under the state directory are also skipped: `dev/`, `git/`, `npm/`, legacy `npm-runtime/`, `tmp/`, and `tools/`. These contain managed checkouts, package trees, compiler caches, temporary files, and downloaded runtimes rather than authoritative user state; reinstall or update the corresponding runtime or plugin after restore. An explicitly configured config file, credentials directory, or workspace inside one of these roots remains included.
305+
Installer-managed and rebuildable runtime roots under the state directory are
306+
also skipped: `dev/`, `git/`, `npm/`, legacy `npm-runtime/`, `tmp/`, and
307+
`tools/`. These contain managed checkouts, package trees, compiler caches,
308+
temporary files, and downloaded runtimes rather than authoritative user state;
309+
reinstall or update the corresponding runtime or plugin after restore.
310+
Effectively activated, loadable plugins can declare additional durable or
311+
regenerable state- or agent-relative roots through
312+
[`backupResources`](/plugins/manifest#backupresources-reference). Disabled or
313+
unloadable plugins cannot exclude data. Explicit config, credentials, workspace,
314+
agent, and plugin-included paths override exclusions, and any excluded parent
315+
remains traversable to reach those protected descendants. Names such as `tmp`
316+
and `.tmp` are not blanket exclusions in custom agent directories; only an
317+
applicable owner declaration can omit their durable-looking siblings.
277318

278319
Local edits inside a managed `dev/` checkout are developer source, not OpenClaw product state, and are not included. Commit and push those edits or copy the checkout separately before relying on a state backup.
279320

280321
## Invalid config behavior
281322

282323
`openclaw backup` bypasses the normal config preflight so it can still help during recovery. Workspace discovery depends on a valid config, so `openclaw backup create` fails fast when the config file exists but is invalid and workspace backup is still enabled.
283324

284-
For a partial backup in that situation, rerun with `--no-include-workspace`: it keeps state, config, and the external credentials directory in scope while skipping workspace discovery entirely.
325+
For a partial backup in that situation, rerun with
326+
`--no-include-workspace`: it keeps state, config, and the external credentials
327+
directory in scope without workspace discovery. Because malformed configuration
328+
also prevents resolving custom agent ownership and effectively activated plugin
329+
resources, the result records those unresolved scopes as skipped diagnostics;
330+
do not treat that recovery archive as a complete backup.
285331

286332
`--only-config` also works when the config is malformed, since it does not parse the config for workspace discovery.
287333

0 commit comments

Comments
 (0)