Tencent/WeKnora · error
sandbox is not configured
Error message
sandbox is not configured
What it means
ExecuteScript refuses to run when the skills manager was constructed without a sandbox manager (m.sandboxMgr == nil). Skill scripts only run inside the sandbox, so without that dependency the manager can list/read skills but cannot execute them. It is an internal invariant/availability check, not a user-input error.
Source
Thrown at internal/agent/skills/manager.go:349
return "", false
}
dir = strings.TrimSpace(dir)
return dir, dir != ""
}
// ExecuteScript executes a script from a skill in the sandbox
func (m *Manager) ExecuteScript(ctx context.Context, skillName, scriptPath string, args []string, stdin string) (*sandbox.ExecuteResult, error) {
if !m.enabled {
return nil, fmt.Errorf("skills are not enabled")
}
if !m.isSkillAllowed(skillName) {
return nil, fmt.Errorf("skill not allowed: %s", skillName)
}
// Verify sandbox manager is available
if m.sandboxMgr == nil {
return nil, fmt.Errorf("sandbox is not configured")
}
source := m.resolveSource(skillName)
// Get the skill base path
basePath, err := source.GetSkillBasePath(skillName)
if err != nil {
return nil, err
}
// Prepare execution config
logger.Info(ctx, "[Tool][ExecuteScript]:Prepare execution config")
sessionID, _ := types.SessionIDFromContext(ctx)
// Compute the artifact output directory. All skills share the same root
// directory (/workspace/output/) to enable collaboration and file sharing
// between different skill executions in the same session.
// Skill scripts read the directory via WEKNORA_SKILL_OUTPUT_DIR; theView on GitHub (pinned to 988cbb0330)
Solutions
- Enable and correctly initialize the sandbox manager so it is injected into the skills manager before ExecuteScript is called
- Check startup logs for sandbox initialization failure and fix the underlying cause (Docker/runtime unavailable, bad sandbox config)
- Verify the skills manager is constructed with the sandbox dependency, not a zero-value or partially initialized Manager
- If sandbox execution is intentionally unavailable, surface capability to the model instead of calling execute_skill_script
Example fix
// before
mgr, _ := skills.NewManager(cfg) // sandboxMgr nil when sandbox disabled
mgr.ExecuteScript(ctx, "pdf", "scripts/run.py", nil, "")
// after
cfg.SandboxManager = sandboxMgr // ensure sandbox is wired in
mgr, _ := skills.NewManager(cfg)
if err := mgr.ExecuteScript(ctx, "pdf", "scripts/run.py", nil, ""); err != nil {
log.Fatal(err)
} Defensive patterns
Strategy: try-catch
Validate before calling
if mgr == nil || mgr.SandboxMgrMissing() { // or check capability before executing
return fmt.Errorf("sandbox execution unavailable")
} Type guard
func sandboxReady(m *skills.Manager) bool {
return m != nil && m.SandboxManager() != nil
} Try / catch
cfg, err := mgr.ExecuteScript(ctx, skill, path, args, stdin)
if err != nil {
if strings.Contains(err.Error(), "sandbox is not configured") {
// degrade: report capability unavailable, fall back to shell_exec
return nil, errSandboxUnavailable
}
return err
} Prevention
- Always construct the skills manager with an initialized sandbox manager
- Add a startup health check that fails fast if skills are enabled but the sandbox is nil
- Gate tool registration on sandbox availability so execute_skill_script is only exposed when usable
- Cover the nil-sandbox path in unit tests
When it happens
Trigger: Calling Manager.ExecuteScript on a manager built via NewManager (or config path) that never received/wired a sandbox.Manager — e.g. skills enabled in config but sandbox subsystem disabled or failed to initialize.
Common situations: Deployments with skills enabled but sandbox execution disabled; partial startup where sandbox init failed silently; tests constructing a manager without a sandbox; running in a mode (e.g. no-Docker host) that leaves sandboxMgr nil.
Related errors
- invalid sandbox type
- timeout cannot be negative
- memory limit cannot be negative
- CPU limit cannot be negative
- WEKNORA_REDIS_NAMESPACE must not contain braces
AI-assisted analysis of Tencent/WeKnora@988cbb0330 (2026-09-02).
Data as JSON: /api/errors/a205de5061510b22.
Report an issue: GitHub.