Tencent/WeKnora · error

file_path must be relative inside the skill (e.g. scripts/ge

Error message

file_path must be relative inside the skill (e.g. scripts/generate_ppt.py), not %s

What it means

Skill-file path format guard: the absolute file_path does not belong to the current skill's directory and is not a recognized skill image path, so it cannot be converted to a skill-relative path; the helper requires paths relative to the skill root (e.g. scripts/generate_ppt.py) and rejects outside/absolute paths.

Source

Thrown at internal/agent/tools/skill_read.go:266

	}
	clean := path.Clean(trimmed)
	if path.IsAbs(trimmed) {
		dir, err := sandbox.SkillDirFor(skillName)
		if err == nil {
			if clean == dir {
				return "", nil
			}
			if strings.HasPrefix(clean, dir+"/") {
				return strings.TrimPrefix(clean, dir+"/"), nil
			}
		}
		if other, inImage := sandbox.SkillNameFromImagePath(clean); inImage && other != "" && other != skillName {
			return "", fmt.Errorf(
				"file_path belongs to skill %q; call read_skill(skill_name=%q, file_path=...)",
				other, other,
			)
		}
		return "", fmt.Errorf(
			"file_path must be relative inside the skill (e.g. scripts/generate_ppt.py), not %s",
			filePath,
		)
	}
	prefix := skillName + "/"
	if strings.HasPrefix(clean, prefix) {
		return strings.TrimPrefix(clean, prefix), nil
	}
	return clean, nil
}

// Cleanup releases any resources (implements Tool interface if needed)
func (t *ReadSkillTool) Cleanup(ctx context.Context) error {
	return nil
}

View on GitHub (pinned to 988cbb0330)

Solutions

  1. Pass a path relative to the skill root such as scripts/generate_ppt.py
  2. Remove leading slashes or workspace prefixes from file_path
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at internal/agent/tools/skill_read.go:266 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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