440 Commits

Author SHA1 Message Date
Peter Steinberger c23d66e3b5 refactor: consolidate coercion ownership (#122692)
* refactor: consolidate coercion ownership

* test: align shard check with weighted planning

* chore: refresh plugin SDK API baseline
2026-08-12 09:25:28 -07:00
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 cad77fb39c refactor: consolidate remaining coercion helpers (#122020) 2026-08-11 10:22:01 -07:00
Peter Steinberger fa03d9b913 refactor: consolidate coercion helpers (#121366)
* refactor: consolidate coercion helpers

* fix: remove duplicate coercion imports

* fix: preserve serialized coercion guard

* chore: ratchet coercion helper carve-outs

* fix(test): keep gauntlet subprocess startup lean

* fix: preserve imported session timestamp semantics

* fix: preserve catalog timestamp string semantics

* chore: align plugin SDK surface ratchet

* fix: preserve trajectory and SDK string contracts

* fix(test): preserve QA record assertion semantics

* fix: complete standalone record guard rename

* refactor(cron): use canonical string coercion

* fix(acpx): preserve Pi timestamp parsing

* test(channels): adapt custody test harnesses

* test(telegram): classify media harness as test support

* test(acpx): split timestamp contract coverage

* test(channels): support generated custody contracts

* chore: ban the full coercion helper name set

Extends the declaration guard to all eleven consolidated helper names and
renames the cron schedule-identity readNumber wrapper to readScheduleInteger
so the banned generic name cannot regrow.

* fix(scripts): repair release-validation guard drift and lint cause

Restores the renamed isJsonRecord guard in assertTrustedWorkflowHarness after
main added isRecord call sites in parallel, and attaches the caught YAML error
as the thrown error cause (preserve-caught-error was red on main).

* fix: preserve Claude timestamp string semantics

* fix: preserve persisted timestamp string semantics

* fix: preserve date-first timestamp contracts

* fix(openai): harden delegation failure formatting

* chore: close coercion helper guard gaps

* test(openai): model non-error delegation rejection

* chore: refresh plugin SDK API contract

* fix(tasks): use canonical string field reader

* fix(ai): use canonical provider error field coercion

* fix(browser): migrate native bootstrap coercion

* docs(plugin-sdk): clarify text record export compatibility

* fix(gateway): normalize approval execution identity

* test(outbound): isolate message action poll harness
2026-08-11 00:02:18 -07:00
Vito Cappello 9320bd379e fix(ollama): enable cloud max thinking (#121074)
Co-authored-by: VACInc <3279061+VACInc@users.noreply.github.com>
2026-08-10 19:06:54 -07:00
Peter Steinberger a0ad38e71a feat(docs-ci): validate docs config examples against the schema (#121336)
* feat(docs-ci): validate config examples against schema

* docs: teach canonical agent roster configuration

* docs: nest inline environment variables under vars

* docs: update canonical media model keys

* docs: remove retired config keys from examples

* fix(docs-ci): keep audit internals private

* feat(docs-ci): validate plugin-owned config examples

* fix(docs-ci): validate indented config fences

* fix(ci): route manifest changes through docs audit

* chore(docs): refresh generated config baselines
2026-08-10 07:57:56 -07: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 75dbe52e3e refactor: one code path behind doctor legacy-state migrations (#120716)
* refactor(doctor): prefer manifest route-state owners

* refactor(doctor): unify config repair declarations

* refactor(doctor): unify legacy state migrations

* fix(doctor): satisfy migration pipeline guards

* fix(plugin-sdk): keep doctor adapter inside boundary
2026-08-08 18:23:15 -07:00
Peter Steinberger 8cb53c7b55 perf(doctor): keep bundled doctor contract closures dependency-light (#120698)
* perf(doctor): keep bundled doctor contract closures dependency-light

Doctor contract enumeration cold-loads each plugin's doctor-contract-api
closure via jiti, so a static value import of openclaw/plugin-sdk/runtime-doctor
pulled the state-db/kysely graph (~4.3s per closure) into
listPluginDoctorLegacyConfigRules / listPluginDoctorStateMigrationEntries.

- migrate all light doctor-contract closures (66 files) to the
  dependency-light openclaw/plugin-sdk/runtime-doctor-migrations subpath
- voice-call: load detect/repairOpenClawStateDatabaseSchema* lazily inside
  the migration bodies; keep only a type-only static runtime-doctor import
- matrix: split pure credential record shapes/normalizers into
  credentials-state.ts so the doctor closure no longer imports the sync
  plugin-state store through credentials-read
- guard: doctor-contract-closure-guard.test.ts now forbids static value
  imports of runtime-doctor in closures alongside agent-runtime

* fix(matrix): keep credential revocation record type module-local

Knip production scan flags the export as consumer-less; the type is only
referenced by the exported union and revocation guard signature.
2026-08-08 17:51:31 -07:00
Peter Steinberger da4a656cdb improve: doctor migration checks no longer load every bundled plugin runtime (#120678)
* perf(plugins): declare doctor contract surfaces

* perf(doctor): slim migration import closures

* perf(plugins): narrow doctor declaration record surface and wire owner-test lane

Registry records carry only the doctorContract declaration instead of the whole
parsed manifest, and check:changed now selects the src/plugins-owned declaration
honesty and closure-guard tests for extension module/manifest changes so
cross-lane drift cannot pass PR classification.

* fix(doctor): keep control-plane dist imports require-safe

Keep doctor and channel control-plane chunks off exec-class dependencies, and enforce native require(esm) loading during postbuild.

* chore(plugin-sdk): regenerate API baseline

* chore(plugin-sdk): sync export ordering

* fix(plugins): satisfy doctor contract CI boundaries

* perf(doctor): make qqbot doctor closure dependency-light

qqbot was the last plugin above 5s in doctor state-migration enumeration
(~8s under tsx/jiti). The cost was not the state-key builder (already a
leaf): its doctor closure value-imported the runtime-doctor SDK barrel,
whose plugin-state-store/state-db re-exports pull kysely (~330 modules),
plus security-runtime for one fileExists (~200 modules), all resolved
per-module by jiti during enumeration.

Split the migration-define helpers and light re-exports into a new
private-local plugin-sdk/runtime-doctor-migrations subpath; runtime-doctor
re-exports it so its public surface is byte-identical (API baseline hash
unchanged). qqbot's doctor-contract and state-migrations now import only
the light subpath, swapping fileExists for the equivalent async
legacyStateFileExists already in the closure.

qqbot enumeration: ~8.0s/531 modules -> ~0.25s/18 modules.

* chore(plugin-sdk): drop private-local subpath from API baseline

runtime-doctor-migrations is private-local-only; the baseline tracks public
modules, and the earlier line was generated before the classification.

* fix(plugins): register runtime-doctor-migrations boundary paths

The private-local subpath list feeds the extension package boundary map;
the shared paths config and xai's derived overrides must carry the same
entry or the boundary contract test fails.
2026-08-08 13:29:18 -07:00
Peter Steinberger 48639663b0 chore(release): prepare 2026.8.1 (#120375) 2026-08-07 18:44:12 -07:00
Peter Steinberger bc0c3fcd63 refactor(providers): shared generated-media download guard and binary-response adoption (#120351)
* fix(agents): cancel rejected provider binary bodies

* refactor(providers): share generated media downloads

* refactor(providers): adopt payload patch stream wrapper

* fix(providers): preserve generated media helper contracts
2026-08-07 15:45:53 -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 2fc2fc930b improve(ollama): reduce inactive startup cost (#119745)
* improve(ollama): defer optional runtime imports

Punchcard-Session: coral-workshop-workshop-3f

* improve(ollama): isolate lazy runtime modules

* improve(ollama): preserve lazy runtime boundaries
2026-08-06 07:40:22 +08:00
Vincent Koc f70821908e fix(ollama): activate the model selected during setup 2026-08-04 09:39:02 +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 084833b324 fix(search): propagate cancellation through provider-owned requests (#118895) 2026-08-03 12:46:17 -07:00
Peter Steinberger d857c8eebc fix(ollama): scope embedding credentials to the selected host (#118753) 2026-08-03 10:09:12 -07:00
Peter Steinberger 122181649e test(ollama): consolidate model catalog fixtures (#118491) 2026-08-02 22:28:01 -07:00
Vincent Koc 011691f734 fix(ollama): keep resident model rows private 2026-08-03 12:23:52 +08:00
Vincent Koc cba231bff4 fix(ollama): use only loaded models during guided setup 2026-08-03 12:23:52 +08:00
Vincent Koc 04c8d418e6 refactor(ollama): share resident model discovery 2026-08-03 12:23:52 +08:00
Peter Steinberger b653597020 test(ollama): deduplicate web search fixtures (#118328) 2026-08-02 21:00:03 -07:00
Peter Steinberger c3ea28af61 test(ollama): consolidate stream runtime fixtures (#118419) 2026-08-02 20:39:14 -07:00
Peter Steinberger c6ef95604e refactor(ollama): deduplicate memory embedding test fixtures (#118267) 2026-08-02 17:05:37 -07:00
Peter Steinberger 30c79e4db1 fix(inference): prevent lost cancellation, stuck compaction, and runaway tools (#118146)
* fix(inference): preserve cancellations, compaction, and tool-loop safety

* fix(inference): satisfy Codex and mock-provider type checks

* fix(codex): secure tool-free recovery and restricted turns

* fix(codex): satisfy host-prompt provenance lint
2026-08-02 14:42:01 -07:00
zengLingbiao 397e09e1af fix(ollama): cancel unread auth-failure bodies in web search (#117473)
* fix(ollama): cancel unread auth-failure bodies in web search

(cherry picked from commit 881f191fac)

* fix(ollama): avoid waiting on captured response tees

* chore: keep contributor fix out of release changelog

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-08-02 19:44:19 +08:00
Peter Steinberger 35a1777f68 refactor(providers): consolidate catalog setup helpers (#117824)
* refactor(providers): consolidate catalog setup helpers

* fix(huggingface): narrow discovered model entries
2026-08-01 22:17:52 -07:00
Vincent Koc e07d75dc09 perf(models): skip Ollama row runtime loading (#117465) 2026-08-02 00:30:21 +08:00
Peter Steinberger 568ea29d2e refactor(plugins): inherit shared package boundary settings (#117474) 2026-08-01 09:11:09 -07:00
Peter Steinberger 865a7286c8 fix(ollama): honor model requests and pull completion contracts (#117171)
Co-authored-by: Peter Steinberger <steipete@macos.shared>
2026-07-31 20:19:57 -07:00
Vincent Koc 0e24d596c0 improve(setup): clarify local provider actions 2026-08-01 00:26:40 +08:00
Peter Steinberger c2b0def137 fix(ollama): stream native tool call lifecycle (#116809)
Co-authored-by: Peter Steinberger <steipete@macos.shared>
2026-07-31 05:08:10 -07:00
Leon-SK668 86b1e26993 fix(ollama): resolve web search secret refs (#104829)
* fix(ollama): resolve web search secret refs

* fix(ollama): preserve blocked search secret refs

* fix(ollama): share web search credential policy

* fix(ollama): resolve web search secret refs via shared resolver

Route configured models.providers.ollama.apiKey resolution through the
existing shared resolveWebSearchProviderCredential helper so env-backed
SecretRefs resolve for web search, and resolve the ambient OLLAMA_API_KEY
independently of the configured selected-host key so mixed setups still
reach the Ollama Cloud fallback after both selected-host attempts fail
(regression fixed at web-search-provider.ts:195).

Drop the two optional plugin-SDK resolver hooks (provider normalization
and unavailable-configured-ref callback) added earlier: the fix does not
depend on them, so the shared resolver and its generated plugin-SDK
baseline stay identical to main and no new plugin-SDK contract surface is
introduced. Ollama applies its own non-secret-marker filter locally on
the resolver output instead.

Add a mixed-credential regression test (configured host key plus a
distinct ambient OLLAMA_API_KEY reaching the cloud fallback) and drop the
tests for the removed fail-closed-throw behavior.

* fix(ollama): fail closed on unavailable web search refs

* fix(web-search): resolve env shorthand secret refs

* docs(changelog): note Ollama web-search SecretRef fix

* chore(changelog): remove release-owned entry

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-07-31 17:57:47 +08:00
Peter Steinberger 3d0f02c223 fix(ollama): honor stop sequences and async payload hooks (#116737)
Co-authored-by: Peter Steinberger <steipete@macos.shared>
2026-07-31 02:57:31 -07:00
wahaha1223 a28219bcee fix(ollama): stop oversized stream records from growing memory (#107473)
* fix(ollama): bound pending NDJSON stream records

* chore(changelog): remove release-owned entry

---------

Co-authored-by: wangmiao0668000666 <wang.miao86@xydigit.com>
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-07-31 17:57:01 +08:00
zw-xysk d2b869eda7 fix(ollama): models advertise tools when /api/show fails (#109971)
* fix(ollama): do not advertise tools when /api/show fails

Failed show responses left capabilities undefined, which
buildOllamaModelDefinition treats as optimistic supportsTools.
Match setup inspect: return empty capabilities instead.

* test(ollama): cover show-fail tools gate including L3 live HTTP

Unit paths for HTTP error/throw plus real 127.0.0.1 server proving
buildOllamaProvider keeps supportsTools false when /api/show 500s.

* fix(ollama): keep reasoning heuristics when /api/show fails

Distinguish failed inspection from authoritative empty capabilities
so tools stay conservative without suppressing model-name reasoning.

* test(ollama): cover three capability states for tools and reasoning

Failed show keeps reasoning heuristics; authoritative [] disables both.

* fix(ollama): propagate showInspectionFailed through setup configs

Setup inspection failures now use the three-state marker instead of
authoritative empty capabilities, keeping tools off and reasoning heuristics.

* test(ollama): setup show-fail keeps tools off and reasoning heuristics

Cover interactive setup when /api/show returns 500 for deepseek-r1.

* fix(ollama): propagate showInspectionFailed through dynamic model resolve

/models add dynamic path now builds failed-show definitions with tools
off while preserving reasoning name heuristics.

* test(ollama): dynamic resolve covers failed /api/show three-state behavior

Mock builder matches production tools/reasoning contract for inspection failure.

* fix(ollama): keep catalog-missing dynamic resolve fail-closed on show failure

Failed /api/show is an existence probe for unresolved models; return undefined so typos/404s stay rejected. Tag-discovered and setup paths keep showInspectionFailed tools-off behavior.

* chore(changelog): remove release-owned entry

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-07-31 17:37:48 +08:00
NIO 89bfd2150c fix(ollama): use CJK-aware char estimate for usage fallback (#110073)
* fix(ollama): use CJK-aware char estimate for usage fallback

* fix(ollama): keep CJK estimator plugin-private

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-07-31 17:37:13 +08:00
dwc1997 2c4886ec40 fix(ollama): release failed setup response bodies before returning (#111802)
* fix(ollama): release failed setup response bodies before returning

* chore(changelog): remove release-owned entry

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-07-31 17:32:36 +08:00
Vincent Koc 94b85cba5f feat(setup): improve local model onboarding 2026-07-31 08:53:13 +08:00
Vincent Koc 0822e8d39e fix(qa): preserve missing Ollama cache telemetry (#116424) 2026-07-30 16:37:54 +00:00
pash-openai e52354ea13 fix(build): pin typebox to a published release (#116333) 2026-07-30 09:58:51 +00:00
Vincent Koc 69f10e72f2 fix(ollama): retry unreachable setup in place (#116210) 2026-07-30 12:23:56 +08:00
Peter Steinberger 8e1ea3048c refactor(ollama): unify model inspection and setup (#115879) 2026-07-29 08:27:41 -04:00
Peter Steinberger 4232126bba chore: update dependencies across workspace (#115677)
* chore(deps): update dependencies

* fix(deps): restore CI compatibility
2026-07-29 05:16:42 -04:00
Peter Steinberger 42e9558110 fix(qa): bound paired-node gateway startup readiness (#115693) 2026-07-29 03:45:56 -04:00
Peter Steinberger f466ad0e71 fix(ollama): keep active streams within their idle timeout (#115648)
Retain the existing guarded-fetch timeout callback while consuming native Ollama NDJSON. Prove active slow HTTP streams remain alive and genuine stalls still expire.

Reconstructed from the independently reviewed contributor fix for #94251.

Co-authored-by: Henry <henrybrewer93@icloud.com>
2026-07-29 02:27:02 -04:00
Peter Steinberger ddd0b48673 refactor: remove 3,527 lines of runtime and test duplication (#115626)
* refactor: remove obsolete runtime and test duplication

* test: preserve typed cron and realtime fixtures
2026-07-29 02:21:20 -04:00
Peter Steinberger 5da5551a5c fix(qa): verify paired Ollama nodes over the gateway (#115644) 2026-07-29 02:18:16 -04:00
Peter Steinberger 032defb172 fix(nodes): cancel paired local inference when callers disconnect (#115624) 2026-07-29 02:00:22 -04:00