openclaw - ✅(Solved) Fix [Bug]: requireSandboxBackendFactory throw error after sandbox plugin registered in openclaw starting stage [2 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

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#67610Fetched 2026-04-17 08:30:04
View on GitHub
Comments
0
Participants
1
Timeline
7
Reactions
0
Author
Participants
Timeline (top)
referenced ×3cross-referenced ×2labeled ×2

A new sandbox plugin is registered in openclaw starting stage, but requireSandboxBackendFactory throw error while send message to openclaw.

Error Message

A new sandbox plugin is registered in openclaw starting stage, but requireSandboxBackendFactory throw error while send message to openclaw. 8. the error log: Sandbox backend abc is not registered.Load the plugin that provides it, or set agents.defaults.sandbox.backend=docker. the function requireSandboxBackendFactory can not find the registered backend, and throw error:

Root Cause

A new sandbox plugin is registered in openclaw starting stage, but requireSandboxBackendFactory throw error while send message to openclaw.

Fix Action

Fixed

PR fix notes

PR #67623: fix: Change the scope of the variable SANDBOX_BACKEND_FACTORIES from …

Description (problem / solution / changelog)

…module-level to process-level global(#67610)

Summary

Describe the problem and fix in 2–5 bullets:

If this PR fixes a plugin beta-release blocker, title it fix(<plugin-id>): beta blocker - <summary> and link the matching Beta blocker: <plugin-name> - <summary> issue labeled beta-blocker. Contributors cannot label PRs, so the title is the PR-side signal for maintainers and automation.

  • Problem:
  • Why it matters:
  • What changed:
  • What did NOT change (scope boundary):

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • 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 #
  • Related #
  • This PR fixes a bug or regression

Root Cause (if applicable)

For bug fixes or regressions, explain why this happened, not just what changed. Otherwise write N/A. If the cause is unclear, write Unknown.

  • Root cause: the SANDBOX_BACKEND_FACTORIES is a module variable.
  • Missing detection / guardrail:
  • Contributing context (if known):

Regression Test Plan (if applicable)

For bug fixes or regressions, name the smallest reliable test coverage that should catch this. Otherwise write N/A.

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file:
  • Scenario the test should lock in:
  • Why this is the smallest reliable guardrail:
  • Existing test that already covers this (if any):
  • If no new test is added, why not:

User-visible / Behavior Changes

List user-visible changes (including defaults/config).
If none, write None.

Diagram (if applicable)

For UI changes or non-trivial logic flows, include a small ASCII diagram reviewers can scan quickly. Otherwise write N/A.

Before:N/A
[user action] -> [old state]

After:N/A
[user action] -> [new state] -> [result]

Security Impact (required)

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

Repro + Verification

Environment

  • OS: Ubuntu 22.04
  • Runtime/container: N/A
  • Model/provider: minimax
  • Integration/channel (if any): N/A
  • Relevant config (redacted): N/A

Steps

  1. A new sandbox backend plugin, just named abc
  2. openclaw plugins install abc
  3. set the abc config in openclaw.json, include agents.defaults.sandbox, plugins.entries.abc, etc..
  4. restart openclaw-gateway
  5. the abc is registered successful in log
  6. send message with TUI

Expected

-the exec command is executed in abc sandbox

Actual

-the exec command is executed in abc sandbox

Evidence

Attach at least one:

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

Human Verification (required)

What you personally verified (not just CI), and how:

  • Verified scenarios:
  • Edge cases checked:
  • What you did not verify:

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.

Compatibility / Migration

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

Risks and Mitigations

List only real risks for this PR. Add/remove entries as needed. If none, write None.

  • Risk:
    • Mitigation:

Changed files

  • src/agents/sandbox/backend.ts (modified, +9/-1)

PR #67628: fix(sandbox): use globalThis registry so plugin-registered backends survive across module instances

Description (problem / solution / changelog)

Problem

Fixes #67610.

requireSandboxBackendFactory() throws "not registered" even though the sandbox backend plugin registered successfully during startup. This happens because plugins loaded via Jiti create a separate module instance of backend.ts, which gets its own module-scoped Map. When core later calls requireSandboxBackendFactory(), it reads from a different Map instance that was never populated.

Solution

Replace the module-scoped Map with a globalThis-backed registry using Symbol.for('openclaw.sandboxBackendFactories'). This ensures all module instances (core and Jiti-loaded plugins) share the same registry map.

Changes

  • src/agents/sandbox/backend.ts: Replace module-level SANDBOX_BACKEND_FACTORIES map with a globalThis + Symbol.for() backed getter function. All read/write operations go through the shared global map.
  • src/agents/sandbox/backend.test.ts: Add tests for requireSandboxBackendFactory, cross-instance registration via globalThis, and case-insensitive ID normalization.

Changed files

  • src/agents/sandbox/backend.test.ts (modified, +57/-1)
  • src/agents/sandbox/backend.ts (modified, +24/-7)
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

A new sandbox plugin is registered in openclaw starting stage, but requireSandboxBackendFactory throw error while send message to openclaw.

Steps to reproduce

  1. A new sandbox backend plugin, just named abc
  2. openclaw plugins install abc
  3. set the abc config in openclaw.json, include agents.defaults.sandbox, plugins.entries.abc, etc..
  4. restart openclaw-gateway
  5. I can see the abc is registered successful in log
  6. send message with TUI
  7. the response: Sandbox backend "abc" is not registered.
  8. the error log: Sandbox backend abc is not registered.Load the plugin that provides it, or set agents.defaults.sandbox.backend=docker.

Expected behavior

After send message with TUI, the function requireSandboxBackendFactory can find the registered backend.

Actual behavior

the function requireSandboxBackendFactory can not find the registered backend, and throw error: Sandbox backend abc is not registered.Load the plugin that provides it, or set agents.defaults.sandbox.backend=docker.

OpenClaw version

latest

Operating system

Ubuntu 22.04

Install method

No response

Model

minimax-2.7

Provider / routing chain

openclaw -> cloudfare-ai-gateway -> minimax

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

The requireSandboxBackendFactory function is unable to find the registered "abc" sandbox backend plugin, suggesting a potential issue with plugin registration or configuration.

Guidance

  • Verify that the "abc" plugin is correctly installed and registered in the openclaw.json file, ensuring that all necessary configurations (e.g., agents.defaults.sandbox, plugins.entries.abc) are properly set.
  • Check the plugin's implementation to ensure it correctly exports the sandbox backend factory, allowing requireSandboxBackendFactory to find and load it.
  • Confirm that the openclaw-gateway has been properly restarted after configuring the "abc" plugin to ensure the changes take effect.
  • Review the error log for any additional details that might indicate why the plugin is not being recognized, such as typos in configuration names or paths.

Example

No specific code example can be provided without more details on the plugin's implementation or the exact configurations used in openclaw.json. However, ensuring that the plugin's configuration in openclaw.json matches the expected format and that the plugin correctly implements the required interfaces for sandbox backend factories is crucial.

Notes

The issue might be related to how the plugin is registered or how the requireSandboxBackendFactory function is implemented. Without more specific details about the plugin's code or the exact configurations, it's challenging to provide a precise fix. The openclaw version is mentioned as "latest," which could imply that any known issues related to plugin registration should be resolved, but without a specific version number, it's hard to reference any version-specific fixes or documentation.

Recommendation

Apply workaround: Verify and correct the plugin registration and configuration to ensure that requireSandboxBackendFactory can find the "abc" sandbox backend plugin. This approach is recommended because it directly addresses the error message's suggestion to "Load the plugin that provides it," indicating a potential issue with how the plugin is loaded or registered.

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…

FAQ

Expected behavior

After send message with TUI, the function requireSandboxBackendFactory can find the registered backend.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING