Skip to content

refactor: extract reusable AI runtime package#99059

Merged
steipete merged 28 commits into
mainfrom
feat/issue-99040-ai-runtime-package
Jul 5, 2026
Merged

refactor: extract reusable AI runtime package#99059
steipete merged 28 commits into
mainfrom
feat/issue-99040-ai-runtime-package

Conversation

@steipete

@steipete steipete commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Closes #99040

What Problem This Solves

OpenClaw's model protocol adapters and streaming registry were embedded in the main application, so other packages could not reuse the proven Anthropic, OpenAI, Azure OpenAI, Google, Vertex, Mistral, and ChatGPT/Codex transports without taking on OpenClaw's application runtime.

Why This Change Was Made

This extracts one public package: @openclaw/ai. It contains the provider-neutral model/message/tool contracts, validation, diagnostics, event streams, isolated runtime registry, and lazy provider adapters. packages/llm-core remains a private implementation package and is bundled into @openclaw/ai; consumers never install or publish a second OpenClaw AI package.

The package is genuinely self-contained. Pure transport helpers that previously lived in application code (tool projections and strict-schema normalization, system-prompt cache boundary, stream first-event timeout, streaming byte guard, deferred event buffer, Anthropic model contract/refusal/auth-header helpers, OpenAI reasoning-effort and responses-stream compat, reasoning-tag text partitioner, LLM request activity) moved into packages/ai; utf16-slice moved into @openclaw/normalization-core. Host policy stays in OpenClaw and is injected through a narrow AiTransportHost port (configureAiTransportHost): guarded model fetch (SSRF policy), secret redaction for tool-result replay, OpenAI strict-tool defaults, and diagnostics logging. Library defaults are inert; src/llm/stream.ts installs OpenClaw's implementations. There are no relative imports from the package back into src/.

The public barrel is instance-first: createApiRegistry() / createLlmRuntime() plus contracts and the host port. The process-default registry/runtime and their bound helpers moved behind @openclaw/ai/internal/*, which exists for OpenClaw itself and carries no semver guarantee (documented in the README). registerBuiltInApiProviders(registry) takes an explicit registry. Built-in provider registration is table-driven, replacing ~420 lines of per-provider boilerplate.

OpenClaw consumes @openclaw/ai as a normal workspace dependency, which pnpm pack converts to the exact release version. Runtime stream construction resolves through @openclaw/ai/event-stream, preserving one EventStream constructor identity across OpenClaw, agent-core, and external consumers. The release workflow packs, verifies, and publishes @openclaw/ai before the root package, and packages/ai now ships its own npm-shrinkwrap.json so its transitive dependency tree stays pinned at user install time even though workspace deps are omitted from the root shrinkwrap.

User Impact

Existing OpenClaw users should see no configuration, model selection, authentication, or streaming behavior change. Installing openclaw installs the exact @openclaw/ai release automatically, with the AI package's dependency tree pinned by its own shrinkwrap. Library consumers can depend on the one package, create isolated runtimes, and opt into the eight built-in API adapters without inheriting a mutable process-global registry.

Evidence

  • pnpm build passed end to end: package declarations, root bundle, CLI/bootstrap guards, runtime postbuild, plugin SDK export check, and Control UI build.
  • pnpm tsgo and pnpm check:test-types pass; the tsdown.config.ts dts.neverBundle option was moved to its correct deps.dts home (the previous placement was a type error that broke check-test-types on CI).
  • The checks-node-compact-* CI failures (Cannot find module @openclaw/ai/dist/providers.mjs) were root-caused to three Node-side alias tables that only knew @openclaw/llm-core: src/plugin-sdk/root-alias.cjs, src/plugins/plugin-sdk-native-resolver.ts, and src/plugins/sdk-alias.ts. All now cover the @openclaw/ai export map (and the new normalization-core/utf16-slice subpath); the previously failing tests (models-config.applies-config-env-vars, model-selection) pass locally.
  • check-dependencies (knip) is clean: packages/ai declares only its six real runtime deps (Anthropic/OpenAI/Google/Mistral SDKs, partial-json, typebox); orphaned root deps (@mistralai/mistralai, partial-json) removed; knip config knows the new package's entry points.
  • Focused suites pass locally via node scripts/run-vitest.mjs: all of packages/ai, src/llm, packages/agent-core, packages/normalization-core, transport streams, model selection/config, custom API registry, and the host-port integration proofs (SSRF fetch-proof, redaction contract, OpenAI-compatible auth) — 869 tests, 0 failures.
  • pnpm check:changed run over the full branch diff.
  • Fresh Codex autoreview completed clean with no accepted/actionable findings.
  • examples/ai-chat is a minimal external-consumer app that uses only the public package surface against the built dist (isolated runtime + built-in provider registration + one streamed completion). Live-verified end to end against a local Ollama server through the OpenAI-completions transport: streamed text deltas, stop=stop, token usage reported.

@steipete
steipete requested review from a team as code owners July 2, 2026 11:33
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts commands Command implementations agents Agent runtime and tooling size: XL maintainer Maintainer-authored PR labels Jul 2, 2026
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Dependency Guard

This PR changes dependency-related files. Maintainers should confirm these changes are intentional.

Changed files:

  • examples/ai-chat/package.json
  • package.json
  • packages/agent-core/package.json
  • packages/ai/npm-shrinkwrap.json
  • packages/ai/package.json
  • packages/llm-runtime/package.json
  • pnpm-lock.yaml
  • pnpm-workspace.yaml

Maintainer follow-up:

  • Review whether the dependency changes are intentional.
  • Inspect resolved package deltas when lockfile, shrinkwrap, or workspace dependency policy changes are present.
  • Treat package-lock.json and npm-shrinkwrap.json diffs as security-review surfaces.
  • Run pnpm deps:changes:report -- --base-ref origin/main --markdown /tmp/dependency-changes.md --json /tmp/dependency-changes.json locally for detailed release-style evidence.

@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Jul 2, 2026
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Dependency graph changes noted

This PR includes dependency graph changes. The dependency guard is informational because the PR author is a repository admin or a member of @openclaw/openclaw-secops.

  • Current SHA: 4a19f9df21924885add391ce2a3b828d6ec20f3b
  • Trusted actor: @steipete
  • Trusted role: pull request author; openclaw-secops

Security review is still recommended before merge when the dependency graph change is intentional.

@blacksmith-sh

This comment has been minimized.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8b820b4886

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread package.json
"@mistralai/mistralai": "2.2.5",
"@modelcontextprotocol/sdk": "1.29.0",
"@mozilla/readability": "0.6.0",
"@openclaw/ai": "workspace:*",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Regenerate the root shrinkwrap for the new runtime dependency

Adding @openclaw/ai to the root package makes it part of the published OpenClaw install, but npm-shrinkwrap.json was not updated and its root dependency map still has no @openclaw/ai entry. The repo’s pnpm check path runs deps:shrinkwrap:check, so this dependency change will leave CI/release validation failing until the root shrinkwrap is regenerated and committed.

Useful? React with 👍 / 👎.

@clawsweeper

clawsweeper Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed July 5, 2026, 1:42 AM ET / 05:42 UTC.

Summary
The PR extracts OpenClaw's model/runtime transports into a publishable @openclaw/ai workspace package and updates provider loading, SDK aliases, release packaging, tests, and docs around that boundary.

Reproducibility: yes. for the review findings: current-head source inspection shows the Jiti plugin loader alias map omits @openclaw/ai while SDK imports now require it, and helper barrels still re-export transport modules. No runtime command was run because this review was required to keep the checkout read-only.

Review metrics: 2 noteworthy metrics.

  • Public npm package surface: 1 added publishable package. @openclaw/ai adds exports, package metadata, shrinkwrap, and release publishing behavior, so package compatibility and release proof matter before merge.
  • Runtime dependency pin set: 6 runtime dependencies. The new package shrinkwrap pins Anthropic, Google, Mistral, OpenAI, partial-json, and typebox dependencies; lockfile/shrinkwrap review is part of the merge surface.

Stored data model
Persistent data-model change detected: persistent cache schema: packages/ai/src/internal/openai.ts, persistent cache schema: packages/ai/src/internal/shared.ts, persistent cache schema: src/plugin-sdk/provider-transport-runtime.ts, serialized state: src/scripts/sync-plugin-versions.test.ts, serialized state: test/e2e/qa-lab/runtime/package-openclaw-for-docker.e2e.test.ts, unknown-data-model-change: packages/ai/src/providers/agent-tools-parameter-schema.ts, and 1 more. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #99040
Summary: This PR is the implementation candidate for the linked reusable AI runtime extraction issue.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦐 gold shrimp
Proof: 🐚 platinum hermit
Patch quality: 🦐 gold shrimp
Result: needs maintainer review before merge.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Fix the Jiti plugin loader aliases for @openclaw/ai and @openclaw/llm-core.
  • Split helper-only AI internal barrels from provider transport modules.

Risk before merge

  • [P1] The PR adds a publishable package and changes release/package dependency handling; maintainers still need package and upgrade proof after the line-level blockers are fixed.
  • [P1] The moved provider transport boundary includes ChatGPT/Codex, OpenAI, Anthropic, Google, Vertex, Mistral, auth, fetch, redaction, and strict-tool host ports, so provider/auth regressions are plausible if the package boundary is wrong.
  • [P1] Current CI has failing and pending checks on the latest head, including checks-node-compact-small-whole-*; the source findings above are independent of CI state but align with the kind of loader/runtime risk CI is exercising.

Maintainer options:

  1. Fix loader and import topology first (recommended)
    Add the missing Jiti source aliases and split helper barrels before merge so plugin development, source checkout workflows, and provider laziness remain compatible.
  2. Accept package-boundary risk explicitly
    Maintainers could choose to land after focused fixes with documented package/release proof because this intentionally introduces a new public runtime package.
  3. Pause for package API ownership
    If the public @openclaw/ai package/API shape is still unsettled, pause the PR and keep refactor: extract reusable AI runtime packages #99040 as the canonical design item.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Add @openclaw/ai public/internal and @openclaw/llm-core workspace alias coverage to the Jiti plugin loader path in src/plugins/sdk-alias.ts with focused tests, and split @openclaw/ai/internal/openai plus internal/anthropic helper-only exports away from provider transport modules so schema/helper imports do not eagerly load provider SDK transports.

Next step before merge

  • [P2] The remaining blockers are concrete file-level repairs that automation can attempt on the PR branch; protected-label and package/API acceptance still need maintainer review afterward.

Security
Cleared: The diff touches dependency, shrinkwrap, package, and release surfaces; I found no concrete malicious code, secret exposure, or supply-chain escalation beyond the intentional new package dependency graph.

Review findings

  • [P2] Add AI aliases to the Jiti plugin loader — src/plugins/sdk-alias.ts:802-806
  • [P2] Split helper exports from provider transports — packages/ai/src/internal/openai.ts:5-8
Review details

Best possible solution:

Keep the extraction direction, but finish the package-boundary repair so source plugin loaders resolve @openclaw/ai from source and helper-only SDK paths do not import provider transport modules.

Do we have a high-confidence way to reproduce the issue?

Yes for the review findings: current-head source inspection shows the Jiti plugin loader alias map omits @openclaw/ai while SDK imports now require it, and helper barrels still re-export transport modules. No runtime command was run because this review was required to keep the checkout read-only.

Is this the best way to solve the issue?

No, not yet; the extraction direction matches the linked maintainer architecture issue, but this PR still needs source-loader alias coverage and a narrower helper/transport split before it is the best merge shape.

Full review comments:

  • [P2] Add AI aliases to the Jiti plugin loader — src/plugins/sdk-alias.ts:802-806
    This PR adds new source imports from openclaw/plugin-sdk/llm into @openclaw/ai/internal/runtime, but the Jiti plugin-loader alias table still only gained normalization-core/utf16-slice here and has no @openclaw/ai or @openclaw/llm-core entries. In an unbuilt source checkout, plugin loading can fall through to packages/ai/dist/internal/runtime.mjs, which does not exist until after build; add the AI public/internal and llm-core aliases to this loader path too.
    Confidence: 0.92
  • [P2] Split helper exports from provider transports — packages/ai/src/internal/openai.ts:5-8
    Helper-only callers such as src/plugin-sdk/provider-tools.ts import schema utilities from this barrel, but export * from openai-completions and openai-responses evaluates transport modules that import provider SDKs at top level. This keeps the prior blocker unresolved and regresses the intended lazy provider loading; split helper-only exports from transport modules and mirror the same shape for the Anthropic barrel.
    Confidence: 0.9

Overall correctness: patch is incorrect
Overall confidence: 0.88

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against c29054a7dc73.

Label changes

Label changes:

  • add merge-risk: 🚨 compatibility: Missing Jiti source aliases can break existing source checkout and plugin development workflows that load openclaw/plugin-sdk/llm before a build.
  • add merge-risk: 🚨 auth-provider: The refactor moves provider transports and host auth/fetch/redaction policy ports, so provider routing and credential behavior need explicit upgrade proof.
  • add merge-risk: 🚨 automation: The PR changes npm release workflow, Docker/package packing, shrinkwrap handling, and dependency packaging, which are CI/release automation surfaces not settled by ordinary unit tests alone.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body reports a real external-consumer examples/ai-chat run against local Ollama with streamed deltas, stop=stop, and token usage, which is appropriate non-visual proof for this package/runtime refactor.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (live_output): The PR body reports a real external-consumer examples/ai-chat run against local Ollama with streamed deltas, stop=stop, and token usage, which is appropriate non-visual proof for this package/runtime refactor.

Label justifications:

  • P2: This is a broad runtime/package refactor with concrete merge blockers but no immediate emergency user-facing outage.
  • merge-risk: 🚨 compatibility: Missing Jiti source aliases can break existing source checkout and plugin development workflows that load openclaw/plugin-sdk/llm before a build.
  • merge-risk: 🚨 auth-provider: The refactor moves provider transports and host auth/fetch/redaction policy ports, so provider routing and credential behavior need explicit upgrade proof.
  • merge-risk: 🚨 automation: The PR changes npm release workflow, Docker/package packing, shrinkwrap handling, and dependency packaging, which are CI/release automation surfaces not settled by ordinary unit tests alone.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (live_output): The PR body reports a real external-consumer examples/ai-chat run against local Ollama with streamed deltas, stop=stop, and token usage, which is appropriate non-visual proof for this package/runtime refactor.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body reports a real external-consumer examples/ai-chat run against local Ollama with streamed deltas, stop=stop, and token usage, which is appropriate non-visual proof for this package/runtime refactor.
Evidence reviewed

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs src/plugins/contracts/plugin-sdk-root-alias.test.ts src/plugins/plugin-sdk-native-resolver.test.ts.
  • [P1] node scripts/run-vitest.mjs src/agents/agent-tools.schema.test.ts src/plugins/contracts/extension-package-project-boundaries.test.ts.
  • [P1] pnpm build.

What I checked:

  • Repository policy read: Root and scoped AGENTS.md files for scripts, docs, plugin SDK, plugins, agents, extensions, UI, and tests were read before the verdict; their package-boundary, lazy-loading, dependency, and PR-review guidance applies here. (AGENTS.md:1, c29054a7dc73)
  • Gitcrawl unavailable: The OpenClaw PR-maintainer workflow says to start with gitcrawl, but gitcrawl is unavailable in this environment, so live gh and local git inspection were used instead.
  • Jiti alias map still lacks AI aliases: Current PR head src/plugins/sdk-alias.ts contains workspace aliases for markdown and normalization packages but no @openclaw/ai or @openclaw/llm-core entries, even though source SDK loading now reaches @openclaw/ai/internal/runtime. (src/plugins/sdk-alias.ts:520, 73a94afef00c)
  • Helper barrel still re-exports transports: @openclaw/ai/internal/openai re-exports openai-completions and openai-responses, so helper-only consumers of that barrel evaluate transport modules. (packages/ai/src/internal/openai.ts:5, 73a94afef00c)
  • Transport imports provider SDK eagerly: openai-completions.ts imports the OpenAI SDK at module top level, so re-exporting it from a helper barrel defeats the intended lazy provider loading for schema/helper paths. (packages/ai/src/providers/openai-completions.ts:2, 73a94afef00c)
  • Helper callers use the heavy barrel: src/plugin-sdk/provider-tools.ts imports schema helpers from @openclaw/ai/internal/openai, so plugin SDK helper import paths can load provider transports through the barrel. (src/plugin-sdk/provider-tools.ts:1, 73a94afef00c)

Likely related people:

  • Yuya Hirayama: Current-main blame and file history for src/plugins/sdk-alias.ts and src/llm/providers/register-builtins.ts point to commit fe8234621e56670d6e2d2f3bc4ed6c08ade4c039, which currently owns much of the relevant loader/runtime surface in this checkout. (role: recent area contributor; confidence: medium; commits: fe8234621e56; files: src/plugins/sdk-alias.ts, src/llm/providers/register-builtins.ts)
  • steipete: Peter Steinberger is assignee/author of the linked architecture issue and PR and is also listed as a co-author on the current-main commit carrying the nearby runtime/loader surface, so he is a likely routing candidate without treating PR authorship alone as ownership. (role: adjacent owner; confidence: high; commits: fe8234621e56, 73a94afef00c; files: packages/ai, src/llm, src/plugins/sdk-alias.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (12 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-04T16:42:58.055Z sha e513aa2 :: found issues before merge. :: [P2] Emit the new utf16-slice build entry
  • reviewed 2026-07-04T19:04:32.281Z sha 8f7d50e :: found issues before merge. :: [P2] Keep source package tarballs installable | [P2] Emit the utf16-slice dist entry | [P2] Alias AI runtime transitive source packages
  • reviewed 2026-07-04T19:12:53.598Z sha 8f7d50e :: found issues before merge. :: [P2] Carry the AI tarball through source package lanes | [P2] Emit the utf16-slice build entry | [P2] Keep source SDK aliases transitive
  • reviewed 2026-07-04T19:40:31.955Z sha a198b71 :: needs changes before merge. :: [P2] Carry the AI tarball through source package lanes | [P2] Emit the utf16-slice build entry | [P2] Keep source SDK aliases transitive
  • reviewed 2026-07-05T03:00:09.298Z sha 9caf98c :: found issues before merge. :: [P2] Carry the AI tarball through all package lanes | [P2] Emit the utf16-slice root build entry | [P2] Alias AI runtime transitive source packages
  • reviewed 2026-07-05T04:32:54.155Z sha 6a658e0 :: found issues before merge. :: [P2] Keep helper barrels off provider transports | [P2] Remove extracted deps from the root package
  • reviewed 2026-07-05T05:05:26.838Z sha 8b43cef :: found issues before merge. :: [P2] Split helper exports from provider transports
  • reviewed 2026-07-05T05:24:41.847Z sha 27c7e2b :: found issues before merge. :: [P2] Split helper exports from provider transports | [P2] Add AI aliases to the Jiti plugin loader

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Jul 2, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f3da91f256

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread package.json
Comment thread src/plugin-sdk/llm.ts
getEnvApiKey,
parseStreamingJson,
sanitizeSurrogates,
} from "@openclaw/ai/internal/runtime";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Teach source SDK loaders about @openclaw/ai

This new SDK import is reached when a local plugin loads openclaw/plugin-sdk/llm through the source root-alias/Jiti path, but src/plugin-sdk/root-alias.cjs only aliases plugin-sdk subpaths and @openclaw/llm-core back to source. In an unbuilt source checkout, @openclaw/ai/internal/runtime falls through to the workspace package's exports target under packages/ai/dist/internal/*.mjs, which does not exist until a build, so plugin dev/test loads of this public SDK subpath fail unless the @openclaw/ai public and internal subpaths are added to the same source alias/native-resolver maps.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. labels Jul 2, 2026
@steipete

steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui commands Command implementations dependencies-changed PR changes dependency-related files docker Docker and sandbox tooling docs Improvements or additions to documentation extensions: xai gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts security Security documentation size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: extract reusable AI runtime packages

1 participant