{"record":{"id":"f1e49e1d9441a464","repo":"Tencent/WeKnora","slug":"file-path-must-be-relative-inside-the-skill-e-g","errorCode":null,"errorMessage":"file_path must be relative inside the skill (e.g. scripts/generate_ppt.py), not %s","messagePattern":"file_path must be relative inside the skill \\(e\\.g\\. scripts/generate_ppt\\.py\\), not (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/agent/tools/skill_read.go","lineNumber":266,"sourceCode":"\t}\n\tclean := path.Clean(trimmed)\n\tif path.IsAbs(trimmed) {\n\t\tdir, err := sandbox.SkillDirFor(skillName)\n\t\tif err == nil {\n\t\t\tif clean == dir {\n\t\t\t\treturn \"\", nil\n\t\t\t}\n\t\t\tif strings.HasPrefix(clean, dir+\"/\") {\n\t\t\t\treturn strings.TrimPrefix(clean, dir+\"/\"), nil\n\t\t\t}\n\t\t}\n\t\tif other, inImage := sandbox.SkillNameFromImagePath(clean); inImage && other != \"\" && other != skillName {\n\t\t\treturn \"\", fmt.Errorf(\n\t\t\t\t\"file_path belongs to skill %q; call read_skill(skill_name=%q, file_path=...)\",\n\t\t\t\tother, other,\n\t\t\t)\n\t\t}\n\t\treturn \"\", fmt.Errorf(\n\t\t\t\"file_path must be relative inside the skill (e.g. scripts/generate_ppt.py), not %s\",\n\t\t\tfilePath,\n\t\t)\n\t}\n\tprefix := skillName + \"/\"\n\tif strings.HasPrefix(clean, prefix) {\n\t\treturn strings.TrimPrefix(clean, prefix), nil\n\t}\n\treturn clean, nil\n}\n\n// Cleanup releases any resources (implements Tool interface if needed)\nfunc (t *ReadSkillTool) Cleanup(ctx context.Context) error {\n\treturn nil\n}\n","sourceCodeStart":248,"sourceCodeEnd":282,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/agent/tools/skill_read.go#L248-L282","documentation":"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.","triggerScenarios":"Thrown at internal/agent/tools/skill_read.go:266 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a path relative to the skill root such as scripts/generate_ppt.py","Remove leading slashes or workspace prefixes from file_path"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}