Commit Graph

51 Commits

Author SHA1 Message Date
Peter Steinberger 1fc29beba2 refactor(state): fold singleton tables into config_machine_state at schema v12 (#129876)
* refactor(state): fold singleton tables into config_machine_state at schema v11

Eight singleton tables (skill_curator_state, update_check_state,
clawhub_promotions_feed_state, model_catalog_remote, voicewake_triggers,
voicewake_routing_config, voicewake_routing_routes,
onboarding_recommendations) were each one logical JSON value behind a
fixed key; their bespoke schemas, lazy ensures, and per-table accessors
collapse onto the shared config_machine_state KV under namespaced keys.
cron_store_epochs retires outright: it was born write-only in #114388
and no reader ever existed in any language. Durable values (update
check state, voicewake triggers and routing, per-workspace onboarding
answers) migrate insert-if-absent during the v10->v11 migration; cache
class contents rebuild on next use. Deferred with named reasons:
exec_approvals_config (macOS direct-SQL contract), installed_plugin_index
(same-tx lease fence), node_host_config and web_push_vapid_keys
(secret-table git-backup redaction).

# Conflicts:
#	src/skills/workshop/collection-review-state.ts
#	src/skills/workshop/collection-review.gateway-admission.test.ts

* test: register v11 guard carve-outs and suppression pin

The v11 migration module joins the raw-SQLite allowlist (migrations are
the named guardrail exception), the lint-suppression allowlist records
the second type-parameter suppression in config-machine-state, and the
identity module keeps only externally consumed exports.

* test: surface CLI stderr when migration-diagnostic assertion fails

* test: expect migration diagnostics on stderr for models plain commands

The #129037 pending-migration cases asserted that aliases/fallbacks
lists never open the state database, but config-health observation
(observeConfigSnapshot -> readConfigHealthStateFromStore) full-opens it
on any config read whose file exists — reproduced identically on clean
main with a main-built dist. The protected contract is exact stdout;
the diagnostic legitimately lands on stderr for every case.

* test: drop unused defaults import from CLI stdout e2e

* test: split session path derivation out of oversized session-files suite

#130016 pushed session-files.test.ts to 1008 lines, over the 1000-line
lint cap and red for every PR's check-lint. The sessionPathForFile
describe moves to a self-contained sibling following the existing
session-files.*.test.ts split pattern; no assertions change.

* refactor(state): fold four more singleton tables into schema v12

tui_last_sessions (cache-class, regenerates on next session switch),
sidebar_sections (persistent section order, migrated as one JSON array),
node_host_config, and web_push_vapid_keys join the v12 fold-in, taking
the retirement to thirteen tables at the same version. The two secret
singletons were blocked on table-granular git-backup redaction; backups
now exclude config_machine_state rows by secret key prefix (nodeHost.*,
webPush.vapidKeys) with a fail-closed row filter and regression proof,
so STATE_SECRET_TABLE_NAMES sheds both tables. The sidebar fold also
retires its lazy-ensure WeakSet and inline DDL; sidebar edits stay
inside the existing session-group write transaction via direct Kysely.

* fix(node-host): omit absent Cloudflare Access config like the column reader

The KV rewrite returned gateway.cloudflareAccess as an own undefined
property where the retired column reader omitted the key; toStrictEqual
consumers (state-migrations doctor-repair test) caught the shape drift.
Mirror the column reader's conditional spread at both construction
sites.

* fix(backup): disclose redacted machine-state prefixes after restore

The prefix-granular secret redaction recorded omitted key prefixes in
the backup manifest but the restore result exposed only excludedTables,
so a redacted restore looked complete while nodeHost.* and
webPush.vapidKeys configuration were intentionally absent. The restore
result and CLI output now disclose the omitted prefixes (JSON mode
carries them via the result shape), with restore-side regression
coverage.

* fix(tui): compare-and-delete retired session pointers

Doctor cleanup read matching pointer keys then deleted them
unconditionally, so a replacement pointer written between the scan and
the delete was erased. The delete now re-checks the stored value inside
the write transaction and only removes pointers that still name a
retired session; a live replacement survives (regression covered).
Also corrects the stale schema-version line in database-first.md.
2026-08-26 13:32:19 -07:00
Peter Steinberger b4c936ea82 fix(cli): preserve human output for flag-like model option values (#129911)
* fix(cli): preserve human output for flag-like model option values

* test(cli): isolate model output preaction regressions
2026-08-25 23:31:52 -07:00
Peter Steinberger eacceebe3e fix(cli): preserve populated model output on stdout in plain mode (#129871) 2026-08-25 21:54:08 -07:00
SunnyShu 827433c6fe fix(cli): keep models --plain stdout clean of startup diagnostics (#129037)
* fix(cli): keep models --plain stdout clean of startup diagnostics

Extend the models machine-output classifier to recognize --plain and the
parent --status-plain alias so early stream routing sends state database
migration diagnostics to stderr, matching --json behavior. Plain failures
stay human-readable; only --json activates the JSON failure envelope.

The early classifier alone is undone by Commander preaction: preaction
resolves JSON mode as false for --plain and calls
applyResolvedCommandOutputMode(false), which restores stdout routing
before state bootstrap emits the migration diagnostic. Add a separate
retainStderrRouting signal so plain machine-output commands keep stderr
routing through preaction without activating the JSON failure envelope.

Fixes #127494

* fix(cli): preserve plain machine-output ownership during startup

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

* test(cli): keep model-output regression within lint limits

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

* test(cli): cover models plain stdout routing

* test(cli): preserve canonical model output in plain stdout proof

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

* test(cli): align plain output proof with runtime

* test(cli): fix status migration expectation

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
Co-authored-by: Altay <altay@hey.com>
2026-08-25 17:01:56 -07:00
Peter Steinberger b5864ba1db fix(skills): fail closed for unavailable remote Gateway (#117567)
* fix(cli): respect explicit Gateway ownership

* fix(gateway): fence offline CLI fallbacks

* fix(gateway): restrict local recovery closes

* fix(cli): preserve offline Gateway ownership and log recovery
2026-08-25 16:58:39 -07:00
Peter Steinberger 1bfaa806db fix(cli): render marketplace JSON failures (#129263) 2026-08-25 04:28:52 -07:00
Peter Steinberger 33e556fe8a fix(cli): hide banners for implicit JSON output (#129204) 2026-08-25 02:46:07 -07:00
Peter Steinberger 1901ddaa81 fix(cli): render Gateway health JSON failures (#129106) 2026-08-25 01:04:03 -07:00
Peter Steinberger 6335d97771 fix(cli): render Gateway validation JSON failures (#129043) 2026-08-24 23:29:26 -07:00
Peter Steinberger 5cb07fb93b fix(cli): render cron edit JSON failures (#129022) 2026-08-24 22:38:23 -07:00
Peter Steinberger b57d629ddb fix(cli): write telemetry JSON to stdout (#129003) 2026-08-24 21:32:33 -07:00
Peter Steinberger 0022cd2542 fix(cli): render models refresh JSON failures (#128981) 2026-08-24 20:18:17 -07:00
Alix-007 0c98de6b81 fix(cli): return JSON for curator and workshop failures (#128601)
* fix(cli): render curator and workshop JSON failures

* test(cli): cover inherited JSON on skill failures

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-08-24 02:45:44 -07:00
Peter Steinberger 5e253f4f42 fix(cli): render hooks report JSON failures (#128641) 2026-08-24 02:21:41 -07:00
Peter Steinberger e62725aa5a fix(cli): render agent identity JSON failures (#128590) 2026-08-24 00:37:16 -07:00
Peter Steinberger 2531b166c0 fix(cli): render agents add JSON failures (#128517) 2026-08-23 22:39:34 -07:00
Peter Steinberger eef9aaa2ea fix(cli): render agent binding JSON failures (#128484) 2026-08-23 21:16:19 -07:00
xingzhou bbb644353d fix(cli): emit JSON for trajectory export failures (#128351)
* fix(cli): render trajectory export JSON failures

Co-authored-by: zhang-guiping <zhang.guiping@xydigit.com>

* fix(cli): route invalid trajectory stores through root errors

Co-authored-by: zhang-guiping <zhang.guiping@xydigit.com>

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-08-23 17:57:03 -07:00
Peter Steinberger a3e69b2ba0 fix(cli): render sessions list JSON failures (#128316) 2026-08-23 14:11:26 -07:00
Peter Steinberger 7d154d32c1 fix(cli): render session validation JSON failures (#128224) 2026-08-23 09:43:52 -07:00
Peter Steinberger 0a70356c55 fix(cli): render channel capability JSON failures (#128155) 2026-08-23 02:36:36 -07:00
Peter Steinberger 2e04f762ea fix(cli): render task validation JSON failures (#127750) 2026-08-23 00:54:06 -07:00
Peter Steinberger 0d29baae01 fix(cli): render status timeout JSON failures (#127721) 2026-08-21 18:04:25 -07:00
Peter Steinberger 7469b54272 fix(cli): render plugin search JSON failures (#127679) 2026-08-21 16:35:17 -07:00
Peter Steinberger 0095168ae6 fix(cli): render Nodes validation failures (#127223) 2026-08-21 08:38:57 -07:00
Peter Steinberger 32fb2fc766 fix(cli): render task flow JSON failures (#127080)
* fix(cli): render task flow JSON failures

* test(cli): stabilize entry console capture

* fix(cli): keep JSON terminal resets off stdout

* fix(cli): keep task JSON resets off stdout
2026-08-21 01:48:16 -07:00
Peter Steinberger 57a2677c3c fix(cli): render skills JSON failures (#127016) 2026-08-20 22:23:52 -07:00
Peter Steinberger afb430d10f fix(cli): render sandbox JSON failures (#126915) 2026-08-20 17:56:20 -07:00
Peter Steinberger a73166b49d fix(cli): render QR JSON failures (#126884) 2026-08-20 17:02:59 -07:00
Peter Steinberger 7769cb6466 fix(cli): accept daemon --json before subcommands (#126447)
* fix(cli): accept daemon json before subcommands

* test(cli): update doctor public-surface fixture

* test(cli): classify daemon parent JSON output
2026-08-19 15:17:21 -07:00
Peter Steinberger c90226dc53 fix(cli): emit JSON for docs search failures (#126331) 2026-08-19 08:20:41 -07:00
Dallin Romney 902eb1f282 test(e2e): repair release validation harness drift (#125681)
* test(e2e): align usage and Canvas contracts

* test(e2e): restore registry and use built CLI
2026-08-18 07:14:01 -07:00
Peter Steinberger d3447dfc2b fix(cli): show actionable guidance for mistyped commands (#124892)
* fix(cli): render unknown commands as guidance

* fix(cli): keep parse JSON terminal-neutral
2026-08-16 17:47:27 -07:00
Peter Steinberger 6c66f48a7c fix(cli): emit one JSON failure contract for --json invocations (#124849)
* fix(cli): unify JSON failure output

* test(cli): update skills verify failure envelope
2026-08-16 15:09:58 -07:00
Jason (Json) 5f1bbed42d fix(doctor): report missing managed local embedding setup (#123575)
* fix(gateway): expose startup blockers before cutover

* fix(gateway): include session blockers in preflight

* fix(gateway): keep preflight finding type private

* fix(gateway): preflight startup auth blockers

* fix(gateway): complete startup preflight readiness

* fix(llama-cpp): keep preflight remediation private

* fix(gateway): keep preflight passive and activation-aware

* fix(gateway): apply startup guard in preflight

* fix(gateway): align auth mode preflight

* fix(gateway): keep preflight state reads isolated

Share the read-only inspection snapshot scope across duplicated runtime chunks so blocked gateway preflight remains non-mutating when bundled provider artifacts read canonical state.

* fix(gateway): keep startup preflight passive

* fix(gateway): ignore inactive embedding owner shadows

* fix(gateway): preserve startup preflight parity

* fix(llama-cpp): keep cache inspection types private

* fix(gateway): close startup preflight parity gaps

* fix(gateway): handle uninitialized memory databases

* test(gateway): observe shell fallback portably

* fix(llama-cpp): normalize embedding model paths

* refactor(gateway): drop broad startup preflight surface

* fix(doctor): report missing managed local embedding setup

* style(memory): simplify setup enablement check

* fix(memory): keep diagnostic result type private

* fix(memory): inspect local setup with remote secret refs

* fix(memory): keep doctor index inspection immutable

* fix(memory): make readiness inspection owner-aware

* fix(doctor): mirror memory slot allowlist policy

* test(doctor): use canonical memory slot id

* fix(doctor): normalize memory provider ids

* fix(doctor): resolve external embedding readiness owner

* fix(plugins): keep embedding inspection result internal

* fix(doctor): isolate plugin state during lint

* fix(doctor): route lint metadata through snapshot

* fix(cli): keep doctor lint startup source-only

* fix(cli): keep doctor lint compile-cache free

* fix(doctor): keep local embedding readiness opt-in

* test(doctor): preserve plugin artifact roots during lint

* fix(doctor): refresh memory readiness registration

* test(doctor): type nullable provider policy mock

* fix(doctor): scope lint state snapshot to provider check

* fix(doctor): isolate selected plugin state checks

* test(doctor): restore only scoped environment

* fix(doctor): defer readiness state inspection

* fix(doctor): keep deferred config reads isolated

* fix(doctor): keep plugin state mode internal

* fix(config): preserve default plugin validation
2026-08-15 20:15:06 -06:00
Peter Steinberger 3806c3866b fix(cli): keep read-only config queries from writing state (#114847)
* fix(cli): keep config queries read-only

* test(cli): preserve read-only routed config coverage
2026-07-27 22:27:00 -04:00
Peter Steinberger 9e2ffea0de fix(cli): reject empty update timeout arguments (#114700) 2026-07-27 16:08:00 -04:00
Peter Steinberger 2b11203eb3 fix(cli): keep config file queries fast and read-only (#114660) 2026-07-27 13:56:00 -04:00
Peter Steinberger 914bd1946a fix(cli): isolate explicit profiles from inherited service state (#114446) 2026-07-27 04:59:20 -04:00
Peter Steinberger 13ae897cfb fix(cli): keep config schema stdout parseable (#110496) 2026-07-18 08:02:04 +01:00
Peter Steinberger fe261b0f59 chore(tooling): typecheck root test/** with a dedicated tsgo lane (#104475)
* chore(types): add declaration files for scripts/lib and scripts/e2e modules

* chore(types): add declaration files for top-level script modules (a-m)

* chore(types): add declaration files for top-level script modules (n-z)

* test: use a non-secret-shaped gateway token fixture

* test: type ci workflow guard helpers for the root test lane

* chore(tooling): typecheck root test/** with a dedicated tsgo lane

- test/tsconfig/tsconfig.test.root.json: root-test program (strict unused checks,
  fixtures excluded; two Docker E2E clients that import built dist/** stay out,
  same rationale as the scripts/e2e exclusion in tsconfig.scripts.json)
- tsgo:test:root wired into tsgo:test, check:test-types, scripts/check.mjs, and
  the ci.yml test-types shard, mirroring the tsgo:scripts lane (#104348)
- changed-lane routing: test/**/*.ts (excluding fixtures) and the lane tsconfig
  now trigger 'typecheck test root' in check:changed; previously test/ paths ran
  lint only, so harness type errors surfaced first in CI (#104287 envDir case)
- burn down all 1071 latent type errors in the program: precise param/local
  types across test/scripts, test/vitest, test/e2e, and transitive scripts/e2e
  program members; 205 sibling .d.mts declaration files for imported .mjs
  modules (committed separately); zero any, zero ts-expect-error
- resolve the pre-existing testing star-export ambiguity in
  scripts/e2e/parallels/common.ts with an explicit re-export

Closes #104388

* chore(types): correct declaration fidelity per structured review

- re-derive 51 .d.mts files from implementation data flow instead of
  initializers: fix a wrong never return (runTestProjectsDelegation returns
  the child), add encoding-sensitive exec/spawn overloads (plain-gh), restore
  the full release profile union, make parsed paths string | null, add missing
  parseArgs fields via help/non-help unions, add a missing sibling declaration
  (budget-number-args), drop 15 unused lint directives
- precise install-record/tuple typing removes the type-aware oxlint
  regressions the first declarations caused in scripts/e2e implementations
- route .mts declaration edits under test/ to the testRoot lane and reference
  the test-root project from tsconfig.projects.json so tsgo:all covers it
  (closes both review findings against the lane wiring)

* chore(scripts): keep telegram runner dist typing structural for the boundary guard

* chore(types): declare runtime pack and gateway readiness exports added on main

* test: pin the importTargetPlan form of the plugin-contract plan import

The guard expectation still referenced the raw await import( form that
7ae5996bb3 (#103975) replaced with the importTargetPlan fallback helper;
the assertion fails on current main.
2026-07-11 06:15:41 -07:00
Peter Steinberger ecb6779a16 docs: document root test files 2026-06-04 20:37:28 -04:00
Peter Steinberger f9c0dc2d2b fix(feishu): fall back from missing thread replies (#80306)
Summary:
- The branch adds an opt-in Feishu top-level group-send fallback for withdrawn or missing normal quoted thread replies, plus regression coverage, a changelog entry, and CI/lint typing and baseline refreshes.
- Reproducibility: yes. at source level. Current main hard-errors withdrawn/not-found Feishu reply targets when `replyInThread` is true, and the existing regression test asserts that no top-level create fallback occurs.

Automerge notes:
- PR branch already contained follow-up commit before automerge: fix(feishu): fall back from missing thread replies
- PR branch already contained follow-up commit before automerge: fix(clawsweeper): address review for automerge-openclaw-openclaw-8030…
- PR branch already contained follow-up commit before automerge: fix(clawsweeper): reconcile automerge-openclaw-openclaw-80306 with ma…
- PR branch already contained follow-up commit before automerge: fix(ci): satisfy stricter lint and test types
- PR branch already contained follow-up commit before automerge: fix(ci): align Node 24 test typing

Validation:
- ClawSweeper review passed for head 93146f9d13.
- Required merge gates passed before the squash merge.

Prepared head SHA: 93146f9d13
Review: https://github.com/openclaw/openclaw/pull/80306#issuecomment-4415604729

Co-authored-by: Peter Steinberger <steipete@gmail.com>
Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
2026-05-10 16:41:51 +00:00
Shakker fc327378a0 test: tighten root output assertions 2026-05-08 15:55:39 +01:00
Peter Steinberger b7033369a6 test: tighten non-live object guards 2026-05-08 15:21:00 +01:00
Shakker 60068c52b0 test: run json stdout e2e from source 2026-05-08 15:17:52 +01:00
Peter Steinberger dce9261415 test: tighten e2e helper assertions 2026-05-08 15:08:47 +01:00
Peter Steinberger 9ef37d1907 test: tighten assertions and harness coverage 2026-05-08 05:28:12 +01:00
Peter Steinberger dab0e57914 style: format sdk helper imports 2026-04-28 04:20:49 +01:00
Peter Steinberger 896b82f430 test: align sdk helper imports 2026-04-28 04:20:49 +01:00