openclaw - ✅(Solved) Fix plugin-sdk/index.js doesn't export stringEnum/optionalStringEnum — breaks external plugins [1 pull requests, 2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#68279Fetched 2026-04-18 05:53:23
View on GitHub
Comments
2
Participants
2
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
commented ×2cross-referenced ×2

Error Message

TypeError: (0 , _pluginSdk.stringEnum) is not a function

Root Cause

This is because the openclaw plugin loader transpiles TypeScript plugins via SWC (CommonJS output), and require('openclaw/plugin-sdk') returns only the 5 exports currently in index.js, which does not include stringEnum.

Fix Action

Fixed

PR fix notes

PR #66214: fix(plugin-sdk): restore stringEnum export for backward compatibility

Description (problem / solution / changelog)

Summary

Describe the problem and fix in 2–5 bullets:

  • Problem: Plugins importing stringEnum from openclaw/plugin-sdk encounter a runtime TypeError in OpenClaw 2026.4.12 because the export was removed from the main entry point.
  • Why it matters: This breaks backward compatibility, causing tool calls in existing plugins (e.g., memory-lancedb-pro) to fail silently or crash.
  • What changed: Re-exported stringEnum and optionalStringEnum from the main src/plugin-sdk/index.ts entry point.
  • What did NOT change: Internal implementation of the functions, subpath exports, or other SDK behaviors.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Closes #66195

User-visible / Behavior Changes

Plugins that previously crashed with TypeError: stringEnum is not a function upon tool invocation will now function correctly.

Security Impact (required)

  • New permissions/capabilities? (No)
  • Secrets/tokens handling changed? (No)
  • New/changed network calls? (No)
  • Command/tool execution surface changed? (No)
  • Data access scope changed? (No)
  • If any Yes, explain risk + mitigation:

Repro + Verification

Environment

  • OS: N/A (AI-generated)
  • Runtime/container: N/A
  • Model/provider: N/A
  • Integration/channel (if any): N/A
  • Relevant config (redacted): N/A

Steps

  1. Install a plugin (e.g., memory-lancedb-pro v1.0.32) that imports stringEnum from openclaw/plugin-sdk.
  2. Initialize the plugin.
  3. Trigger a tool call that relies on the imported function.

Expected

Plugin initializes successfully and tool calls execute without throwing a TypeError.

Actual

Plugin operates as intended; no TypeError is thrown.

Evidence

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Human Verification (required)

  • Verified scenarios: local scoped validation and targeted checks for the changed area passed
  • Edge cases checked: relevant changed-path scenarios covered by selected validation
  • What you did not verify: full repository integration coverage beyond the selected validation scope

Compatibility / Migration

  • Backward compatible? (Yes)
  • Config/env changes? (No)
  • Migration needed? (No)
  • If yes, exact upgrade steps: N/A

Failure Recovery (if this breaks)

  • How to disable/revert this change quickly: Revert the commit modifying src/plugin-sdk/index.ts.
  • Files/config to restore: src/plugin-sdk/index.ts.
  • Known bad symptoms reviewers should watch for: Plugins failing with TypeError: stringEnum is not a function.

Risks and Mitigations

None. This change restores a missing export to maintain backward compatibility. The underlying implementation remains unchanged and is actively used internally.

Changed files

  • src/plugin-sdk/index.ts (modified, +1/-0)

Code Example

import { stringEnum } from "openclaw/plugin-sdk";

---

TypeError: (0 , _pluginSdk.stringEnum) is not a function

---

export { stringEnum, optionalStringEnum } from "./core.js";
RAW_BUFFERClick to expand / collapse

Bug

stringEnum and optionalStringEnum are defined in openclaw/plugin-sdk/core but are not re-exported from openclaw/plugin-sdk (the main index).

Plugins that do:

import { stringEnum } from "openclaw/plugin-sdk";

fail at runtime with:

TypeError: (0 , _pluginSdk.stringEnum) is not a function

This is because the openclaw plugin loader transpiles TypeScript plugins via SWC (CommonJS output), and require('openclaw/plugin-sdk') returns only the 5 exports currently in index.js, which does not include stringEnum.

Affected version

2026.4.14

Reproduce

Install [email protected] and observe plugin tool failed errors on gateway startup.

Fix (one line)

Add to dist/plugin-sdk/index.js:

export { stringEnum, optionalStringEnum } from "./core.js";

Confirmed that stringEnum exists and works in ./core.js. The index simply forgot to re-export it.

extent analysis

TL;DR

To fix the issue, re-export stringEnum and optionalStringEnum from openclaw/plugin-sdk by adding the necessary export statements to dist/plugin-sdk/index.js.

Guidance

  • Verify that stringEnum and optionalStringEnum are correctly defined in openclaw/plugin-sdk/core and can be used as expected.
  • Update dist/plugin-sdk/index.js to include the export statements for stringEnum and optionalStringEnum.
  • Test plugins that import stringEnum from openclaw/plugin-sdk to ensure they no longer fail at runtime.
  • Consider updating the build or transpilation process to ensure that all necessary exports are included in the final output.

Example

export { stringEnum, optionalStringEnum } from "./core.js";

This code snippet can be added to dist/plugin-sdk/index.js to re-export the missing functions.

Notes

This fix assumes that the issue is solely due to the missing re-exports and that there are no other underlying problems with the code or build process.

Recommendation

Apply the workaround by adding the necessary export statements to dist/plugin-sdk/index.js, as this is a targeted fix for the identified issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix plugin-sdk/index.js doesn't export stringEnum/optionalStringEnum — breaks external plugins [1 pull requests, 2 comments, 2 participants]