Skip to content

refactor: keep plain text tool-call promotion private - #86374

Merged
steipete merged 1 commit into
mainfrom
refactor/plain-text-tool-call-core-helper
May 25, 2026
Merged

steipete merged 1 commit into
mainfrom
refactor/plain-text-tool-call-core-helper

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Summary

  • Move the plain-text tool-call promotion wrapper out of the public provider stream SDK helper.
  • Add a private local-only provider-stream-runtime-internal SDK subpath for bundled provider runtime hygiene.
  • Keep LM Studio and xAI opt-in behavior unchanged while removing the newly added public API surface from provider-stream-shared.

Verification

  • node scripts/run-vitest.mjs extensions/lmstudio/src/stream.test.ts extensions/xai/stream.test.ts src/plugin-sdk/provider-stream-shared.test.ts src/plugin-sdk/tool-payload.test.ts src/plugins/sdk-alias.test.ts src/plugins/contracts/plugin-sdk-root-alias.test.ts src/plugins/contracts/plugin-sdk-package-contract-guardrails.test.ts
  • node scripts/check-plugin-sdk-subpath-exports.mjs
  • pnpm plugin-sdk:check-exports
  • pnpm exec oxfmt --write extensions/lmstudio/src/stream.ts extensions/xai/stream.ts src/plugin-sdk/provider-stream-shared.ts src/plugin-sdk/provider-stream-runtime-internal.ts
  • pnpm lint:extensions:no-src-outside-plugin-sdk
  • pnpm lint:extensions:no-plugin-sdk-internal
  • pnpm lint:plugins:plugin-sdk-subpaths-exported
  • pnpm build:plugin-sdk:dts
  • pnpm build
  • pnpm plugin-sdk:api:gen
  • pnpm plugin-sdk:api:check
  • git diff --check
  • env -u OPENCLAW_TESTBOX -u OPENCLAW_TESTBOX_REMOTE_RUN pnpm check:changed

Real behavior proof

Behavior addressed: plain-text tool-call fallback promotion remains available to bundled LM Studio and xAI providers, but is no longer exported from the public provider stream SDK helper.
Real environment tested: local macOS checkout, Node 26.0.0 via repo scripts.
Exact steps or command run after this patch: focused provider/SDK tests, SDK export/API checks, full pnpm build, and local pnpm check:changed with inherited Testbox env unset.
Evidence after fix: focused suite passed 7 files / 145 tests; pnpm build completed; pnpm plugin-sdk:api:check passed after regenerating the baseline hash; pnpm check:changed completed successfully.
Observed result after fix: LM Studio and xAI still import the wrapper through a private local-only subpath, while root and @openclaw/plugin-sdk package exports do not publish that subpath.
What was not tested: live provider call against LM Studio or xAI; this is an import-boundary refactor with unchanged wrapper behavior.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts extensions: lmstudio extensions: xai size: L maintainer Maintainer-authored PR labels May 25, 2026
@clawsweeper

clawsweeper Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: refactor: keep plain text tool-call promotion private This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@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: 037601d899

ℹ️ 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".

import { createSubsystemLogger } from "openclaw/plugin-sdk/logging-core";
import type { ProviderWrapStreamFnContext } from "openclaw/plugin-sdk/plugin-entry";
import { createPlainTextToolCallPromotionWrapper } from "openclaw/plugin-sdk/provider-stream-shared";
import { createPlainTextToolCallPromotionWrapper } from "openclaw/plugin-sdk/provider-stream-runtime-internal";

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.

P1 Badge Keep new private SDK subpath resolvable for LMStudio/XAI

Switching LM Studio/xAI to openclaw/plugin-sdk/provider-stream-runtime-internal makes runtime loading depend on the private-subpath owner gate, but this commit does not add that subpath to PRIVATE_PLUGIN_SDK_SUBPATH_OWNERS in src/plugins/sdk-alias.ts (see owner filter at lines 280-300 and shouldIncludePrivateLocalOnlyPluginSdkSubpath at 593-606). In normal runs where OPENCLAW_ENABLE_PRIVATE_QA_CLI is not set, ownerless private subpaths are excluded, so these imports can fail to resolve when the bundled provider module is loaded (tests can miss this because Vitest aliases all private subpaths directly).

Useful? React with 👍 / 👎.

@steipete
steipete merged commit c3ab2de into main May 25, 2026
142 of 148 checks passed
@steipete
steipete deleted the refactor/plain-text-tool-call-core-helper branch May 25, 2026 07:43
@steipete

Copy link
Copy Markdown
Contributor Author

Landed.

Merged as c3ab2de from head 037601d.

Proof:

  • node scripts/run-vitest.mjs extensions/lmstudio/src/stream.test.ts extensions/xai/stream.test.ts src/plugin-sdk/provider-stream-shared.test.ts src/plugin-sdk/tool-payload.test.ts src/plugins/sdk-alias.test.ts src/plugins/contracts/plugin-sdk-root-alias.test.ts src/plugins/contracts/plugin-sdk-package-contract-guardrails.test.ts -> 7 files, 145 tests passed
  • node scripts/check-plugin-sdk-subpath-exports.mjs
  • pnpm plugin-sdk:check-exports
  • pnpm lint:extensions:no-src-outside-plugin-sdk
  • pnpm lint:extensions:no-plugin-sdk-internal
  • pnpm lint:plugins:plugin-sdk-subpaths-exported
  • pnpm build:plugin-sdk:dts
  • pnpm build
  • pnpm plugin-sdk:api:check
  • git diff --check
  • env -u OPENCLAW_TESTBOX -u OPENCLAW_TESTBOX_REMOTE_RUN pnpm check:changed
  • GitHub CI green on 037601d

Auto-review note: no callable $autoreview tool was available in this session, so I did a manual diff/export-surface review pass before merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 26, 2026
Move the plain-text tool-call promotion wrapper out of the public provider stream SDK helper and into a private local-only bundled-provider runtime seam.
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
Move the plain-text tool-call promotion wrapper out of the public provider stream SDK helper and into a private local-only bundled-provider runtime seam.
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
Move the plain-text tool-call promotion wrapper out of the public provider stream SDK helper and into a private local-only bundled-provider runtime seam.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation extensions: lmstudio extensions: xai maintainer Maintainer-authored PR scripts Repository scripts size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant