Tencent/WeKnora · error

file is not an executable script: %s

Error message

file is not an executable script: %s

What it means

For preloaded (non-image) skills, after successfully loading the file the manager checks SkillFile.IsScript; a file that exists but is not an executable script (wrong extension, e.g. .md, .txt, .json) is rejected. The interpreter/executor can only be chosen for recognized script extensions.

Source

Thrown at internal/agent/skills/manager.go:452

	skillName, scriptPath, basePath string,
	args []string,
	stdin string,
	env map[string]string,
	sessionID string,
) (*sandbox.ExecuteConfig, error) {
	if workspace, ok := sandbox.RunnableWorkspaceScript(scriptPath); ok {
		return workspaceSkillExecuteConfig(source, skillName, workspace, basePath, args, stdin, env, sessionID)
	}

	image, installed := source.(imageSkillSource)
	if !installed {
		// Load the script file to verify it exists and is a script
		file, err := source.LoadSkillFile(skillName, scriptPath)
		if err != nil {
			return nil, fmt.Errorf("failed to load script: %w", err)
		}
		if !file.IsScript {
			return nil, fmt.Errorf("file is not an executable script: %s", scriptPath)
		}
		return &sandbox.ExecuteConfig{
			Script:    file.Path,
			Args:      args,
			WorkDir:   basePath,
			Stdin:     stdin,
			Env:       env,
			SessionID: sessionID,
		}, nil
	}

	// The archive is deliberately not consulted: the image is what executes,
	// and a skill whose archive failed to store is still installed and
	// runnable. That leaves the extension as the only check available here,
	// which is also the one the executor's interpreter choice depends on.
	if !IsScript(scriptPath) {
		return nil, fmt.Errorf("file is not an executable script: %s", scriptPath)
	}

View on GitHub (pinned to 988cbb0330)

Solutions

  1. Pass a path to a file with a supported executable extension (.py, .sh, etc.)
  2. Use the file-reading tool for documentation/data files instead of execute_skill_script
  3. Rename/convert the file to a supported script type inside the skill, or add the extension if it was stripped
  4. Check IsScript/extension rules in the skills package to confirm supported types

Example fix

// before
mgr.ExecuteScript(ctx, "pdf", "docs/README.md", nil, "")
// after
mgr.ExecuteScript(ctx, "pdf", "scripts/extract.py", nil, "")
Defensive patterns

Strategy: validation

Validate before calling

if !skills.IsScript(scriptPath) {
    return fmt.Errorf("refusing to execute non-script %s", scriptPath)
}

Type guard

func isExecutableScript(path string) bool { return skills.IsScript(path) }

Try / catch

_, err := mgr.ExecuteScript(ctx, skill, path, args, stdin)
if err != nil && strings.Contains(err.Error(), "file is not an executable script") {
    // read the file with the file tool instead of executing
}
return err

Prevention

When it happens

Trigger: Manager.ExecuteScript on a preloaded skill with a skill-relative path that resolves to a data/doc file rather than a .py/.sh/etc. script — e.g. passing 'README.md' or a config JSON as scriptPath.

Common situations: The model or caller points execute_skill_script at a documentation or data file inside the skill; skill author shipped a script with an unsupported extension; confusion between reading a file (load_skill_file) and executing it.

Related errors


AI-assisted analysis of Tencent/WeKnora@988cbb0330 (2026-09-02). Data as JSON: /api/errors/e6a69ca67ccefa84. Report an issue: GitHub.