Commit Graph

144 Commits

Author SHA1 Message Date
Peter Steinberger b080dd1e76 refactor: consolidate coercion contracts (#122458)
* refactor: consolidate coercion contracts

Centralize exact string, record, numeric, date, Boolean, argument, and structured-error coercions while preserving call-site semantics.

Migrate canonical-name collisions and deprecated internal SDK bypasses, deleting 55 net production/tooling lines. Expand declaration ownership enforcement to 101 allowed helpers and add a narrow export-completeness audit.

* fix: preserve standalone script coercions

Keep copied Control UI tooling self-contained and retain the trusted release harness module-relative source seam when the harness runs against an old target cwd.
2026-08-11 23:26:37 -07:00
Peter Steinberger 021ea774ab test(system-agent): isolate chat fixtures from provider discovery (#122360)
* test(system-agent): isolate chat fixtures from provider discovery

* test(gateway): avoid import-order prewarm assertion

---------

Co-authored-by: Amp <amp@ampcode.com>
2026-08-11 18:17:10 -07:00
Peter Steinberger fd25924d50 test(system-agent): avoid bundled policy load in setup fixture (#122351)
Co-authored-by: Amp <amp@ampcode.com>
2026-08-11 17:21:13 -07:00
Peter Steinberger 964c8c84c1 refactor: consolidate coercion ownership (#122299)
* refactor: consolidate coercion ownership

Centralize four canonical coercion helpers, migrate exact core and plugin duplicates through narrow Plugin SDK facades, and enforce declaration and plugin-normalization ownership boundaries.

The sweep adds eight focused SDK exports while deleting more production and tooling code than it adds. User-visible behavior is unchanged except for safer equivalent object and UI parsing at existing boundaries.

* fix: guard integer option ownership

Register resolveIntegerOption with the canonical function owner and extend the declaration-guard fixture so future local duplicates fail validation.

* fix: keep integer helpers on numeric facade

Remove the unshipped duplicate string-coerce exports and route every affected plugin consumer through the existing number-runtime contract.

* fix: point numeric coercion to number runtime

Make boundary and declaration diagnostics recommend the canonical numeric facade, with failing-before coverage for both guidance paths.
2026-08-11 17:14:53 -07:00
Peter Steinberger 87b3c0e5df refactor(agents): split subscribe leaf ownership (#122249)
* refactor(agents): split embedded tool result ownership

* refactor(agents): split embedded message ownership
2026-08-11 15:04:07 -07:00
Peter Steinberger e74be5d41d refactor: eliminate final wrapper-shadowing hazards (#122157)
* refactor: disambiguate wrapper-shadowed exports

* test: align renamed session and facade boundaries

* test: cover renamed runtime mock exports

* refactor: align remaining wrapper owner call sites

* test: align overlap-rebased runtime mocks

* refactor: preserve public SDK names after overlap rebase

* chore: regenerate wrapper shadowing baselines

* test: align cron model selection mocks
2026-08-11 13:34:24 -07:00
Peter Steinberger 8c567306ba fix(openai): remove duplicate GPT-5.6 picker entry (#122178)
* fix(openai): remove duplicate GPT-5.6 picker entry

* test(gateway): split OpenAI model picker coverage

* test(openai): align canonical model fixtures

* chore(plugin-sdk): refresh agent harness API baseline
2026-08-11 12:29:36 -07:00
Peter Steinberger 3d76246792 refactor: eliminate final export name collisions (#122083)
* refactor: resolve final export name collisions

* refactor: update remaining collision rename consumers

* style: format rebased auth helpers

* test: update remaining session entry mocks

* test: update remaining runtime mock exports

* test: update delivery info path mock

* refactor: reconcile combined collision sweeps

* chore: regenerate collision and sdk baselines
2026-08-11 11:18:24 -07:00
Peter Steinberger ebb2770000 refactor: eliminate export name collisions (#122084)
* refactor: eliminate export name collisions

* chore(scripts): burn resolved collision baselines

* refactor: narrow legacy session load options

* chore: refresh SDK and session debt baselines

* refactor: adopt upstream secrets collision fix

* test(plugin-sdk): mock renamed session store core

* fix(scripts): track renamed session accessor core
2026-08-11 10:41:50 -07:00
Peter Steinberger db73b59c04 refactor: burn wrapper shadowing baseline entries (#122040)
* refactor: burn wrapper shadowing entries

* chore: refresh wrapper shadowing baselines

* test: update secrets runtime state mocks

* fix(ci): absorb Control UI build identity variance
2026-08-11 08:24:03 -07:00
Peter Steinberger e390781534 refactor: burn cross-directory export name collisions (#121893)
* refactor: name subsystem logger exports

* refactor(test): distinguish exported test doubles

* refactor: consolidate canonical owner helpers

* refactor: give cross-domain helpers distinct names

* chore(lint): ratchet collision debt baselines

* fix(test): complete collision rename consumers

* fix(test): update remaining collision mock consumers

* fix(test): update transcript reader mock export

* refactor: keep embedded logger name at its owner

* fix(test): align embedded logger mock with owner

* refactor: name shared assistant phase extraction

* fix(ui): update assistant phase extractor import

* chore(generated): refresh collision and SDK baselines

* style(test): format merged plugin mocks

* chore(sdk): refresh API content hashes
2026-08-11 06:50:22 -07:00
Peter Steinberger 12165769c7 refactor(agents): move OpenRouter failover ownership to its plugin and derive reason schemas from one tuple (#121898)
* refactor(agents): centralize failover ownership and reasons

* test(agents): move OpenRouter failover cases to plugin owner

* fix(agents): preserve prepared provider failover ownership

* test(agents): avoid failover mock shadowing

* fix(agents): preserve provider owner in error copy

* fix(agents): complete provider owner propagation

* chore(plugins): refresh failover type closure hashes
2026-08-11 04:30:18 -07:00
Peter Steinberger 9ea0b4288d fix(system-agent): show retryable error when AI detection times out (#121940)
* fix(system-agent): reject empty detection timeouts instead of claiming nothing found

* test(system-agent): give partial-timeout detection tests CI-safe deadlines

The 50-100ms timeouts raced worker-thread startup on loaded CI runners:
the partial message could miss the deadline, hitting the empty-timeout
rejection and flaking two tests that expect a partial resolve. Timeouts
that must be beaten by worker startup are now 3-5s; tight deadlines
remain only where no worker message is required.
2026-08-11 01:44:20 -07:00
Peter Steinberger 6e851103dc refactor(system-agent): split chat engine into concept modules (#121884)
* refactor(system-agent): split chat engine into concept modules

* refactor(system-agent): deduplicate hosted setup flows

* fix(system-agent): record interactive exit as a fact

* chore(lint): ratchet max-lines baseline after chat-engine split

* fix(system-agent): clear sensitive wizard state between sessions
2026-08-11 00:55:30 -07:00
Peter Steinberger 36fbd869ed refactor(agents): eliminate export name collisions (#121768)
* refactor(auth): consolidate profile helper owners

* refactor(agents): consolidate subagent registry reads

* refactor(agents): disambiguate runtime placement helpers

* refactor(agents): disambiguate helper exports

* chore(scripts): burn export collision debt

* test(agents): follow moved subagent read owner
2026-08-10 22:24:33 -07:00
Peter Steinberger c5b7b8e33c fix(system-agent): setup chat fails silently on dev-roster gateways (#121784)
* fix(system-agent): repair setup-chat execution identity, harness fallback, and error surfacing

Always inject the reserved "openclaw" execution entry for off-roster system-agent runs.
Keep implicit harness runtime selection implicit so Codex refusal falls back to the OpenClaw harness, while explicit policy remains fail-closed.
Log openclaw.chat turn failures and surface their underlying causes in the UNAVAILABLE response.

* chore(plugin-sdk): refresh agent harness API baseline

* test(system-agent): align fixtures with optional harness routes

* fix(system-agent): keep execution roster out of TUI catalog lookup

* refactor(system-agent): keep verified state types internal

* fix(system-agent): separate setup policy and execution config
2026-08-10 21:44:00 -07:00
Josh Avant 73a9eed95b refactor(audit): add canonical admitted-run context (#120534)
* feat(audit): carry canonical admitted execution context

* fix(agents): preserve admitted context across retries

* fix(worker): fence legacy launch dialect

* test(gateway): track approval temp dirs

* fix(plugin-sdk): preserve harness attempt compatibility

* fix: close delegated run authority at owner boundaries

* fix: internalize delegated authority validators

* refactor: split delegated authority proof surfaces

* refactor: centralize command admission identity

* test: claim runtime tool authority

* fix(gateway): keep lifecycle cleanup within static budgets

* fix(agents): revalidate harness policy authority

* fix(agents): fence awaited approval capability results

* test(copilot): supply required harness capability fixtures

* fix(agent): preserve scoped embedded run admission

* fix(agent): preserve keyless and worker authority

* test(agent): bind incomplete-turn authority

* docs: preserve execution authority invariants

* chore(plugin-sdk): regenerate API baseline

* fix(gateway): notify pending claim closure

* fix(gateway): revalidate delegated tool authority

* fix(plugin-sdk): keep source guard internal

* fix: close delegated authority races

* fix: revalidate delegated side effects

* fix: close harness authority projection gaps

* fix: align authority integration types

* fix: isolate settled harness finalization

* fix: fence recovery identity finalization

* fix: preserve committed session worktrees

* fix: preserve worker placement agent identity

* fix: fence active harness tool work

* fix(plugins): restore embedded run admission owner

* chore(plugin-sdk): compose integrated surface budgets

* fix(copilot): keep finalization attempt type internal

* fix(plugins): complete admission owner type imports

* test(harness): use settled finalization attempt shape

* fix(security): retain exact side-run and approval authority

* fix(security): preserve protected authority through terminal sweep

* fix(agents): follow moved recovery store owner

* fix(ci): align integrated authority owners with gates

* fix(plugins): distinguish embedded agent adapter export

* chore(plugin-sdk): regenerate API baseline after rolling integration

* refactor(gateway): keep session authority within owner budgets

* fix(gateway): keep session helpers private

* docs(plugin-sdk): name the V2 parameter subpath

* chore(integration): reconcile worker and SDK surfaces

* docs(plugin-sdk): require the V2 host API floor

* chore(plugin-sdk): regenerate after proxy-auth integration
2026-08-10 23:15:20 -05:00
Peter Steinberger f4bac99a81 feat(secrets): add SQLite-backed secret store (#121559) 2026-08-10 07:08:40 -07:00
Peter Steinberger 8d810d188b refactor: split ClawHub infrastructure by responsibility (#121565)
* refactor(infra): split clawhub into concept modules

* refactor(plugins): move compat predicates to their owners

* chore(lint): ratchet baselines after clawhub split
2026-08-10 06:42:37 -07:00
Jesse Merhi d9d0b30ce3 System agent: keep wizard cancel local 2026-08-10 20:01:24 +10:00
Jesse Merhi 890a4b0089 Control UI: add direct Custodian wizard cancel 2026-08-10 20:01:24 +10:00
Peter Steinberger 890a5e895b fix: onboarding stalls or loses progress during interrupted setup (#121415)
* fix: harden onboarding recovery flows

Amp-Thread-ID: https://ampcode.com/threads/T-019fe94a-32da-757b-bff1-caefb6302cd1

* refactor: consolidate onboarding state lifecycles

Amp-Thread-ID: https://ampcode.com/threads/T-019fe94a-32da-757b-bff1-caefb6302cd1

* test: model canonical onboarding config writes

Amp-Thread-ID: https://ampcode.com/threads/T-019fe94a-32da-757b-bff1-caefb6302cd1

* fix: compose onboarding locks across gateway surfaces

Amp-Thread-ID: https://ampcode.com/threads/T-019fe94a-32da-757b-bff1-caefb6302cd1

---------

Co-authored-by: Amp <amp@ampcode.com>
2026-08-10 02:45:14 -07:00
Peter Steinberger 8616c0c374 refactor: finish shared test helper migrations (#120996)
* test: finish shared helper migrations

* test: fix helper migration CI

* style: fix test import ordering

* test(acpx): restore deferred void types

* test: fix helper migrations after rebase
2026-08-09 06:00:06 -07:00
Peter Steinberger 7a8eee4a36 perf(agents): keep turn-path model catalog reads off the full live build (#120834)
* perf(agents): keep turn-path model catalog reads off the full live build

First agent turns (embedded and cron) resolved thinking capability through
loadPreparedModelCatalogSnapshot without readOnly, which materialized the
full live model-runtime catalog: ambient synthetic-auth discovery fanned out
to every registered provider and loaded plugin discovery modules through
jiti source transform (3,172 TS modules, 36s event-loop block, +600MB heap,
58.7s model-selection on a cold gateway).

- add loadProviderScopedThinkingCatalog: manifest metadata first, then a
  provider-scoped read-only static catalog, then scoped live discovery only
  for runtime-discovery providers (preserves #116584 Ollama semantics)
- route scopedLiveProviderDiscovery through the scoped read-only loader
- scope live-mode ambient synthetic-auth refs to the requested providers
- bound the last-resort synthetic-auth sweep to discovery entry modules
- memoize per-turn plugin skill dir resolution/republish (single-slot,
  lifecycle-cleared; was a full walk + symlink republish every turn)

Cold first turn 72.7s -> ~22s wall (remaining cost is provider prefill of
the ~19.5k-token default prompt); model-selection 58,726ms -> 124ms.

* test(agents): align model-catalog.runtime mocks with scoped thinking catalog seam

Explicit vi.mock factories must export every binding prod touches; the new
loadProviderScopedThinkingCatalog export is now mocked everywhere the module
is stubbed, and the live-model-switch Ollama hydration test asserts the new
provider-scoped seam instead of the retired unscoped snapshot call shape.

* test(agents): export scoped thinking catalog from every prepared-catalog mock; split synthetic-auth helpers

- add loadProviderScopedThinkingCatalog to all explicit prepared-model-catalog
  and model-catalog.runtime mock factories (vi.mock factories must export every
  binding prod touches)
- move synthetic-auth ref scoping/resolution into
  prepared-model-runtime.synthetic-auth.ts; keeps facts under the max-lines cap

* test(agents): prove scoped thinking hydration for runtime-only models

Boundary proof for the ClawSweeper review gap: the three-tier helper stops at
manifest or scoped-static when they resolve, and runs provider-scoped live
discovery (no broad fanout) only for runtime-only models; cron selection
hydrates through the same scoped helper and skips it entirely for thinking=off.

* test(agents): accept rest args in scoped thinking catalog mocks
2026-08-08 22:48:40 -07:00
Peter Steinberger 915c25d713 fix(macos): complete ChatGPT subscription setup (#120782)
Fresh Dev installs now preflight disk space and stream honest stages, while Codex activation probes the refreshed request-scoped registry.

Closes #120779
Closes #120780
2026-08-08 17:16:00 -07:00
Jason (Json) 68d625b278 fix: keep credentials out of assistant transcripts (#120728) 2026-08-08 16:24:02 -06:00
Peter Steinberger fb911a33ac fix(system-agent): keep inference available across routes (#120712)
* fix(system-agent): keep inference available across routes

Accept provider-owned equivalent response model identities and route every new OpenClaw chat through the configured/authenticated inference fallback ladder. Malformed replies may fall through while provider/model and execution-owner uncertainty remain fail-closed.

Fixes #120711

* fix(system-agent): keep malformed fallback route-scoped

Continue to later configured routes from the same provider after empty or malformed model output. Timeout and unavailable results remain provider-wide, while owner and identity uncertainty remain fail-closed.

Addresses ClawSweeper P1 on #120712.
2026-08-08 15:05:19 -07:00
Peter Steinberger e7a9f33d89 refactor(core): adopt normalization-core leaf helpers across production (#120350)
* refactor(core): adopt normalization-core leaf helpers across production

* fix(ci): keep plugin contract source-resolvable

* fix(errors): preserve adapter-owned error fields

* fix(errors): short-circuit existing errors before stringifying

* fix(errors): skip throwing structured getters

* ci: retrigger checks on current base

* fix(errors): guard structured error enumeration

* fix: harden error detail copying
2026-08-08 12:00:49 -07:00
Peter Steinberger b4a26783f7 refactor(test): consolidate duplicated requireRecord and provider HTTP mock helpers (#119982)
* refactor(test): consolidate duplicated test helpers

* test: remove stale record guard import

* fix(test): remove orphaned record guards

* refactor(test): keep record requirement messages exhaustively typed

* fix(test): keep packages/ai record guard package-local
2026-08-06 14:48:01 -07:00
Vincent Koc beda1e97c6 fix(onboarding): honor external gateway supervision (#119846)
Punchcard-Session: quiet-meadow-timber-mj
2026-08-06 17:26:43 +08:00
Cuttingwater f0a74970ec fix(system-agent): apply approved proposal exactly once (#119389)
Co-authored-by: Chris Davidson <chris.davidson.47@gmail.com>
2026-08-04 23:48:18 -04:00
Peter Steinberger 23c7981a73 test(system-agent): reduce suite setup overhead (#119424)
* test(system-agent): reduce suite setup overhead

* test(system-agent): type-check TUI call ordering

---------

Co-authored-by: Peter Steinberger <steipete@mac-studio-sf2.local>
2026-08-04 20:08:53 -07:00
Vincent Koc c3f148f6b7 fix(plugins): preserve metadata reloads during models status (#119183)
* fix(plugins): preserve newer metadata publications

* test(plugins): type metadata snapshot fixture
2026-08-04 19:24:30 +08:00
joshavant 8393b37779 fix(setup): keep compatible Claude wrappers selectable 2026-08-04 02:08:23 -05:00
joshavant d636f5f8e0 fix(agents): gate Claude live session protocol 2026-08-04 02:08:23 -05:00
Vincent Koc 7a5f108293 fix: unblock macOS release validation (#119110)
* fix(test): guard split-memory tests on case-insensitive filesystems

* fix(sandbox): canonicalize aliased mount roots

* fix(claws): canonicalize aliased manifest paths

* test: isolate release validation from host state
2026-08-04 15:05:31 +08:00
Michael Christenson II 7f7a709b1d fix: Ollama missing from onboarding when its service is reachable (#118020) 2026-08-03 17:49:31 -06:00
Peter Steinberger 05dc73bb35 test: speed up setup inference fixtures (#118811)
Co-authored-by: Peter Steinberger <steipete@mac-studio-sf2.local>
2026-08-03 11:18:33 -07:00
Jesse Merhi 68be0e3378 feat: enable rich setup controls in custodian chat (#114631)
* feat(protocol): carry the awaited wizard step on the chat result

* fix(system-agent): strip sensitive wizard prefill from chat results

* fix(wizard): keep setup secrets server-side

* test(wizard): preserve prompt mock typing

* fix(ui): add reveal toggle to wizard secrets

* refactor(ui): adopt Carapace sensitive input

* fix(ui): hide revealed sensitive input mask

* test(twitch): cover environment-only setup

* feat(custodian): render rich wizard steps

* fix(custodian): validate wizard text replies

* feat(custodian): submit typed wizard answers

* refactor(gateway): isolate custodian chat turns

* fix(gateway): accept session engine adapter

* fix(ui): narrow wizard control values

* refactor: simplify rich wizard answer flow

* fix(custodian): recover evicted wizard sessions

* docs: note custodian rich setup controls

* test(gateway): split wizard answer coverage
2026-08-03 22:18:27 +10:00
Peter Steinberger 1af8bdd9ee test(system-agent): reuse setup fixtures (#118636)
Co-authored-by: Peter Steinberger <steipete@mac-studio-sf2.local>
2026-08-03 04:18:57 -07:00
Peter Steinberger 684d32bed5 test(system-agent): reuse approval CLI fixture (#118572)
Co-authored-by: Peter Steinberger <steipete@mac-studio-sf2.local>
2026-08-03 01:45:47 -07:00
Peter Steinberger ad46acf102 test(system-agent): reuse CLI backend fixture (#118541)
Co-authored-by: Peter Steinberger <steipete@mac-studio-sf2.local>
2026-08-02 23:38:58 -07:00
Peter Steinberger d7ab20a727 perf(system-agent): reuse setup metadata per activation (#118352)
* perf(system-agent): reuse setup metadata per activation

* chore: remove release-owned changelog entry

---------

Co-authored-by: Peter Steinberger <steipete@mac-studio-sf2.local>
2026-08-02 22:52:08 -07:00
Peter Steinberger f3faf61b30 test(system-agent): reuse approval inference fixture (#118390)
Co-authored-by: Peter Steinberger <steipete@mac-studio-sf2.local>
2026-08-02 22:48:50 -07:00
Peter Steinberger 978a449968 test(system-agent): reuse TUI inference fixture (#118435)
Co-authored-by: Peter Steinberger <steipete@mac-studio-sf2.local>
2026-08-02 21:04:34 -07:00
Peter Steinberger 7fc23f904a improve(tests): reuse verified inference fixtures (#118420)
* test(system-agent): reuse verified route fixtures

* test(system-agent): drop stale fixture awaits

---------

Co-authored-by: Peter Steinberger <steipete@mac-studio-sf2.local>
2026-08-02 20:51:28 -07:00
Peter Steinberger b438b9605f fix: dashboards fail to load and interrupted first-time setup never recovers (#118388)
* fix: recover dashboards and interrupted first-time setup

* fix: clarify managed proxy bypass boundary

---------

Co-authored-by: Peter Steinberger <steipete@macos.shared>
2026-08-02 19:56:40 -07:00
Peter Steinberger 94b6d7f509 test(system-agent): reuse shared verified binding (#118227)
Co-authored-by: Peter Steinberger <steipete@mac-studio-sf2.local>
2026-08-02 15:06:37 -07:00
Peter Steinberger 81717b562e test(system-agent): fixture CLI backend policy (#118188)
Co-authored-by: Peter Steinberger <steipete@mac-studio-sf2.local>
2026-08-02 14:45:20 -07:00
Peter Steinberger 53c558979c test(system-agent): reuse plugin metadata snapshot (#118119)
Co-authored-by: Peter Steinberger <steipete@mac-studio-sf2.local>
2026-08-02 11:47:49 -07:00