Commit Graph

3599 Commits

Author SHA1 Message Date
Dallin Romney
5a0fcc2ff9 test(cli): distinguish silent hook relay completion (#109339) 2026-07-16 13:59:34 -07:00
tzy-17
543b60092d fix(cli): use startsWith for loopback IPv4 check in container proxy (#106077)
isLoopbackProxyHostname used split(".", 1)[0] === "127" to detect
127.0.0.0/8 addresses. While isIP() already rejects leading-zero octets
before this branch is reached, startsWith("127.") is more direct and
clearly expresses the intent of matching the entire 127.0.0.0/8 range.
2026-07-16 13:40:18 -07:00
thomas.szbay
b06fe2a673 fix(kill-tree): verify process group leader before using group kill to prevent gateway SIGTERM (#76259) (#94697)
* fix(kill-tree): verify process group leader before group kill to prevent gateway SIGTERM (#76259)

- Add isProcessGroupLeader() to killProcessTree/signalProcessTree: ps -p <pid> -o pgid= primary check with /proc/<pid>/stat fallback on Linux. Group kill only when the PID is its own process group leader; non-leaders fall back to single-pid kill, preventing accidental gateway SIGTERM when a non-detached child shares the gateway's process group.
- Propagate detached: true to all detached-spawn cleanup callers (exec-termination, agent-bundle LSP, mcp-stdio, bash, supervisor pty, agent-core nodejs) so detached group cleanup survives leader exit.
- Gateway/daemon cleanup paths (schtasks, restart-health) keep the leader-checked default (detached omitted).

Closes #76259

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

* refactor(process): tighten process-group ownership checks

* refactor(daemon): split restart diagnostics

* refactor(daemon): isolate restart health types

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-16 12:30:51 -07:00
Peter Steinberger
734e1ed369 refactor(daemon): split restart port ownership helpers (#109298) 2026-07-16 12:15:48 -07:00
Peter Steinberger
6c39e713d4 refactor: move native hook relay registry to SQLite (#109289)
* refactor: store native hook relays in SQLite

* chore: satisfy relay store CI checks
2026-07-16 12:14:06 -07:00
Shakker
f084ab2240 fix: prevent external gateway restart timeouts (#109273) 2026-07-16 19:36:58 +01:00
Peter Steinberger
f871b499b6 fix(infra): drop consumer-less gateway supervision exports
333c4f9a61 and 244f4965dc landed six exports with no production
consumers, failing the hard-zero deadcode gate on every PR: a dead
re-export block in restart-handoff (the contract module's real importer
uses it directly), three result/mode types only referenced inside their
own modules, and two supervision symbols whose only consumers were their
tests. The types and helpers stay defined for the in-flight supervisor
work to re-export alongside real consumers; the supervision test now
proves mode resolution through the public isGatewayExternallySupervised
surface.
2026-07-16 09:31:46 -07:00
Shakker
9b48ad5977 fix: avoid redundant Windows restart persistence (#109162) 2026-07-16 17:01:39 +01:00
Shakker
266d3c8551 refactor: focus external restart verification 2026-07-16 17:01:39 +01:00
Shakker
6013e593c7 fix: narrow unmanaged restart results 2026-07-16 17:01:39 +01:00
Shakker
332b522f90 fix: harden external restart integration 2026-07-16 17:01:39 +01:00
Shakker
333c4f9a61 feat: add restart handoff consume protocol 2026-07-16 17:01:39 +01:00
Shakker
e123606b46 feat: support externally supervised gateway restarts 2026-07-16 17:01:39 +01:00
Shakker
244f4965dc feat: add external gateway supervision policy 2026-07-16 17:01:39 +01:00
Peter Steinberger
8fe4eeea9e fix(exec): stop isolated state dirs from moving live approvals (#108742)
* fix(exec): isolate approval state directories

* chore: drop release-owned changelog entry

* chore: refresh native i18n inventory

* fix(ci): pin XcodeGen for Periphery scans
2026-07-16 08:57:32 -07:00
ooiuuii
6828bcac53 fix(update): verify Windows restart listener owners (#108023)
* fix(update): verify Windows restart listener owners

* fix(update): harden Windows listener ownership checks

Co-authored-by: luyifan <al3060388206@gmail.com>

* fix(update): test shipped Windows listener policy

* ci: refresh merge ref after main schema fix

* ci: refresh merge ref

* fix(lint): drop redundant String conversion in pwsh lookup

* ci: pick up periphery workflow fix

* ci: pick up pinned xcodegen installer

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-16 07:59:13 -07:00
krissding
eb8cdf6419 fix(cli): add 10s timeout to port-inspection subprocess calls (#108706)
* fix(cli): add 10s timeout to port-inspection subprocess calls

fuser, netstat, and lsof can hang on a busy or misbehaving system.
Node.js execFileSync already supports a timeout option; use 10s to
match the existing convention in debug-claude-usage.ts.

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

* fix(cli): harden port subprocess deadlines

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-16 04:33:58 -07:00
Vito Cappello
92075dd72a fix(secrets): inactive web refs no longer block agent turns (#108485)
* fix(secrets): accept inactive refs from partial fallback

* fix(secrets): fail closed on unknown web provider owners

* test(gateway): isolate web secret startup fixtures

---------

Co-authored-by: VACInc <3279061+VACInc@users.noreply.github.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-16 04:13:40 -07:00
Abner Shang
5ad0d4d6c0 fix: avoid false restart failure during startup migrations (#105544)
* fix: wait for startup migrations on restart

* fix: honor restart readiness caller context

* fix: preserve restart service identity

* fix: refresh readiness context after repair

* fix: bound migration restart wait by wall clock

Co-authored-by: Abner Shang <abner.shang@gmail.com>

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-16 02:04:49 -07:00
Peter Steinberger
9d4652a46c refactor: make update runtime preflight result explicit (#108760) 2026-07-16 01:48:29 -07:00
Peter Steinberger
dde90a345a refactor(plugin-sdk): narrow wildcard barrels to explicit used exports (#108440)
* refactor(plugin-sdk): narrow wildcard barrels to explicit used exports

* refactor(tools): delete dead tool-planning module exposed by barrel narrowing

* fix(plugin-sdk): restore deprecation tag on OpenClawSchemaType alias

* test(agents): drop test for deleted runtime proxy module

* refactor(tools): trim descriptor types to cache consumers

* refactor(deadcode): harvest exports orphaned by barrel narrowing

* refactor(deadcode): harvest exports orphaned by barrel narrowing (rest)

* fix(agents): restore sdk imports and test markers via public predicate

* fix(plugin-sdk): named type re-exports in plugin-entry; trim types barrel precisely

* chore(plugin-sdk): account unmasked deprecated provider types in budgets

* fix(plugins): name star-only type rows for dts bundling

* fix(plugins): restore host-hook surface; unexport internal api compositions

* fix(plugins): named type imports for api composition; restore needed source exports

* fix(plugins): knip-visible type imports for registry surfaces

* test: adapt tests to privatized media and command internals

* fix(qa-lab): re-export snapshot conversation type

* style: format sessions sdk imports

* fix(plugins): restore smoke entry export; pin budgets to exact actuals

* fix(plugins): canonical smoke-entry import; drop orphaned root shims

* fix(plugins): allowlist manifest probe, repoint qa web import, drop dead browser barrels

* fix(plugin-sdk): pin codex auth marker and scaffold provider type

* fix(qa-lab): keep web-facing model-selection shim within boundary rules

* fix(plugin-sdk): preserve merged contracts through narrowed barrels

* chore(plugin-sdk): pin post-rebase surface budgets
2026-07-16 00:45:23 -07:00
Peter Steinberger
48b11d1c66 fix(update): repair obsolete managed Gateway Node (#108668)
* fix(update): refresh stale managed service Node

* refactor(update): keep preflight result internal

* docs(changelog): defer update note to release
2026-07-16 00:41:43 -07:00
Peter Steinberger
bae9752c5a refactor(deadcode): enforce repository hard zero (#108641) 2026-07-15 22:40:00 -07:00
Peter Steinberger
9c065c895e refactor(cli): split capability commands by domain (#108419)
* refactor(cli): split capability commands by domain

* fix(cli): keep capability metadata type private
2026-07-15 16:57:21 -07:00
Peter Steinberger
32a84d093f refactor(agents): split agent command orchestration (#108424)
* refactor(agents): split agent command orchestration

* test(agents): tighten cleanup ownership proof

* refactor(agents): keep command helper types private

* test(cli): track refactored secret resolution callsite

* fix(agents): preserve post-run session ownership

* fix(agents): preserve media recovery across command split
2026-07-15 13:42:05 -07:00
Peter Steinberger
9497450511 refactor: eliminate dead-export baseline (#108376)
Burn the grandfathered unused-export baseline to zero and enforce a hard-zero Knip gate.
2026-07-15 17:05:07 +01:00
Peter Steinberger
65188a7430 fix(agents): reject synchronous sessions_send self-targets, break down missing-cost entries, dedup usage merges (#108354)
* fix(agents): reject synchronous sessions_send self-targets, break down missing-cost entries, dedup usage merges

- sessions_send fails fast with a clear error when a synchronous send resolves
  to the calling session's own key, instead of enqueueing behind the sender's
  own lane until timeout and falling back to an empty reply; fire-and-forget
  (timeoutSeconds: 0) self-delivery keeps working (#107172)
- missingCostEntries now carries a provider/model breakdown surfaced on the
  status runtime line and gateway CLI cost line, so zero-priced usage (e.g.
  openai-codex/*) is attributable instead of an opaque counter (#98348)
- codex-synthetic-usage merge helpers share one precedence helper; behavior
  unchanged, duplicate ranking logic deleted (#107497)

* test: use a valid billing type in synthetic-usage precedence case

* test: fix billing expectation to match valid type
2026-07-15 08:23:49 -07:00
jincheng-xydt
b2e42e3645 fix(update): preserve pnpm and Bun global installs (#107802)
* fix(update): preserve pnpm and bun global installs

* fix(update): anchor pnpm updates to invoking install

* fix(update): recover skipped pnpm lifecycle

* fix(update): fail closed on ambiguous pnpm ownership

* fix(update): tolerate pnpm probe warnings

* fix(update): bind pnpm installs to project owners

* fix(update): isolate pnpm mutations from caller pins

* docs(changelog): credit pnpm 11 report

Co-authored-by: jincheng-xydt <xu.jincheng@xydigit.com>

* chore(changelog): defer release note ownership

* fix(update): make package-root fallback explicit

* test(update): split pnpm scenario coverage

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-15 08:03:35 -07:00
lin-hongkuan
dc23f4f255 test: preserve logging exports in startup mocks (#103582)
Co-authored-by: lin-hongkuan <lin-hongkuan@users.noreply.github.com>
2026-07-15 06:11:30 -07:00
Shakker
24c753ae31 fix: keep channel CLI helpers private 2026-07-15 13:05:10 +01:00
Shakker
b08b699de2 fix: accept ClickClack workspace before install 2026-07-15 13:05:10 +01:00
Shakker
e7a630ab39 feat: accept positional channels in setup 2026-07-15 13:05:10 +01:00
qingminlong
4975cf75b4 fix(cron): reject oversized trigger script files before read (#108130)
* fix(cron): reject oversized trigger script files before read

* refactor(cron): stream bounded trigger scripts

Co-authored-by: qingminlong <qing.minlong@xydigit.com>

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-15 03:12:21 -07:00
Peter Steinberger
a97bdfb687 feat(agents): narrow gateway tool to read-only config
Phase 3 of #107237. Removes config.apply/config.patch/restart from the
regular-agent gateway tool (mirroring Phase 2's update.run removal); only
config.get and config.schema.lookup reads remain. Persistent config changes
and restarts now go exclusively through the human-approved openclaw
delegation path — closing the last unmediated agent config-write surface.
gateway stays owner-only/control-plane gated (config reads expose secrets and
host topology). Legacy setups can re-enable writes via the existing per-agent
tool allowlist; no new config key. Net -2271 LOC.

Refs #107237
2026-07-15 01:56:31 -07:00
Peter Steinberger
3861bce485 test(ci): separate hooks output and exit deadlines (#108162) 2026-07-15 01:35:17 -07:00
Peter Steinberger
0be803ebc0 fix: npm 12 global updates no longer stop at the candidate guard (#108100)
* fix(update): approve candidate lifecycle on npm 12

* test(update): align npm lifecycle argv expectations
2026-07-15 01:10:32 -07:00
Peter Steinberger
f30d9b250a fix(worktrees): fail closed on owner lookup errors (#108041) 2026-07-14 23:06:26 -07:00
Peter Steinberger
74eea60e1b test(ci): serialize hooks process bootstraps (#107977)
* test(ci): serialize hooks process bootstraps

* fix(ci): repair main gate contracts

* fix(ci): refresh max-lines suppression baseline
2026-07-14 22:01:47 -07:00
Peter Steinberger
56ff612606 test(worktrees): cover session liveness across gc entry points (#107989)
Co-authored-by: RickLin <83101411+ObliviateRickLin@users.noreply.github.com>
2026-07-14 21:59:49 -07:00
Peter Steinberger
652266b8b6 test: speed up hooks process lifecycle coverage (#107954) 2026-07-14 20:15:23 -07:00
Peter Steinberger
69e9254e0e fix(ci): regen rename-affected generated surfaces and fix e2e entrypoint
native i18n inventory + per-locale artifacts resynced for the OpenClaw
strings; Kotlin gateway protocol enum regenerated instead of hand-edited;
deadcode baseline re-sorted; lint suppression allowlist entries moved to
sorted position; setup TTY check drops redundant boolean compares;
ring-zero first-run e2e calls the real 'openclaw setup' subcommand.

Refs #107237
2026-07-14 11:03:02 -07:00
Peter Steinberger
eaaeeef19b refactor(cli): type-safe option reads in setup command
Replace blind string casts with an optionalString reader and rename the
options record; blind token/password casts also false-positived secret
scanners on every future diff of this file.

Refs #107237
2026-07-14 11:03:02 -07:00
Peter Steinberger
a6a0716486 feat(setup): rename Crestodian to OpenClaw system agent
User-facing name is now OpenClaw (the system speaks); internal code name is
system-agent. Gateway methods crestodian.* -> openclaw.chat/openclaw.setup.*,
agent tool -> openclaw, reserved agent ids openclaw + retired crestodian.
openclaw setup routes: onboarding flags -> onboard, -m/--yes -> system agent,
bare configured interactive -> OpenClaw chat, unconfigured -> onboarding.
Hidden crestodian CLI and /crestodian TUI aliases kept; docs moved to
docs/cli/openclaw.md with redirect stub. macOS/Android strings in lockstep.

Refs #107237
2026-07-14 11:03:02 -07:00
Jesse Merhi
00364ee777 improve: warn before non-ClawHub plugin installs (#102197)
Merged via squash.

Prepared head SHA: e08d9e737d
Co-authored-by: jesse-merhi <79823012+jesse-merhi@users.noreply.github.com>
Co-authored-by: jesse-merhi <79823012+jesse-merhi@users.noreply.github.com>
Reviewed-by: @jesse-merhi
2026-07-15 03:25:36 +10:00
Peter Steinberger
e323c70ada refactor(cli): trim internal dead exports (#107654)
* refactor(cli): trim internal helper exports

* chore(deadcode): refresh CLI export baseline
2026-07-14 09:28:16 -07:00
Peter Steinberger
f81f9d8570 chore: enforce max-lines suppression ratchet (#107315)
* ci: enforce max-lines suppression ratchet

* chore: prune stale max-lines suppression

* fix: close max-lines ratchet enforcement gaps

* fix: harden max-lines ratchet checks

* fix(ci): satisfy max-lines ratchet checks

* style: format max-lines declarations

* fix(ci): match oxlint suppression grammar

* test: isolate max-lines git fixtures

* chore: prune resolved max-lines debt

* test: skip newline path fixture on Windows

* fix: harden max-lines suppression ratchet

* chore: refresh max-lines baseline

* fix: close max-lines ratchet bypasses

* fix: derive ratchet base from PR merge tree

* fix: support older Git in staged ratchet

* fix: align max-lines declarations and baseline

* chore: refresh max-lines baseline for current main

* fix: exclude generated wizard locales from max-lines

* chore: prune resolved max-lines debt
2026-07-14 09:27:02 -07:00
Peter Steinberger
7b16b35cb3 refactor(media-understanding): remove internal export seams (#107476) 2026-07-14 05:57:08 -07:00
Ayaan Zaidi
319a796079 fix(gateway): never leave the restart admission fence closed without a restart
A failed, refused, superseded, or thrown restart emission could leave the
reversible restart-signal admission fence closed forever: concurrent emitters
could overwrite the live rollback lease with a dead stand-in, the fenced body
had no try/finally, and the outer catch swallowed errors precisely because the
stuck fence made isGatewayRestartDraining() true. The gateway then rejected
every new task with GatewayDrainingError - silently - until an operator
restarted the process.

beginGatewayRestartSignalAdmission now returns null instead of stand-in
leases (single fence owner), emitPreparedGatewayRestart reopens the fence on
every non-delivery path via try/finally while preserving it whenever a queued
SIGUSR1 is unconsumed, refused-signal cleanup force-clears orphaned fences,
and admission close/reopen transitions are logged with their reason. The
self-contained SQLite restart-intent persistence moves to restart-intent.ts
to keep restart.ts within the LOC ratchet.

Fixes #107322
2026-07-14 16:14:48 +05:30
Peter Steinberger
673b163b72 refactor(cli): use Commander native APIs 2026-07-14 02:45:52 -07:00
Peter Steinberger
92cca9343e feat(linux): headless node device capabilities (camera, location, notifications) (#107193)
* feat(linux): add node device capabilities

* fix(linux-node): actionable pending-approval error + node-host advertise integration test

* fix(linux-node): map geoclue access-denied to LOCATION_DISABLED; floor camera maxWidth to avoid zero-height scale

* fix(linux-node): clamp small camera maxWidth to 2 instead of default

* docs(linux-node): clarify where-am-i -t is a process timeout, not update throttle

* refactor(gateway): extract legacy-node filter + rejection hint to fit LOC ratchet; docs-map + deadcode baseline

* fix(gateway): drop now-unused DEFAULT_DANGEROUS_NODE_COMMANDS import after hint extraction

* test(node-host): drop imports orphaned by removed error-code test
2026-07-14 02:30:36 -07:00