Files
openclaw/packages/ai
tiffanychum 4b09214866 fix(ai): avoid websocket cache clobber on stale reused release (#105634)
* fix(ai): avoid websocket cache clobber on stale reused release

* fix(ai): prefer-const holdFirstReuse in websocket cache race test

* fix(ai): avoid websocket cache release clobber

* fix(ai): add curly braces for websocket cache delete guard

* fix(ai): owner-check websocket cache deletes without LOC growth

* ci: bump plugin SDK public surface budget pins to match main tip

* fix(ai): satisfy curly lint for websocket cache owner delete

* ci: allowlist readonly state db and format SDK surface pins

* style: oxfmt plugin-sdk surface report

* ci: drop duplicate readonly state db kysely allowlist entry

* test(ai): prove cached websocket lease ownership

Move the contributor stale-release regression into the canonical cached transport suite and prove authenticated real WebSocket close, cancellation, and queued idle expiry cannot evict a replacement lease.

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-29 07:52:04 -04:00
..

@openclaw/ai

Reusable model API contracts, provider adapters, and streaming primitives from OpenClaw. The package supports isolated runtime instances; importing it does not register providers globally.

import { createLlmRuntime } from "@openclaw/ai";
import { registerBuiltInApiProviders } from "@openclaw/ai/providers";

const runtime = createLlmRuntime();
registerBuiltInApiProviders(runtime.registry);

Provider-neutral contracts, validation, diagnostics, and event streams are available from the package root and focused subpaths such as @openclaw/ai/event-stream, @openclaw/ai/transports, and @openclaw/ai/validation. No second OpenClaw runtime package is required.

Provider ids, credentials, model catalogs, retries, and failover remain application concerns. OpenClaw supplies those policies around this package. Host policy (request fetch guarding, secret redaction, strict-tool defaults, provider plugin hooks, and diagnostics logging) can be injected with configureAiTransportHost; the defaults are inert.

The explicit @openclaw/ai/internal/anthropic, openai, retry-after, runtime, and shared subpaths exist for the OpenClaw application itself. They carry no semver guarantee and can change or disappear in any release; do not depend on them outside OpenClaw.