Skip to content

Commit 214fe35

Browse files
Merge branch 'main' into context-usage-tool-only-fix
2 parents 8bcea6e + 77fee95 commit 214fe35

204 files changed

Lines changed: 6457 additions & 2927 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.

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Docs: https://docs.openclaw.ai
3434

3535
### Fixes
3636

37+
- **Doctor memory:** keep Matrix migration codecs separate from the live client and avoid loading the ACP runtime when no legacy session records need inspection.
3738
- **Agent prompts:** keep model-identity guidance conditional so ordinary requests are not mistaken for questions about the current model.
3839

3940
- **Update/Doctor:** preserve `update --no-restart` by requiring an offline managed Gateway during updater-owned repair and leaving restart ownership with the parent.

‎config/assertion-safety-baseline.txt‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,6 @@ extensions/matrix/src/matrix/actions/summary.ts 2
657657
extensions/matrix/src/matrix/actions/verification.ts 1
658658
extensions/matrix/src/matrix/client-bootstrap.ts 1
659659
extensions/matrix/src/matrix/client/config.ts 5
660-
extensions/matrix/src/matrix/client/file-sync-store.ts 5
661660
extensions/matrix/src/matrix/client/logging.ts 3
662661
extensions/matrix/src/matrix/client/runtime.ts 1
663662
extensions/matrix/src/matrix/config-update.ts 4
@@ -3260,7 +3259,6 @@ src/infra/windows-port-pids.ts 2
32603259
src/infra/windows-powershell-spawn.ts 1
32613260
src/infra/windows-shell-command.ts 1
32623261
src/interactive/payload.ts 2
3263-
src/llm/model-runtime-binding.ts 2
32643262
src/llm/providers/stream-wrappers/anthropic-family-tool-payload-compat.ts 3
32653263
src/llm/providers/stream-wrappers/google-thinking-payload.ts 3
32663264
src/llm/providers/stream-wrappers/minimax.ts 3
@@ -3868,7 +3866,6 @@ ui/src/app/stale-chunk-reload.ts 1
38683866
ui/src/app/startup-settings.ts 1
38693867
ui/src/app/theme.ts 4
38703868
ui/src/app/update-schedule-dto.ts 2
3871-
ui/src/app/update-success-notice.ts 1
38723869
ui/src/app/user-profile.ts 2
38733870
ui/src/app/web-push.runtime.ts 2
38743871
ui/src/components/agent-select.ts 3
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"startupJsGzipBytes": 346777,
3-
"reason": "Sender-agent avatars on forwarded cross-session messages (PR #133439): agent-avatar resolution, attribution label rules, and direct-thread identity chrome measured 346777 B, +592 B over the prior baseline; below the 358400 B ceiling; hard cap and allowances unchanged",
4-
"updatedAt": "2026-08-30"
2+
"startupJsGzipBytes": 347792,
3+
"reason": "Final automatic update lifecycle ownership and stale hold response fencing measured 347792 B in the canonical isolated production build (+1015 B, 0.29% from the original baseline); fixed 358400 B cap and allowances unchanged",
4+
"updatedAt": "2026-09-01"
55
}

‎docs/cli/update.md‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ print progress steps.
6969
completion profiles and caches are still repaired when needed; installing
7070
completion in a new shell profile remains an interactive choice.
7171

72+
`--tag` changes only this package update. A saved `update.channel` continues to
73+
govern later foreground and automatic updates, even after a one-off beta
74+
install. Use `--channel` to change that policy.
75+
7276
For source checkouts, `--dry-run` previews the update flow without fetching Git
7377
refs or checking working-tree changes. The real update checks for uncommitted
7478
changes before modifying the checkout. Use `openclaw update status` to inspect
@@ -256,9 +260,12 @@ aligned:
256260

257261
### Restart handoff
258262

259-
The Gateway core auto-updater (when enabled via config) launches the CLI
260-
update path outside the live Gateway request handler. Control-plane
261-
`update.run` package-manager updates and supervised git-checkout updates use
263+
The Gateway core auto-updater requires a managed service restart path. It hands
264+
the CLI update to a detached helper before the Gateway exits. A foreground
265+
Gateway keeps update hints but leaves installation and activation to the
266+
operator: stop it, run `openclaw update`, then launch it again.
267+
268+
Control-plane `update.run` package-manager updates and supervised git-checkout updates use
262269
the same managed-service handoff instead of replacing the package tree or
263270
rebuilding `dist/` inside the live Gateway process: the Gateway starts a
264271
detached helper and exits, and that helper runs `openclaw update --yes --json`

‎docs/install/updating.md‎

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ backup.
1919

2020
## Recommended: `openclaw update`
2121

22-
Detects your install type (npm, pnpm, Bun, or git), fetches the latest version, runs `openclaw doctor`, and restarts the gateway.
22+
Detects your install type (npm, pnpm, Bun, or git), fetches the latest version, runs `openclaw doctor`, and restarts a managed Gateway service.
2323

2424
```bash
2525
openclaw update
@@ -43,6 +43,12 @@ when the beta tag is missing or its version is older than the latest stable
4343
release. Use `--tag beta` for a one-off package update pinned to the raw npm
4444
beta dist-tag instead.
4545

46+
A saved `update.channel` remains the channel for future updates, automatic
47+
checks, and update status. For example, a one-off beta package on a saved stable
48+
channel keeps checking stable afterward. Use `--channel beta` to subscribe to
49+
beta updates. Plugins still follow the installed core version where required
50+
for compatibility.
51+
4652
`--channel extended-stable` is package-only, and installation remains
4753
foreground-only. OpenClaw reads the public npm `extended-stable` selector,
4854
verifies the selected exact package, and installs that exact version. Missing
@@ -366,6 +372,10 @@ Off by default. Enable it in `~/.openclaw/openclaw.json`:
366372

367373
You can also choose the update channel and enable automatic updates from
368374
**Settings → Updates** (`/settings/updates`) in the Control UI.
375+
**Check for updates** controls the existing `update.checkOnStart` setting.
376+
When it is off, **Automatic updates** is disabled but keeps your saved preference;
377+
turning checks back on resumes discovery and any enabled automatic-update policy.
378+
This does not change your separate feature-statistics preference.
369379
Recorded failures on that page include typed **Check status** and **Retry
370380
update** actions when the connected Gateway supports them. See [Update
371381
troubleshooting](/install/update-troubleshooting) for reason codes, guided
@@ -376,6 +386,13 @@ specific number of commits behind. It also shows exact and relative build,
376386
verified install, and last-commit times. Existing checkouts show an unknown
377387
install time until their next verified successful update.
378388

389+
Automatic installation requires a managed Gateway service that can hand off
390+
the update and restart safely. A Gateway running directly in a terminal can
391+
still show update hints, but it does not automatically replace its running
392+
installation. Stop that Gateway, run `openclaw update`, and launch it again
393+
afterward, or [install a managed service](/cli/gateway#manage-the-gateway-service) for
394+
unattended updates.
395+
379396
| Channel | Behavior |
380397
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
381398
| `stable` | After a built-in delay with deterministic jitter for a spread rollout, announces an update campaign. |
@@ -401,8 +418,7 @@ fixed target and does not move if upstream `main` advances during the countdown.
401418

402419
Every failed apply ends the campaign so the UI does not remain on
403420
**Updating…**. Failures after a managed-service handoff starts are also recorded
404-
in the restart sentinel and surface after the Gateway returns; direct
405-
unsupervised failures remain in the running Gateway's logs.
421+
in the restart sentinel and surface after the Gateway returns.
406422

407423
`update.checkOnStart: false` disables all automatic update checks, feature
408424
statistics, and update notices, even when `update.auto.enabled` is `true`.
@@ -412,6 +428,9 @@ still run unless `update.checkOnStart` is also disabled. See
412428
[Usage telemetry and update checks](/gateway/telemetry) for the information
413429
sent by the daily check and optional anonymous feature statistics.
414430

431+
Disabling checks also cancels unfinished discovery and its campaign; a late
432+
response from the previous settings cannot start an update afterward.
433+
415434
The gateway also logs an update hint on startup (disable with
416435
`update.checkOnStart: false`). Stored extended-stable selections use this
417436
read-only hint path and the existing 24-hour hint interval, but never invoke

‎docs/tools/btw.md‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ session** without adding it to conversation history. It is modeled after
1111
Claude Code's `/btw`, adapted to OpenClaw's Gateway and multi-channel
1212
architecture.
1313

14-
The two side-question contracts are deliberately separate. BTW is a one-shot question on the session's actual model, preserving harness behavior and Codex thread-fork continuity for channel ingress (WhatsApp, Telegram, and Discord), the TUI, and embedded `tui --local`; the TUI stays on BTW by design. The companion is a persistent, read-only RPC thread for Control UI-class clients. Its first question lazily prepares bounded visible context from the selected session; a temporary history failure remains retryable and does not run as an empty session. Channels cannot use the companion because they do not have an RPC connection.
14+
The two side-question contracts are deliberately separate. BTW is a one-shot question on the session's actual model, preserving harness behavior and Codex thread-fork continuity for channel ingress (WhatsApp, Telegram, and Discord), the TUI, and embedded `tui --local`; the TUI stays on BTW by design. Side chat uses a persistent, read-only RPC thread for Control UI-class clients. Its first question lazily prepares bounded visible context from the selected session; a temporary history failure remains retryable and does not run as an empty session. Channels cannot use Side chat because they do not have an RPC connection.
1515

1616
```text
1717
/btw what changed?
@@ -48,7 +48,7 @@ use a direct one-shot provider call instead.
4848

4949
`/btw` does not create a durable session, continue the unfinished main task,
5050
or persist question/answer data to transcript history. Detached BTW results do
51-
not survive a reload. The Control UI companion can rehydrate its in-memory
51+
not survive a reload. Control UI Side chat can rehydrate its in-memory
5252
thread after a reload, but the thread is cleared by a session reset, Gateway
5353
restart, idle expiry, or the rail's clear button.
5454

@@ -57,15 +57,15 @@ restart, idle expiry, or the rail's clear button.
5757
Normal assistant chat uses the Gateway `chat` event. Detached BTW uses a
5858
separate `chat.side_result` event so clients cannot mistake it for regular
5959
conversation history. The Control UI does not consume that event; it calls the
60-
session companion RPCs and renders their bounded exchange state in the rail.
60+
`sessions.companion.*` RPCs and renders their bounded exchange state in the rail.
6161

6262
## Surface behavior
6363

64-
| Surface | Behavior |
65-
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
66-
| TUI | Rendered inline in the chat log, visibly distinct from a normal reply, dismissible with `Enter` or `Esc`. |
67-
| External channels | Delivered as a clearly labeled one-off reply (Telegram, WhatsApp, Discord have no local ephemeral overlay). |
68-
| Control UI / web | Routes `/btw` and `/side` to the expanded session rail companion. The read-only thread is keyed by session, rehydrates from Gateway memory, and preserves a failed question for Retry. It can be cleared with the trash button. `Esc` collapses the rail. |
64+
| Surface | Behavior |
65+
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
66+
| TUI | Rendered inline in the chat log, visibly distinct from a normal reply, dismissible with `Enter` or `Esc`. |
67+
| External channels | Delivered as a clearly labeled one-off reply (Telegram, WhatsApp, Discord have no local ephemeral overlay). |
68+
| Control UI / web | Routes `/btw` and `/side` to the expanded Side chat. The read-only thread is keyed by session, rehydrates from Gateway memory, and preserves a failed question for Retry. It can be cleared with the trash button. `Esc` collapses the rail. |
6969

7070
## Selection popup (Control UI)
7171

‎docs/tools/slash-commands.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -545,8 +545,8 @@ Unlike a normal message:
545545
- Does **not** change future session context.
546546
- Is not written to transcript history.
547547

548-
In the Control UI, `/btw` and `/side` open the session rail and ask its
549-
read-only companion instead of starting the detached BTW path. The TUI and
548+
In the Control UI, `/btw` and `/side` open Side chat instead of starting the
549+
detached BTW path. The TUI and
550550
external-channel behavior above is unchanged.
551551

552552
See [BTW side questions](/tools/btw) for the full behavior.

‎docs/web/control-ui.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ The Control UI is a small **Vite + Lit** single-page app served by the Gateway:
1414

1515
It speaks **directly to the Gateway WebSocket** on the same port.
1616

17-
While you watch a running session, the Gateway shows the model's latest safe preamble immediately as the session headline. When a utility model is available, it can replace that headline with a richer compact status digest after enough activity accumulates. Chat carries the result in a **session rail**: its compact pill shows the live digest, while the expanded rail shows the assessment, plan progress, pull requests, elapsed time, and a read-only companion thread. The rail can expand once when a run becomes stuck or needs input, and done or failed runs keep a frozen “finished” time based on the final digest. On wide chat panes the expanded rail docks as a 400 px right column; on narrower and mobile layouts it remains an overlay.
17+
While you watch a running session, the Gateway shows the model's latest safe preamble immediately as the session headline. When a utility model is available, it can replace that headline with a richer compact status digest after enough activity accumulates. Chat carries the result in a **session rail**: its compact pill shows the live digest, while the expanded rail shows the assessment, plan progress, pull requests, elapsed time, and a read-only Side chat thread. The rail can expand once when a run becomes stuck or needs input, and done or failed runs keep a frozen “finished” time based on the final digest. On wide chat panes the expanded rail docks as a 400 px right column; on narrower and mobile layouts it remains an overlay.
1818

19-
The companion answers questions about the selected session and its project without entering or interrupting the main agent run. On the first question, the Gateway lazily loads a bounded visible snapshot of the selected session before starting the utility model. If history is temporarily unavailable, the question stays visible with **Retry** instead of being treated as an empty session. The companion uses read-only access to the target session's history/search and agent workspace. Its bounded thread is held in Gateway memory, is restored when you switch sessions in the Control UI, and is cleared by the rail's trash button, a session reset, Gateway restart, or idle expiry. It never enters `chat.history`, and private reference context is not stored as operator dialogue. Type `/btw <question>` or `/side <question>` in the main Control UI composer to open the rail and ask there; other clients keep their existing BTW behavior.
19+
Side chat answers questions about the selected session and its project without entering or interrupting the main agent run. On the first question, the Gateway lazily loads a bounded visible snapshot of the selected session before starting the utility model. If history is temporarily unavailable, the question stays visible with **Retry** instead of being treated as an empty session. Side chat uses read-only access to the target session's history/search and agent workspace. Its bounded thread is held in Gateway memory, is restored when you switch sessions in the Control UI, and is cleared by the rail's trash button, a session reset, Gateway restart, or idle expiry. It never enters `chat.history`, and private reference context is not stored as operator dialogue. Type `/btw <question>` or `/side <question>` in the main Control UI composer to open the rail and ask there; other clients keep their existing BTW behavior.
2020

2121
Highlighting text in a chat message offers **Ask in side chat**, which opens the rail with a quoted draft ready to edit.
2222

‎extensions/acpx/src/session-owner-migration.test.ts‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,34 @@ async function fixture(mode: "persistent" | "oneshot" = "persistent", sessionKey
134134
};
135135
}
136136

137+
it.each(["missing", "empty"])(
138+
"does not inspect session claims when the legacy directory is %s",
139+
async (directoryState) => {
140+
const directory = directories.make("acpx-empty-owner-migration-");
141+
if (directoryState === "empty") {
142+
await fs.mkdir(path.join(directory, "state", "sessions"), { recursive: true });
143+
}
144+
const context: PluginDoctorStateMigrationContext = {
145+
openPluginStateKeyedStore() {
146+
throw new Error("No record requires a state store");
147+
},
148+
async inspectAcpSessionClaims() {
149+
throw new Error("No record requires canonical ownership evidence");
150+
},
151+
};
152+
await expect(
153+
acpxSessionOwnerMigration.detectLegacyState({
154+
config: {},
155+
env: { ...process.env, OPENCLAW_STATE_DIR: directory },
156+
stateDir: directory,
157+
oauthDir: path.join(directory, "oauth"),
158+
serviceWorkspaceDir: directory,
159+
context,
160+
}),
161+
).resolves.toBeNull();
162+
},
163+
);
164+
137165
it.each(["none", "publication", "canonical"])(
138166
"preserves raw history and resumes idempotently after interruption=%s",
139167
async (interrupted) => {

‎extensions/acpx/src/session-owner-migration.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ async function legacyRecords(input: MigrationInput): Promise<{ directory: string
4848
.filter((name) => name.endsWith(".json"))
4949
.map((name) => decodeURIComponent(name.slice(0, -5)))
5050
.filter((id) => !id.startsWith("agent:") && !id.startsWith(".openclaw-owner-"));
51+
if (ids.length === 0) {
52+
return { directory, ids };
53+
}
5154
const evidence = await input.context.inspectAcpSessionClaims?.();
5255
const { decodeAcpxRuntimeHandleState } = await import("acpx/runtime");
5356
return {

0 commit comments

Comments
 (0)