openclaw/packages/ai
Peter Steinberger 3fceb86048
fix: preserve model failure causes and worker fallback runtime (#152028)
* fix(workers): preserve failure causes and fallback runtime

Keep implicit fallback candidates on the runtime owned by their worker placement. Preserve bounded, redacted provider status and classification, retain failure and usage after oversized partial responses, and show actionable error copy in chat history.

* fix(chat): preserve recorded context overflow errors

* fix: distinguish provider failures in saved chat history

* test: reconcile runtime and SQLite fixtures after main updates
2026-09-18 13:36:53 -07:00
..
src fix: preserve model failure causes and worker fallback runtime (#152028) 2026-09-18 13:36:53 -07:00
test/fixtures/provider-transport-parity fix: preserve thinking choices across models and runtimes (#150106) 2026-09-16 10:56:40 -07:00
LICENSE
package.json chore(deps): refresh dependencies with seven-day cutoff (#149908) 2026-09-16 09:06:40 -07:00
README.md fix: keep catalog discovery scoped and execution lazy (#147159) 2026-09-13 10:55:04 -07:00
tsconfig.json

@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, google-model-family, openai, openai-completions-compat, openai-responses-payload-policy, retry-after, runtime, shared, and tool-schema 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.