Commit Graph

78578 Commits

Author SHA1 Message Date
Peter Steinberger 37b4fc8621 feat(backup): recorded runs, scheduled backups, and git-backed versioned snapshots (#122485)
* refactor(infra): extract shared git exec and verified snapshot-copy helpers

Moves the worktrees git wrapper to src/infra/git-exec.ts (with optional
maxOutputBytes for large buffered reads) and the online-backup/sanitize/
VACUUM/verify snapshot step into src/snapshot/openclaw-snapshot-copy.ts so
snapshot backends share one hardened copy path. Behavior-identical moves;
all importers updated.

* feat(snapshot): git-backed versioned SQLite snapshot engine

Deterministic per-table JSONL dumps (PK-ordered, lossless bigint/blob
encoding), verbatim DDL preservation, virtual/shadow-table skipping with
FTS rebuild on restore, secret-table redaction policy, manifest with
per-table row counts and content hashes, and restore verification by
re-serialization. Unchanged data produces no commit.

* feat(backup): recorded runs, freshness surfacing, and scheduled git backups

Every backup attempt is recorded in the previously writer-less backup_runs
table (bounded to 200 rows). openclaw status gains a Backups overview row
and JSON payload; doctor prints an informational hint when no successful
backup is recorded or the newest is stale. New commands: backup git
init/create/log/verify/restore and backup enable/disable, which provision
one idempotent gateway cron job running scheduled git backups.

* fix(state): stop bumping schema_meta.updated_at on unchanged opens

updated_at now records when schema metadata actually changed instead of
when the database was last opened; unconditional bumps dirtied the row on
every open and defeated no-change backup detection.

* docs: document versioned git backups, scheduling, and backup freshness

* fix(backup): satisfy CI ownership checks

* fix(backup): complete CI contract coverage

* fix(backup): complete credential table redaction

* fix(backup): isolate git repository ownership

* fix(backup): persist push degradation

* fix(backup): atomically converge schedules

* fix(status): isolate backup freshness environment

* fix(status): carry scan environment to freshness reads

* fix(backup): harden Git repository ownership

* docs(backup): document Git repository safety

* fix(backup): non-creating outcome log and origin preflight for pushed schedules

Recording a backup outcome never bootstraps an absent state database (a
failed backup on a fresh host would otherwise create a blank DB that a
retry treats as real input), and backup enable --push now requires the
repository to have an origin remote, pointing at backup git init --remote
instead of scheduling permanently degraded pushes.

* refactor(worktrees): use shared git exec helpers

* refactor(worktrees): remove unused git buffer wrapper

* refactor(worktrees): consume buffered git helper

* feat(backup): redact pushed schedules by default

Unattended recurring pushes retain credential-bearing tables durably in
remote Git history, so backup enable --push now defaults to
--exclude-secrets; --include-secrets is the explicit full-fidelity
override (still warned). Local non-push schedules keep full fidelity for
complete restores.

* fix(backup): redact audit HMAC and OAuth pending state; tolerate absent backup_runs

Adds audit_identity_keys (audit HMAC key) and mcp_oauth_pending_authorizations
(live OAuth callback state) to the redaction inventory, and makes read-only
backup freshness treat a same-version database without the additive
backup_runs table as no recorded backups instead of failing before a
writable open converges the schema.

* fix(backup): restrict schedules to local gateways

* fix(snapshot): harden Git restore and redaction

* fix(backup): block pushes of adopted history

* fix(backup): contain commits and pairing secrets
2026-08-12 08:11:22 -07:00
Peter Steinberger 557a8aeab0 refactor(ui): delete the orphaned custodian panel toggle contract (#122663)
Removing the Ask OpenClaw button from the chat workspace rail (#122507) left
CUSTODIAN_PANEL_TOGGLE_EVENT with no production dispatcher, so its event
constant, detail type, panel listener, handleToggleRequest, toggle(), the
shell's deferred-load handler and its forwarding delegate were all dead.

The floating panel keeps its real open path: app-shell-navigation raises
minimizeRequestId when the operator leaves the /custodian route mid-conversation
and the panel opens itself when the store has a real user turn. Preloading is
unchanged and still gated on openclaw.chat, so the panel mounts exactly when it
could be available.

Tests move onto that surviving path rather than being deleted; the unused
custodian.panel.toggle string goes with the contract.

Production LOC: -64, none added.
2026-08-12 08:00:21 -07:00
Peter Steinberger f9f602a0df test(macos): remove body-only smoke probes (#122645) 2026-08-12 07:59:35 -07:00
Amp 189ce7537e refactor(gradium): consolidate speech requests
Amp-Thread-ID: https://ampcode.com/threads/T-019ff438-3b93-77b8-9828-1d3c586cb127
2026-08-12 07:58:43 -07:00
Amp f690c107d7 refactor(inworld): consolidate speech requests
Amp-Thread-ID: https://ampcode.com/threads/T-019ff438-3b93-77b8-9828-1d3c586cb127
2026-08-12 07:58:43 -07:00
Amp 0060f6f5fc refactor(tts-local-cli): flatten audio conversion
Amp-Thread-ID: https://ampcode.com/threads/T-019ff438-3b93-77b8-9828-1d3c586cb127
2026-08-12 07:58:43 -07:00
Amp f01960ca50 refactor(session-url): centralize shared grammar
Amp-Thread-ID: https://ampcode.com/threads/T-019ff438-3b93-77b8-9828-1d3c586cb127
2026-08-12 07:58:43 -07:00
Amp 85b063f732 chore(scripts): reuse file scan helpers
Amp-Thread-ID: https://ampcode.com/threads/T-019ff438-3b93-77b8-9828-1d3c586cb127
2026-08-12 07:58:43 -07:00
Amp b8e5b15c0a refactor(media): flatten output formatting
Amp-Thread-ID: https://ampcode.com/threads/T-019ff438-3b93-77b8-9828-1d3c586cb127
2026-08-12 07:58:43 -07:00
Amp bfeb0ab3c1 refactor(gateway): share test fixture reset state
Amp-Thread-ID: https://ampcode.com/threads/T-019ff438-3b93-77b8-9828-1d3c586cb127
2026-08-12 07:58:43 -07:00
Amp 5451518f34 refactor(ui): consolidate workboard overlay filtering
Amp-Thread-ID: https://ampcode.com/threads/T-019ff438-3b93-77b8-9828-1d3c586cb127
2026-08-12 07:58:43 -07:00
Amp 41732aaccd refactor(media): use shared model normalization
Amp-Thread-ID: https://ampcode.com/threads/T-019ff438-3b93-77b8-9828-1d3c586cb127
2026-08-12 07:58:43 -07:00
Amp 04a94ba69f refactor(projects): remove duplicate origin lookup
Amp-Thread-ID: https://ampcode.com/threads/T-019ff438-3b93-77b8-9828-1d3c586cb127
2026-08-12 07:58:43 -07:00
Amp 57a3392042 refactor(parallel): localize shaping helpers 2026-08-12 07:54:03 -07:00
Amp a5384cde65 refactor(parallel): share search runtime shaping
Amp-Thread-ID: https://ampcode.com/threads/T-019ff438-3b93-77b8-9828-1d3c586cb127
2026-08-12 07:54:03 -07:00
Amp 0f72905381 refactor(test): consolidate comparison row traversal
Amp-Thread-ID: https://ampcode.com/threads/T-019ff438-3b93-77b8-9828-1d3c586cb127
2026-08-12 07:54:03 -07:00
Amp 05e7025015 refactor(infra): flatten LAN route hint resolution
Amp-Thread-ID: https://ampcode.com/threads/T-019ff438-3b93-77b8-9828-1d3c586cb127
2026-08-12 07:54:03 -07:00
Peter Steinberger ad8f803311 feat(ui): connect machines from the Where picker (#122635)
* feat(ui): add connect machine dialog

* docs(plan): track connect machine picker

* fix(ui): harden connect-machine dialog lifecycle
2026-08-12 07:51:37 -07:00
Amp e83e7d1133 fix(ui): satisfy binding select lint 2026-08-12 07:43:10 -07:00
Amp 9d68e25177 refactor(ui): unify usage snapshot requests
Amp-Thread-ID: https://ampcode.com/threads/T-019ff438-3b93-77b8-9828-1d3c586cb127
2026-08-12 07:43:10 -07:00
Amp 5b6cd8bf14 refactor(ui): consolidate device binding selects
Amp-Thread-ID: https://ampcode.com/threads/T-019ff438-3b93-77b8-9828-1d3c586cb127
2026-08-12 07:43:10 -07:00
Amp 819736d48b refactor(ui): consolidate presence inventory rows
Amp-Thread-ID: https://ampcode.com/threads/T-019ff438-3b93-77b8-9828-1d3c586cb127
2026-08-12 07:43:10 -07:00
Peter Steinberger a48092b29f fix(agents): reclaim compacted prompt projections (#122646) 2026-08-12 07:35:07 -07:00
Vincent Koc 3a9e461912 test(slack): restore enterprise auth fixture identity (#122639) 2026-08-12 22:26:46 +08:00
Amp df1c965911 refactor(commands): inline sandbox display formatters
Amp-Thread-ID: https://ampcode.com/threads/T-019ff438-3b93-77b8-9828-1d3c586cb127
2026-08-12 07:21:43 -07:00
Amp c5e757e00a refactor(config): inline account capability resolution
Amp-Thread-ID: https://ampcode.com/threads/T-019ff438-3b93-77b8-9828-1d3c586cb127
2026-08-12 07:21:43 -07:00
Peter Steinberger 6e71e9b156 feat(gateway): expose public worker ingress (#122578)
* feat(gateway): expose public worker ingress

* docs(plan): link public worker ingress PR
2026-08-12 07:20:02 -07:00
Peter Steinberger c5ba4efbd7 refactor(plugins): remove media test globals (#122636) 2026-08-12 07:07:19 -07:00
Peter Steinberger 85230cf76c test(secrets): cover Code Mode exec store env and document the harness boundary (#122405)
* test(secrets): cover code-mode nested exec store env; document harness boundary

* docs(secrets): warn that store env does not reach external agent harnesses
2026-08-12 07:06:40 -07:00
Peter Steinberger 4fcd9e12d9 fix(build): cancel stalled CLI metadata renderers (#122634)
* fix(build): drain startup metadata renderers

* fix(build): preserve undrained metadata state
2026-08-12 07:01:46 -07:00
Peter Steinberger df707a9670 feat: view this machine in the Desktop panel (#122545)
* feat(gateway): add gateway-host desktop source behind desktop.host lab

Introduce the host as a first-class desktop source so operators can view
the machine OpenClaw runs on, not just cloud-worker environments:

- protocol: desktop.observe / desktop.launch with a discriminated
  DesktopSource union (host | environment) plus an additive auth hint;
  EnvironmentSummary gains a top-level desktop flag
- config: desktop.host { enabled, port?, passwordFile? }, Labs-gated
- rfb-probe: pure RFB version/security-type parser used to detect an
  already-running loopback VNC server and classify its auth
- host-source: attaches to 127.0.0.1:<port>, refuses unauthenticated
  (None) and unsupported (VeNCrypt) servers, and refuses ARD with the
  supported alternative until the macOS milestone
- host-guidance: per-OS enablement text so no path dead-ends
- doctor + status report host desktop availability and auth type only

worker.desktop.observe/launch stay as delegating aliases with identical
behavior. Also drops the now-unused WorkerDesktopTunnels type export.

Live-verified against macOS Screen Sharing: probe reads RFB 003.889,
returns security types [30,33,36,35], classifies ard-account.

* test(gateway): probe RFB handshakes through the socket boundary

The probe's banner and security-offer parsers were exported solely so
unit tests could call them, which the dead-export gate rejects and which
tests internals rather than behavior. Keep them module-local and drive
the probe through a scripted loopback server instead.

The boundary tests also cover what pure-function vectors could not:
handshakes split across packets, legacy RFB 3.3 single-word security,
server-rejected handshakes, early hangups, and connect timeouts.

* feat(ui): let the Desktop panel view this machine, not just cloud workers

The Desktop panel was gated on a cloud-worker session placement, so an
operator running OpenClaw locally had no way to see the machine hosting
their main session even with a VNC server running on it.

Availability now follows the advertised desktop.observe method plus
operator.admin instead of session placement, and the picker lists every
environment whose summary reports a desktop, with the gateway row shown
as "This machine". Sources are passed to the generic desktop.observe /
desktop.launch RPCs; the app launcher stays worker-only. When a host
attach needs a password the gateway did not supply, the panel prompts and
keeps the value in memory for that connection only.

Adds the hostDesktop Labs toggle for desktop.host.enabled.

* fix(scripts): keep the env-var ratchet usable in shallow checkouts

The env-var budget check resolved its base ref, then hard-failed when
`git merge-base` found no shared ancestor. Shallow clones and grafted
agent checkouts resolve origin/main but truncate the history behind it,
so an advisory growth ratchet took down the whole check:changed gate
with "Could not resolve env-var count merge base for: origin/main".

Only the growth comparison needs a baseline, and the script already has
a no-baseline path. Treat git's exit 1 with empty output (no shared
ancestor) as that case and say so on stderr; a genuine failure still
exits 128 and still throws, and the absolute count-vs-budget check runs
either way.

* test(ui): measure the inline-code chip against its line box

The inline-code spacing test compared the chip's height to a prose text
rect, so it silently measured the monospace font's default line spacing.
That is ~17px on macOS and several px shorter on Linux, so the assertion
passed on CI and failed locally at 4.5 against a 3.75 bound -- after the
bound had already been widened once to chase browser font metrics.

Compare the chip to the paragraph's CSS line box instead, which is what
"the chip must not disrupt the line" actually means and is platform
independent. The horizontal gap stays as-is: it is em-derived padding
plus border, and it is the assertion that catches detached punctuation.

Verified both directions on macOS: the file is fully green, and
restoring the pre-fix 0.15em/0.35em padding still fails the gap
assertion at 5.41.

* feat(gateway): view macOS Screen Sharing from the Desktop panel

Modern macOS only offers ARD account authentication for Screen Sharing,
so the host desktop source refused every Mac. The Gateway now performs
the ARD handshake itself against the loopback server and hands the
browser a plain RFB 003.008 no-auth handshake, so the operator's macOS
account password authenticates the desktop without ever reaching the
browser, the observe result, a URL, or a log.

- rfb-preauth: ARD (type 30) Diffie-Hellman with MD5-derived AES-128-ECB
  credentials, and VncAuth (type 2) bit-reversed DES, both under a single
  10s negotiation deadline; Apple's RFB 003.889 maps to 3.8
- observe-bridge: runs pre-auth before splicing and starts the view-only
  filter at clientInit, since the browser handshake is consumed here;
  worker tokens keep the original version start phase
- host-source: attaches ARD, requiring per-observation credentials that
  live only in the one-shot observer token and are dropped after use
- doctor: offers an explicitly confirmed sudo launchctl repair when
  Screen Sharing is off, and prints the System Settings path otherwise

Live-verified against this Mac's Screen Sharing: the DH exchange and
credential framing are accepted and the server returns SecurityResult.
The VncAuth DES vector is confirmed against OpenSSL independently.
2026-08-12 06:58:30 -07:00
Peter Steinberger cc99d99f24 fix(installer): resolve relative CLI install paths (#122626) 2026-08-12 06:32:15 -07:00
Peter Steinberger 1e5e0d786c test(doctor): isolate Claude CLI health checks (#122627)
Amp-Thread-ID: https://ampcode.com/threads/T-019fee8d-665d-707b-a380-23f2a6a1ce03

Co-authored-by: Amp <amp@ampcode.com>
2026-08-12 06:27:03 -07:00
Peter Steinberger 2cb9a75648 improve(gateway): compose live session stress probes (#122519)
* test(gateway): compose live session stress probes

Amp-Thread-ID: https://ampcode.com/threads/T-019feaaa-c7ed-769e-9f29-a3612bec72e7

* fix(ai): resume after Responses compaction checkpoints

Amp-Thread-ID: https://ampcode.com/threads/T-019feaaa-c7ed-769e-9f29-a3612bec72e7

* test(gateway): compose multi-session subagent probes

Amp-Thread-ID: https://ampcode.com/threads/T-019feaaa-c7ed-769e-9f29-a3612bec72e7

* fix(test): invalidate inlined schema transforms

Amp-Thread-ID: https://ampcode.com/threads/T-019feaaa-c7ed-769e-9f29-a3612bec72e7

* test(ai): cover empty compaction owners

Amp-Thread-ID: https://ampcode.com/threads/T-019feaaa-c7ed-769e-9f29-a3612bec72e7

---------

Co-authored-by: Amp <amp@ampcode.com>
2026-08-12 06:22:08 -07:00
Vincent Koc 9b90e104c5 fix(tts): preserve hidden-only tagged fallback text (#122608)
Punchcard-Session: golden-brook-lantern-zw
2026-08-12 21:18:15 +08:00
Peter Steinberger ade3456dd4 feat: add one-paste node onboarding (#122499)
* feat(pairing): add short join onboarding

* fix(gateway): isolate device join routing tests
2026-08-12 06:17:39 -07:00
Paul Frederiksen fb9a62e995 fix(heartbeat): suppress silent exec acknowledgements (#73785)
Punchcard-Session: golden-meadow-orchard-ng
2026-08-12 20:57:39 +08:00
Peter Steinberger bdc595d1bd fix(gateway): refresh health after account removal (#122620) 2026-08-12 05:56:01 -07:00
Vincent Koc beb576c2ad test(slack): restore tool result reaction state (#122592) 2026-08-12 20:54:06 +08:00
Peter Steinberger 67dd56c51e test(cron): focus direct delivery coverage (#122621)
Amp-Thread-ID: https://ampcode.com/threads/T-019fee8d-665d-707b-a380-23f2a6a1ce03

Co-authored-by: Amp <amp@ampcode.com>
2026-08-12 05:43:18 -07:00
Vincent Koc c702bf2796 fix(ci): repair Slack enterprise fixture routing (#122589) 2026-08-12 20:32:41 +08:00
Peter Steinberger 209b3ade0f test(browser): model DNS lookup overloads (#122614) 2026-08-12 05:23:43 -07:00
Peter Steinberger 40cb6f0e3b feat(ui): keep Where picker destinations live (#122531)
* feat(gateway): enrich environment summaries

* chore(sdk): refresh plugin API surface

surface drift approved: additive EnvironmentSummary enrichment (runners plan rev 2, milestone 4)

* feat(ui): keep where picker destinations live

* docs: link picker liveness milestone PR

* fix(ui): deduplicate picker locale keys

* test(ui): update picker section expectations

* fix(ssrf): narrow lookup resolver contract

* fix(gateway): publish authoritative environment facts
2026-08-12 05:11:46 -07:00
Vincent Koc fc14a5a587 fix(sessions): reject missing explicit session targets (#122564)
* fix(sessions): reject missing explicit session targets

Punchcard-Session: brisk-willow-summit-k0

* fix(sessions): scope strict resolution to send and history

Punchcard-Session: brisk-willow-summit-k0
2026-08-12 20:11:27 +08:00
Peter Steinberger c97f3207a0 fix(outbound): report broadcast delivery truth (#122605)
Derive broadcast success from structured send outcomes instead of treating every returned send as delivered.
2026-08-12 05:09:32 -07:00
Peter Steinberger 5209d6cb05 test(gateway): keep session search tests focused (#122603)
Co-authored-by: Amp <amp@ampcode.com>
2026-08-12 05:08:21 -07:00
Ziyang Guo 220b2dcec7 fix(skills): reconcile manually created proposal targets (#118676)
* fix(skills): reconcile manually created proposal targets (#90388)

* fix(skills): preserve stale apply lifecycle errors

* fix(skills): stale existing create targets

* fix(skills): dispatch reconciliation hooks outside target lease

* test(skills): prove manual target reconciliation

* fix(skills): serialize proposal reconciliation with collection writes

* fix(skills): surface proposal reconciliation failures

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-08-12 20:06:56 +08:00
Peter Steinberger 79ac476b0f fix(test): type CDP DNS lookup mocks (#122607)
Amp-Thread-ID: https://ampcode.com/threads/T-019ff3db-c467-70ad-8ed3-81f2ba94b0c0

Co-authored-by: Amp <amp@ampcode.com>
2026-08-12 04:45:15 -07:00
Vincent Koc 3e6aec1d55 fix(state): avoid startup ownership snapshots (#122518) 2026-08-12 19:07:15 +08:00
Vincent Koc ce56c40dab fix(test): wait for gateway hook model activity (#122584) 2026-08-12 19:02:21 +08:00