Commit Graph
1678 Commits
Author SHA1 Message Date
Peter Steinberger 83dce46a7d fix(update): preserve sealed service definitions during code updates (#131021)
Separate code-update ownership, effective launcher identity, native service control, and definition mutation. Guard actual definition publication before related config or token writes, and use the installed CLI's preserve-definition restart with renewed ownership and live port/version/build verification.

Consolidate unit/environment publication and conditional rollback, retain main's plugin convergence and fresh-Doctor ownership, and make post-core child termination belong to the winning completion path. Integrate current-main heap-argument provenance and process-marker handling; resolve the service Node from the executable rather than counting backward through flags.

Retain boundary-level sealed/writable/unknown/foreign, mount, platform, failure, and build-identity proof while consolidating redundant tests. The QA cleanup removes 399 maintained test/support lines; focused current-main integration proof passes 1,279 tests with one pre-existing platform skip. Production and installer growth remains +239 net.

Preserves the reviewed repair from ac86fdff61da9c0fea9f62da00a8c9f22df6790d while integrating main at 56d89073dd. No permission weakening, schema or lease policy change, deployment, or release.
2026-08-28 07:10:42 -07:00
Peter Steinberger 0c35375958 fix(cron): distinguish intentionally suppressed deliveries (#131774)
Use the recorded suppression reason for human list and show status while preserving genuine delivery warnings and JSON contracts. Related: #111851. Thanks to @akalsey for the report.
2026-08-28 06:40:13 -07:00
Peter Steinberger b03d2e79e9 fix(sessions): prevent participant misattribution in Activity (#130986)
* fix(sessions): preserve participant identity and input provenance

Keep profile, agent, remote, observed, and legacy identities distinct in the existing participant table. Record accepted input at admission, including steering, instead of inferring a person from the session creator. Preserve historical membership and counts while leaving ambiguous profile timestamps unknown through stopped-writer Doctor migration.

Project full visibility-filtered person membership before preview limits so Activity does not misattribute channel identities or omit people outside the facepile. Keep participant membership separate from authorization and expose raw-selector ambiguity to memory operators.

Repair Doctor readiness reporting, generic Swift inline-union generation, direct-dispatch metadata handling, and fixture-owned database lifetimes. Verify namespace collisions, real provider input, accepted steering, visibility, backup/migration/reopen boundaries, native decoding, and the built-CLI lifecycle.

Fixes #130661

* fix(macos): isolate readiness and discovery lifecycles

Keep readiness fixtures private for their entire lifetime and give health readiness one deadline owner. Start and cancel slow host discovery with active discovery, not model construction.

Make native protocol, callback, onboarding, and process-cleanup tests observe their intended lifecycle phases without expanding deadlines or weakening assertions. Correct the documented signing default.

Validated with 1,839 parallel native tests, the release product build, causal negative controls, pinned Swift lint/format checks, and fresh isolated autoreview. Native production delta: -5 lines.

* docs(macos): clarify app profile isolation boundaries

* build(protocol): refresh generated Swift install models

* fix(protocol): preserve optional literal field presence

* fix(ci): bound SDK declarations and isolate test lifecycles

Discover the current declaration source graph in a joined child before normal eager emission, and track its complete source-bearing cache inputs. Repair shared jsdom focus teardown and native worker fixture request ordering without changing UI focus ownership or execution fallback policy.

* test(sessions): prove Goal participant upgrade boundaries
2026-08-28 06:04:18 -07:00
Peter Steinberger ca59305029 fix(gmail): keep setup command failures readable (#131502)
* fix(gmail): keep setup command failures readable

* test(gmail): consolidate setup diagnostics coverage

* docs(ci): clarify Swift test execution policy

* test(brave): cancel requests at the transport boundary

The in-flight cancellation fixture polled for fetch within one second, but
first-use runtime and DNS preparation can exceed that deadline. The first
case then exited without aborting or awaiting its request, leaking it into
the next case's global fetch mock (CI run 33118704789).

Abort from the existing mocked transport after its listener is registered,
await terminal rejection, and retain exact call-count and aborted-signal
assertions. No production behavior, timeout, or SDK mock changes.

(cherry picked from commit 697040a81eeb26a8ea947cec01b544125c3d98c0)

* test(openshell): keep mirror socket fixtures within platform limits

The wrapper's canonical macOS temp root makes the nested socket fixture
exceed the 104-byte sockaddr_un.sun_path field, failing at listen before
mirror reconciliation. Shorten the existing temporary-directory prefix
without changing the socket name, assertions, cleanup, or production code.

* refactor(channels): reuse ingress stop guard
2026-08-28 04:33:50 -07:00
Peter SteinbergerandAmp df905a6cb6 fix(sessions): preserve shared history across startup and repairs (#127241)
* fix(doctor): atomically repair session transcripts

* fix(sessions): keep runtime reads and repairs on SQLite owners

Resolve physical session databases once and carry that identity through startup, search, boards, maintenance, and Doctor. Remove automatic legacy JSON import from Gateway startup while preserving explicit Doctor upgrades.

Publish repaired legacy transcripts with strict atomic replacement and preserve the source when backup, write, or rename fails.

* fix(sessions): simplify startup ownership and diagnostics

* test(sessions): migrate legacy history through Doctor in CLI proof

---------

Co-authored-by: Amp <amp@ampcode.com>
2026-08-28 03:32:53 -07:00
Peter Steinberger de12e0a06c feat(approvals): standing-grant ledger, revocation, and configurable terms (#131602)
* feat(approvals): standing-grant ledger, revocation, and configurable terms

Completes the operator half of cron standing grants (#129526):

- Grants are listable and revocable. New gateway methods
  exec.approval.grants.list/revoke (operator.approvals scope), CLI
  'openclaw approvals grants list|revoke', and a Standing grants section
  on the Control UI approvals page with per-row revoke. Revocation is
  idempotent, records the acting client, and takes effect at the next
  occurrence's spawn boundary.
- Grant terms are frozen at mint and configurable. Default stays
  until-revoked (matching what shipped Always allow has always meant);
  tools.exec.grantExpiryDays sets a day-bounded default for future
  grants (enterprise fleet policy), and resolve surfaces may override
  per grant via grantExpiresInDays / --expires-in-days. Existing grants
  keep their minted terms; config changes are never retroactive.
- expires_at_ms goes nullable (NULL = until revoked). The mandatory-
  expiry shape never reached a release tag, so the lazy ensure rebuilds
  it in place; grants are re-derivable authority, so the fail-closed
  cost is one re-prompt.
- Approval cards say what Always allow does. Automation approvals carry
  a standing-grant ApprovalScope (new union member) built server-side
  from the cron run registry (now carrying the job display name); the
  Control UI inbox card and modal render it via i18n, e.g. 'Always
  allow runs this exact command for "grant-demo" without asking, for
  10 days (revocable)'.
- Aux method registries stay in lockstep: new parity test fails when a
  GATEWAY_AUX_METHODS entry lacks a lazy handler (this gap produced
  live unknown-method errors during bring-up).

Live-proven on a hermetic gateway: until-revoked grant ran 62 promptless
occurrences; UI and CLI revocation each returned the prompt on the next
occurrence; config default stamped exactly 10.0 days via a UI resolve;
--expires-in-days 99 override stamped 99.0 days; ledger and card
screenshots captured from the running Control UI.

* chore(ui): annotate the scope narrowing assertion for the safety ratchet

* test(gateway): move aux-method parity check to its own suite

* fix(ci): boundary-parse UI approval scope; register grants schemas for native codegen

- The Swift/Kotlin generators discover named schemas through the
  protocol schema fragments; the standing-grant scope member and the
  grants list/revoke shapes were missing there, which made the Swift
  generator silently drop the ApprovalScope union and broke ios-build.
  Registered, regenerated, union and new struct emitted again.
- The chained-assertion lane rejects 'as unknown as' in the UI scope
  parser; replaced with a real per-kind boundary parser, which is what
  the rule asks for.
- The sqlite-allow-raw marker must share the line of a mid-statement
  prepare() call for the Kysely guardrail; split the pragma read so the
  SAFETY comment and the allow marker each sit on their own guarded
  line.

* chore(ui): record startup-budget growth for the approvals scope line

The standing-grant scope renderer and grants-ledger strings ride the
boot path (~700 B gzip). Recorded via the check's --update-baseline flow
with the reason inline; well under the committed 350 KiB hard cap.

* fix(gateway): restore the channel-restart helper export dropped on main

#118157 made startGatewayChannelFromActiveRegistry module-local while
its colocated test still imports it, breaking check-test-types and the
compact shard on every merge ref. Smallest correct main heal per the
broken-CI doctrine; the test passes again.

* fix(gateway): drive channel-restart reload coverage through its exported owner

Replaces the prior export restore: #118157 made the restart helper
module-local (the dead-export scan is right that tests are not
production consumers), but left its colocated test importing it, so
main failed check-test-types either way. The test now exercises the
same preserveManualStop semantics through rollbackStoppedGatewayChannels,
the exported reload owner, and the helper stays private.

* test(ui): answer the grants ledger request in approvals-page history tests

The approvals page now loads the standing-grant ledger next to history;
a method-aware stub answers it out of band so the ordered history mocks
keep their call counts. Adds coverage for the ledger render and the
revoke round-trip.

* chore(ui): record CI-observed startup-JS baseline for the grants surface

The e2e-real-gateway lane builds the same tree ~600 B larger than checks-ui
and local builds, past the 64 B variance allowance; record the CI-observed
value so the enforcement limit stops straddling cross-lane build variance.

* fix(cli): escape standing-grant ledger fields visibly; register grants methods in inventory tests

The grant ledger's revokedBy (client display name), automation label, and
agent-authored command now go through escapeApprovalTextForTerminal like the
pending-approvals table, so hostile control characters render as visible
\u{...} escapes instead of being silently stripped by the table renderer.
Regression test fails pre-fix. Also lists exec.approval.grants.list/revoke
in the 2026.8 release-train roster, classifies the approvals grants command
group for JSON output, and fixes the stubGrants mock typing.
2026-08-28 02:56:20 -07:00
Peter Steinberger 3fb0ba15e9 fix(gateway): reduce memory pressure with large session histories (#131653)
* fix(gateway): reduce transcript memory pressure and preserve heap controls

Avoid overlapping raw SQLite rows and transcript serialization copies while
preserving complete fenced snapshots, provenance, callbacks, and reset hashes.
Scale managed Node Gateway budgets with host capacity, preserve operator heap
ownership, and keep service repair and macOS ownership aware of native flags.

* fix(daemon): preserve heap controls after named preloads
2026-08-28 02:28:34 -07:00
Peter Steinberger 2d625dad30 fix(config): ignore discarded SecretRefs when applying batches (#131656)
* fix(config): validate surviving batch values through one mutation flow

* fix(cli): drain config failure output before exit

Unwind already-reported config failures through the shared CLI finalizer so resources close and piped JSON drains before the requested exit. Preserve injected runtime ownership and avoid rendering typed exits twice. Cover full 1 MiB pipe output, exact status, and config error contracts.

* refactor(config): make snapshot validation throw on failure
2026-08-28 02:21:23 -07:00
Peter Steinberger 14d6bb81ad fix(memory): forget diary claims after session backfill (#131626) 2026-08-28 01:48:08 -07:00
Peter Steinberger 0294c7fdc9 refactor(system-agent): unify operator handoffs and proposal lifecycle (#131630) 2026-08-28 01:32:47 -07:00
f466dc0dcf fix(release): consent to staged Codex onboarding companion (#131298)
* fix(release): consent to staged Codex onboarding companion

* fix(e2e): prepare reviewed onboarding plugins explicitly

Use the shared command-help consent helper for the reviewed Codex and
external channel fixtures. Keep exact staged Codex versions pinned, use
official catalog selectors for published packages, and preserve historical
automatic setup when the candidate CLI lacks capability consent.

Replace source-order assertions with shell boundary coverage and document
reviewed plugin preinstallation before retrying noninteractive setup.

Co-authored-by: Dallin Romney <dallinromney@gmail.com>

* fix(e2e): preserve official provenance for candidate channels

Stage the selected Discord or Slack companion with Codex in the verified
prerelease registry and install its exact pinned npm spec after onboarding.
The former npm-pack path installed matching bytes but could not establish
the official provenance required by trusted plugin state APIs.

Remove local archive packaging and install overrides. Reject missing or
mismatched source companions before CLI use while keeping published catalog
selection and historical automatic setup unchanged.

Co-authored-by: Dallin Romney <dallinromney@gmail.com>

* fix(e2e): preserve frozen channel candidate registry

Keep the immutable Codex registry artifact unchanged and serve source Discord/Slack tarballs as separately validated exact npm packages. Remove source install overrides and fail closed without the mounted registry.

Co-authored-by: Dallin Romney <dallinromney@gmail.com>

* fix(e2e): keep candidate plugins in one registry

Restore the planner-owned immutable prerelease registry artifact containing Codex and the selected source channel companion. This supersedes the separate tarball mount follow-up.

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
Co-authored-by: Dallin Romney <dallinromney@gmail.com>
2026-08-27 23:35:10 -07:00
tzy-17andPeter Steinberger a29e5c9a31 fix(gateway): own standalone MCP App request lifetimes (#119388)
* fix(gateway): own standalone MCP App request lifetimes

Keep initial loading and individual MCP requests bounded without applying
a derived single-request timeout to composed App operations. Carry caller
cancellation through the HTTP request owner, isolate shared catalog waits,
and preserve bounded graceful cleanup before terminal document teardown.

Retire stale document/bootstrap responses and observe asynchronous catalog
rejections without changing authorization, public SDK contracts, or retry
behavior. Add serialized-owner regressions and real Chromium conformance.

Rewrites #119388 while preserving the contributor's report and credit.

Co-authored-by: 唐梓夷0668001293 <tang.ziyi@xydigit.com>

* test(ui): preserve rendered MCP App diagnostics without suppression

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
Co-authored-by: 唐梓夷0668001293 <tang.ziyi@xydigit.com>
2026-08-27 23:33:49 -07:00
Peter Steinberger 1ae29ca1f6 fix(transcripts): preserve captures with oversized export names (#131508) 2026-08-27 23:03:31 -07:00
SunnyShuandPeter Steinberger 23a681efa6 fix(system-agent): tell messaging users a delegated approval can't be applied from chat (#116519) (#117432)
* fix(system-agent): surface operator-only approval handoff on all delegated routes (#116519)

Delegated OpenClaw writes from messaging channels told the user to approve
conversationally ("Say yes to apply"), but delegated sessions intentionally
ignore chat approvals — only an operator in the OpenClaw UI can resolve them.

- Default agent-loop route: thread operatorApprovalOnly from the engine
  through the turn runner into the ring-zero tool options; the tool registers
  the delegated proposal for the operator registry and instructs the model to
  surface the OpenClaw operator UI / `openclaw` CLI path instead of a
  dead-end conversational prompt (the needs-approval marker is kept so
  out-of-process CLI hosts still mirror the refusal).
- Planner-fallback route: the delegated reply preserves refusal evidence
  (what was requested, that it was not applied) alongside the operator
  handoff.
- Gateway: the closed SystemAgentChatResult schema is unchanged — the
  openclaw.chat response carries only needsApproval/proposalId; no
  approvalHint field.
- Coverage: real agent-loop turn through the real ring-zero tool, tool-boundary
  delegated refusal + marker transition, engine default-route passthrough, and
  direct-session "Say yes to apply" preserved.
- Plugin SDK: regenerate plugin-sdk-api-baseline.jsonl — the new optional
  operatorApprovalOnly field on SystemAgentToolOptions flows into the
  createOpenClawCodingTools options closure, changing its closureHash; the
  export declaration is unchanged.

* fix(system-agent): preserve validation in delegated approval handoffs

Keep executor preapproval validation before staging delegated proposals, share actionable operator handoff text, and align the system prompt. Cover real tool and transport behavior while retaining direct approvals.

Co-authored-by: SunnyShu0925 <shu.zongyu@xydigit.com>

* test(system-agent): restore scoped CLI fixture and reuse suites

Keep delegated approval coverage inside existing suites without increasing shard or file-size limits. Restore the CLI backend fixture dropped when chat-engine tests were split, avoiding real plugin setup loading in routing and continuity tests.

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-08-27 22:51:24 -07:00
Peter Steinberger fe721853d7 fix(config): accept supported exact model pins outside curated catalogs (#131562)
Fixes #131489 by preparing the selected provider runtime during read-only config model validation and keeping its lease through resolution.
2026-08-27 22:44:22 -07:00
SunnyShuandPeter Steinberger 2b263adad6 fix(secrets): preflight exec provider command paths before config acceptance (#117128)
* fix(secrets): preflight exec provider command paths before config acceptance

Schema validation and config writes accepted exec SecretRef command paths that
gateway cold start rejects (symlink, missing, unsafe permissions/ownership), so
a config that printed "Config valid" could crash the gateway on the next restart.

Share one non-executing exec-provider command-path validator
(`src/secrets/exec-provider-path-validation.ts`, extracted from `resolve.ts`
`assertSecurePath`) across cold-start activation, `openclaw config validate`, and
supported config writes so all three surfaces return the same verdict for manual
exec SecretRef providers.

- New `src/secrets/exec-provider-path-validation.ts` (`assertSecureExecCommandPath`);
  `resolve.ts` imports and calls it, deleting the duplicated logic.
- `config validate` calls `collectManualExecProviderCommandPathErrors` with
  `validateAllProviders: true` so the strict validation command checks every
  configured manual exec provider. Config writes (`config set/patch/dry-run`)
  use targeted preflight instead — they check only providers touched by the
  operation, or all providers when the write edits the `secrets.providers`
  collection itself — so an unrelated routine write is not blocked by a dormant
  inactive provider that gateway startup would skip. A shared
  `collectTouchedProviders` helper deduplicates the touch-collection logic this
  function and `collectPluginIntegrationProviderErrors` both need.
- Guards against non-object provider values so a value-mode write setting a
  provider to `null`/primitive no longer throws a raw TypeError.
- Docs aligned with the exact permission rule, symlink rejection, and that
  `config validate` checks every provider while writes use targeted preflight.

The extracted validator stays at parity with current `resolve.ts` cold-start
activation: absolute path, non-symlink, trusted-directory containment,
non-writable-by-others permissions, current-user ownership, and Windows ACL
availability. It deliberately does not add a regular-file or owner-execute-bit
requirement, so cold start (which now calls the shared validator) does not grow
stricter and block existing configurations without an upgrade path. Tightening
the executable policy is upgrade-sensitive and left to maintainers (the issue
carries `needs-product-decision` / `needs-security-review`).

Scope is limited to manual exec SecretRef providers as reported in #117051.
Plugin-integration materialized-command parity, the deprecated `allowInsecurePath`
manifest field, `checks.schema` semantic widening, and dead CLI flag retirement
from earlier revisions are intentionally left out for the same boundary reason.

Closes #117051

* refactor(config): unify secret provider preflight and mutations

Share one provider issue collector and one set/patch/unset write lifecycle. Preserve validation JSON and targeted recovery, and carry provider metadata through patch deletions. Keep startup path policy unchanged.

Co-authored-by: SunnyShu0925 <shu.zongyu@xydigit.com>

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-08-27 22:33:34 -07:00
Peter Steinberger 13125bf33f fix(cron): record real delivery outcomes and stop false-success completions (#131228)
* fix(cron): record real delivery outcomes and stop false-success completions

Record delivery outcomes at their owners and derive whole-run completion, delivery failure alerts, and one-shot retention from those facts. Keep execution status separate from delivery failure, and retain undelivered jobs and transcripts for inspection.

Requested delivery is required unless explicitly best-effort. Existing alternate-route alert policy and duplicate-send protection remain unchanged.

* fix(cron): preserve cleanup ownership and record-only replay

Transfer transcript cleanup ownership before awaiting delivery dispatch so
exceptions retain the diagnostic session while runtime resources still retire.
Remove the returned cleanup flag and exercise actual dispatch in deletion and
admission-release tests.

Keep delivery-failure notification recovery record-only, preserving the
historical receipt without scheduling another alert. Absorb the single-use
alert helper into finalization and strengthen canonical delivery-state coverage.

* fix(cron): retain one-shots only for failed or unknown delivery

* fix(cron): treat empty webhook summaries as intentional silence

* fix(cron): throttle delivery failure alerts with cooldown

* docs(cron): align cleanup and bestEffort text

* fix(cron): align cleanup and replay with run outcomes

Release quiet and best-effort successful one-shot sessions through the
existing dispatch cleanup owner. Carry the finalizer's undelivered execution
status so fatal errors and unrecovered presentation warnings retain evidence.

Restore replay cooldown only from recorded notification intent, without
recomputing alert requests through current policy. Consolidate target-error
results and clarify the shared cooldown and successful-execution contracts.

* fix(cron): extract reply skip-reason leaf to break import cycle and refresh prompt snapshots
2026-08-27 22:20:25 -07:00
Peter Steinberger 2058fd7e91 fix(plugins): preserve unreadable registry state (#131521) 2026-08-27 21:48:11 -07:00
Peter Steinberger cd7b282ed8 fix(sessions): migrate long histories without exhausting heap (#131276)
* fix(sessions): bound legacy transcript import memory

Stage transcript payloads and deduplication in private temporary SQLite storage before the existing atomic import. Rebuild projections from navigation metadata and stream payload reads rather than retaining entire histories. Preserve exact handoffs, source validation, and archive recovery.\n\nFixes #127468.

* build: register doctor transcript staging SQL boundary

* perf(doctor): bound healthy history checks and import cleanup

Stream unchanged header and label detection while retaining exact snapshots and atomic guards for positive repairs. Reuse one import-finalize operation for handle closure, schema maintenance, and automatic incremental vacuum.

Keep full integrity checks, NONE-mode conversion, and explicit full compaction. Verified constrained-heap regressions, real historical upgrades, complete long-history Docker cases, process interruption, source mutation, and temporary-volume exhaustion.
2026-08-27 21:44:41 -07:00
Peter Steinberger 629a47e3cc fix(config): preserve indexed and whole-list agent edits (#131369)
* fix(config): preserve agent roster mutations

* fix(config): reset indexes when replacing agent rosters

* fix(config): replace rosters before converting discarded state

* docs(config): keep roster release notes in PR
2026-08-27 21:17:56 -07:00
Peter Steinberger 72766e7bb8 fix(transcripts): stop reporting replaced captures as active (#131344)
* fix(transcripts): retire replaced captures from active status

* test(transcripts): move Discord lifecycle proof across public test boundary

* test(transcripts): synchronize pending startup without polling

* test(discord): keep voice harness imports on public SDK
2026-08-27 20:36:22 -07:00
Peter Steinberger fbf24873f4 fix(doctor): restore warnings for canonical agent entries (#131443) 2026-08-27 20:00:02 -07:00
Peter Steinberger 1aab371996 fix(update): keep repair JSON stdout parseable (#131411)
Route repair and finalize doctor diagnostics through the existing fresh-process owner so JSON stdout stays parseable on success and failure. Preserve workspace suggestions, human output, and no-restart behavior; retain subprocess diagnostics before canonical JSON errors.
2026-08-27 19:42:08 -07:00
Peter Steinberger 8cbda43166 fix(transcripts): report auto-start shutdown warnings (#131381)
Configured captures now report failed summary exports and provider-stop warnings while preserving saved notes and sibling cleanup.

Refs #131375.
2026-08-27 19:10:21 -07:00
Peter Steinberger d933395f1a fix(plugins): refuse git installs onto an existing managed checkout (#131175)
* fix(plugins): refuse git installs onto an existing managed checkout

Check the managed Git target before cloning, using the same availability guard as npm and directory installs. Preserve explicit update and force behavior, and protect existing checkout files when a repository changes its plugin id.

* docs(plugins): clarify git force reinstall identity limits

Limit the Git force example to reinstalling the same plugin id. Force replaces the checkout but does not migrate an existing install record to a different manifest id; normal ownership validation still applies.
2026-08-27 16:52:59 -07:00
Peter Steinberger 0fdae639d1 fix(memory): forgotten facts survive in consolidation history (#131248)
* fix(memory): forgotten facts survive in consolidation history

* refactor(memory): share purge planning and consolidation fixtures
2026-08-27 16:28:04 -07:00
Patrick Erichsen 7b7858d955 feat(clawhub): show security audit before installs (#131233)
* feat(clawhub): show audit details before install

* test(clawhub): update fixture audit contract
2026-08-27 16:20:59 -07:00
Peter Steinberger 2c9a5d6add fix(channels): preserve authored config during setup (#131235)
* fix(channels): preserve authored config during setup

* fix(channels): inspect implicit directory accounts read-only
2026-08-27 16:13:05 -07:00
Peter Steinberger 61a47996d5 fix(memory): forgotten content survives retries and consolidation (#131179)
* fix(memory): preserve provenance until derived content is purged

* refactor(memory): simplify provenance key collections
2026-08-27 15:44:53 -07:00
Peter Steinberger e0680fdd42 fix(cli): preserve authored config during channel auth (#131117)
* fix(cli): preserve authored channel config during auth

* fix(cli): preserve source config for auth selection

* test(ui): synchronize task panel hover assertions
2026-08-27 14:11:22 -07:00
Peter Steinberger 9be3cefabd feat(configure): surface the trusted-proxy loopback opt-in with its warning (#131132)
* feat(configure): surface the trusted-proxy loopback opt-in with its warning

Ask for explicit consent before enabling same-host trusted-proxy authentication,
and explain the runtime rejection when consent is declined. Preserve existing
loopback consent and unprompted device enrollment policy on same-mode reruns.

Reuse runtime loopback classification, add English and Chinese wizard copy,
and document the consent and preservation behavior.

* test(configure): assert wizard auth through the real builder

Remove the auth-builder mock and replacement factories so gateway prompt tests verify returned configuration across proxy, token, password, and SecretRef flows. Retain all consent regressions while reducing test scaffolding and reusing tracked environment cleanup.
2026-08-27 12:45:23 -07:00
Peter Steinberger 025ae36a72 fix(device-pair): verify retained subscribers before archiving the migration source (#131008)
* fix(device-pair): verify retained subscribers before archiving the migration source

Precheck remaining namespace capacity before importing legacy subscribers. Verify source and pre-existing destination keys in the shared JSON importer before reporting completion or archiving, preserving the source and warning when retention falls short. Keep runtime caps, eviction policy, and registration semantics unchanged.

Prepared for draft PR maintainer review. Review-required: persistent-state retention semantics.

* fix(device-pair): omit absent subscriber migration fields

Keep absent account and thread fields out of normalized legacy subscribers so the strict plugin-state JSON serializer accepts ordinary subscriptions. Preserve numeric zero thread IDs and exercise all optional target combinations through the real migration contract.
2026-08-27 11:52:24 -07:00
Peter Steinberger 80082b2476 fix(configure): preserve unrelated gateway auth policy across reconfiguration (#131035)
* fix(configure): preserve unrelated gateway auth policy across reconfiguration

* test(configure): exercise real auth builder in gateway prompt tests

Replace fake auth factories and builder-call assertions with returned-config checks. Cover password policy preservation, generated-token parity, and SecretRef output without changing production behavior.
2026-08-27 11:38:49 -07:00
Peter Steinberger 19d61d9ada fix: inspect exact hook names before matching key aliases (#131081)
Share name-first, ambiguity-aware hook selection with toggles and carry the selected hook to rendering and exit status. Preserve unique keys, missing-hook output, plugin-managed inspection and mutation policy. Closes #131075.
2026-08-27 11:25:30 -07:00
Peter Steinberger 834368b7d4 fix(browser): cancel downloads after output save failures (#131048) 2026-08-27 10:28:08 -07:00
Peter Steinberger ff3cf3de3b docs(start): correct headless credential handoff to the SQLite auth store (#131024) 2026-08-27 09:40:27 -07:00
Peter Steinberger 8012723c72 fix(channels): keep configured accounts in JSON inventory (#130738)
* fix(channels): keep configured accounts in JSON inventory

Keep metadata-only inventory independent of setup-runtime eligibility, while retaining setup precedence and failure visibility. Let status audits resolve channel capabilities at the audit owner instead of treating inventory metadata as complete adapters.

Fixes https://github.com/openclaw/openclaw/issues/130700

* test(status): align JSON audit owner expectations
2026-08-27 07:38:30 -07:00
Peter Steinberger 11ef173077 fix: preserve native session ownership during cleanup and attachment (#130864)
* fix: preserve native session ownership during cleanup and attachment

Prepare permitted harness owners for offline session deletion. Reject direct
attachment of parent-controlled Codex children before displacing ownership.
Keep deadline and client authority through binding publication, and release
accepted subscriptions when publication fails without a remaining owner.

Unify conversation create/attach and preserve observational child monitoring.
Verified 950 focused/sibling tests, production and test types, independent
Codex review, and the real built offline CLI capacity reproduction.

* test: avoid shadowing the native binding row
2026-08-27 03:37:44 -07:00
Peter Steinberger 1cbcf141ed fix(gmail): keep forwarding alive across watcher restarts (#130853)
* fix(gmail): keep forwarding alive across watcher restarts

* fix(gmail): preserve foreground CLI shutdown ownership
2026-08-27 02:29:33 -07:00
Peter Steinberger d3aa4be83a fix(cli): honor gateway --port on the status leaf (#130847) 2026-08-27 02:24:40 -07:00
Peter Steinberger b5fb4fa938 fix(hooks): load linked hooks and nested packs (#130813)
Resolve explicit extra roots as hooks or declared packs so successful linked installs are discovered and executed. Select only declared pack leaves while preserving collection scanning, source policy, and containment checks.

Fixes #130783.
2026-08-27 01:28:38 -07:00
Peter Steinberger 09d92ff86d fix(status): show healthy channels as OK in deep health (#130794) 2026-08-27 01:03:07 -07:00
Peter Steinberger e4d602c6f3 fix(worker): keep background servers alive after replies (#130733)
* fix(worker): keep background servers alive between turns

Retain the supervised worker environment while background execs are live,
while recreating turn admission, tools, connections, and authorization for
each turn. Keep physical worker ownership separate from bounded turn
receipts so cancellation, restart recovery, and environment retirement
cannot discard a still-running worker.

Preserve process polling across turns, release turn callbacks, join exec
finalization before environment cleanup, and require exact worker stop
confirmation unless a dedicated provider proves the machine is gone.

Fixes #130450.

* fix(worker): fence revoked placements and verify retained lifetimes

Record provider-loss teardown intent before remote stop, prevent pending cleanup
from being recovered as an active placement, and preserve exact physical ownership
until stop is confirmed. Keep draining state when the provider becomes unavailable.

Remove the ownership/lifecycle import cycle and align workspace-retention proof
with physical teardown. Exercise missing-capability rejection and reconnect on
real Gateway/node wire, preserving scenario and cleanup failures in the harness.

* test(worker): verify durable startup revocation cleanup
2026-08-27 00:35:19 -07:00
Peter SteinbergerandVincent Koc 1ea2640f54 refactor(state): consolidate wide rows, plugin index, workspace attestations, and shared auth singletons at schema v13 (#130466)
* refactor(state): make cron and subagent rows JSON-canonical

* refactor(state): make gateway origin device tokens canonical at v13

The lazy ensure predates the table joining the canonical schema; at the
v13 bump the schema owns creation, so the feature-local DDL, WeakSet
dedupe, and lazy-list entry retire. The legacy-file guard the ensure
carried stays at each call site.

* test: drop obsolete lazy-ensure coverage for origin device tokens

The table is canonical at v13; same-version lazy creation no longer
exists to protect. Origin CRUD, isolation, and rotation coverage remains
in the surviving cases.

* refactor(state): fold installed_plugin_index into config_machine_state

The singleton index row becomes one JSON value under
plugins.installedIndex with its rollback-fencing revision inside the
value; reads, CAS restore, and the lease-held write transactions use
direct Kysely on config_machine_state so the state_leases assertion
stays in-transaction. The v13 migration imports the row and drops the
table; the additive workspace_dir entry folds with it. Doctor guidance,
docker staging, and the e2e probes name the machine-state row.

* refactor(state): merge workspace_attestations into workspace_setup_state

One row per workspace now carries both setup milestones and the
attestation clock: nullable setup columns represent attestation-only
workspaces (replaceWorkspaceAttestation can precede any setup write) and
setupExists derives from a non-null version. The bootstrap-hash FK
repoints to the merged table; migration receipts keep the historical
workspace_attestations discriminator string. The v13 migration grows and
rebuilds the table, merges attestation rows (orphans without a path
alias drop — their hashes re-derive at the next bootstrap attestation),
and the consolidation kind is renamed state-consolidation-v13 to cover
the batch.

* test(state): cover the workspace merge and consolidation fallout

The v12-to-v13 regression seeds merged, attestation-only, and orphan
attestation workspaces; the 13-to-12 downgrade fixture recreates
workspace_attestations and installed_plugin_index from the folded data;
the fold-in migration gates the additive workspace_dir column for
pre-additive rows; the workspace merge now triggers on the setup table's
own shape so stable-era databases without an attestations table still
reshape; the consolidation applied-message covers the batch.

* refactor(state): fold shared auth profile singletons into config_machine_state

The shared-state auth_profile_stores/auth_profile_state rows (fixed key
'shared') become authProfiles.store/authProfiles.state machine-state
values; the agent-DB tables of the same names are untouched. Git-backup
redaction moves from table-drop to the authProfiles. secret prefix with
seeded-secret absence proof; migration receipts keep the historical
table-name discriminators; the shared-auth relocation and receipt
verification project the KV cells back to the receipt-era row shapes so
persisted digests stay byte-compatible. mcp_oauth_stores stays a table —
its multi-key fold is a named follow-up.

* test(state): finish shared-auth fold coverage and annotate boundary casts

Auth seeders and assertions across the e2e/scripts/secrets suites target
the authProfiles machine-state cells; the v12-to-v13 regression proves
payload-byte fidelity, non-shared-row drop, and insert-if-absent
precedence; the downgrade fixture recreates and repopulates both v12
tables. Boundary type assertions in the plugin-index store carry SAFETY
invariants per the ratchet.

* chore: shrink assertion-safety baseline for plugin-index store

* refactor(doctor): delete the dead onboarding-recommendations migration

Its input — the unscoped 'primary' onboarding row — existed only between
9a93a52a8a and 473962b7de, a two-day beta window; no shipped stable
can produce it and the runtime table folded away at v12. The audit
backup list keeps recognizing system-agent.jsonl artifacts because beta
installs that ran that import may still carry its backups.

* docs: sync the 13-to-12 downgrade example with the executable fixture

* style: format the synced downgrade example

* style: drop unused import and duplicate union constituent

* fix(state): keep orphan attestations across the v13 workspace merge

The merged workspace_setup_state required a workspace path, but legacy
orphan hashed-key attestations never recorded one. workspace_path is now
nullable (setup rows still enforce it via CHECK), the v13 migration and
the doctor file import keep orphans with a NULL path that heals on the
next live access, and the 13-to-12 downgrade keeps attestation-owned
hashes. Doctor test seeds move to the folded KV row.

* perf(state): retire unused cron indexes

* fix(state): preserve v13 migration recovery

* fix(state): preserve v12 lazy-table upgrade

* docs(state): document v13 auth relocation

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-08-27 15:26:14 +08:00
Peter Steinberger 2fd16c2855 fix: share managed Gateway startup readiness across setup (#130682)
* fix: wait for Gateway startup after configure daemon setup

* fix: share managed Gateway startup timing across setup
2026-08-27 00:11:32 -07:00
a3eb0692a2 fix(cli): reject --agent for global model refresh (#130448)
* fix(cli): models refresh rejects parent --agent like set/aliases/scan

`models refresh` refreshes the global hosted catalog
(refreshRemoteModelCatalog) and takes no agent, but silently accepted a
parent --agent, implying a per-agent scope it does not deliver. #126864
landed rejectAgentScopedModelCommand for set/set-image/aliases/scan but
left refresh unaddressed (it scoped out only fallbacks/image-fallbacks).
Add "refresh" to GlobalOnlyModelCommandName and switch refresh's action
to the same loadModelsRuntime + reject + runModelsCommand pattern, so
--agent fails fast with the same error instead of a silent global refresh.

Co-Authored-By: Claude <noreply@anthropic.com>

* docs(cli): list models refresh among --agent-rejecting commands

`docs/cli/models.md` listed `set`/`set-image`/`scan`/`aliases` as
rejecting `--agent` but omitted `refresh`, so the new guard landed in
the previous commit was not reflected in the docs. Add `refresh` to the
global-only list and note it on the refresh section.

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: ruel225 <ruel225@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
2026-08-27 14:25:44 +08:00
Peter Steinberger 7eebd6d4a6 docs(hooks): clarify setup and execution contracts (#130734) 2026-08-26 23:12:06 -07:00
EdenandAyaan Zaidi a0abb23d00 fix(plugins): keep beta installs on gateway release (#127791)
Keep official plugins on the gateway release stream so beta gateways do not silently install stable artifacts. Resolve hosted catalog entries at the shared boundary, stop missing cohorts before hook fallback, and keep recovery notices visible.

Co-authored-by: 許元豪 <146086744+edenfunf@users.noreply.github.com>
Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-08-27 10:53:47 +05:30
Peter Steinberger 036e635c71 fix: preserve Gateway error reasons in text logs (#130645)
Print the existing formatted and redacted RPC error instead of a generic reachability claim. Preserve JSON output, selected-target details, fallback/recovery, auth and exit behavior. Verified with real loopback rejection and built CLI before/after proof. Closes #130616.
2026-08-26 22:10:26 -07:00
wangyan2026andPeter Steinberger e00d46b19b fix(plugins): normalize managed npm overrides before peer planning (#124532)
* [AI] fix(plugins): filter pnpm parent-child overrides at managed npm producer

readOpenClawManagedNpmRootOverrides returned host pnpm-workspace overrides
without filtering pnpm-only parent-child selectors (parent>child). Those
selectors are invalid npm override keys and trigger EINVALIDTAGNAME before
the retry-based compatibility path can recover, breaking managed npm plugin
installs and the pre-install peer-sync that runs before the retry loop.

Filter pnpm parent-child selectors once at the shared producer so every
managed npm install/uninstall consumer receives a npm-compatible manifest
up front. The existing retry path stays as a fallback for npm alias
compatibility, which is npm-version-dependent.

Fixes #124426

* fix(plugins): normalize overrides before managed peer planning

Plan peers against the incoming compatible override set so retired selectors cannot silently retain stale pins. Remove duplicate selector retry and synchronization paths while preserving npm alias compatibility.

Co-authored-by: WangYan <wang.yan29@xydigit.com>

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-08-26 20:41:34 -07:00