Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

fix(check-resolvable): downgrade third-party OpenClaw workspace skills

garrytan6b74f7770f88
diff --git a/src/core/check-resolvable.ts b/src/core/check-resolvable.ts
index 4770182353..9bd414cbf0 100644
--- a/src/core/check-resolvable.ts
+++ b/src/core/check-resolvable.ts
@@ -395,12 +395,11 @@ export function checkResolvable(
else unreachable++;
}
- // `cwd_walk_up` (tier 1b of autoDetectSkillsDir) accepts ANY ancestor
- // `skills/` dir with no signal that it is a gbrain skillpack, so a foreign
- // tool's directory where one skill coincidentally ships `triggers:` would
- // otherwise score every sibling as a hard unreachable error. Downgrade to a
- // warning only when ALL hold: found via cwd_walk_up; no resolver file
- // contributes rows (RESOLVER.md is gbrain-native, so its mere presence stays
+ // `cwd_walk_up` (tier 1b of autoDetectSkillsDir) accepts ANY ancestor `skills/` dir
+ // with no gbrain signal, and an OpenClaw workspace's `skills/` (`openclaw_workspace_*`)
+ // holds skills other tools install, so a foreign skill would otherwise score as a hard
+ // unreachable error. Downgrade to a warning only when ALL hold: found via one of
+ // those; no resolver file contributes rows (RESOLVER.md is gbrain-native, so its mere presence stays
// strict, but a generic prose AGENTS.md with zero table rows is no signal);
// unreachable outnumber reachable (a mostly-migrated real skillpack that
// lost its resolver file still fails loudly); and no manifest.json on disk
@@ -416,7 +415,7 @@ export function checkResolvable(
// nosemgrep: javascript.lang.security.audit.path-traversal.path-join-resolve-traversal.path-join-resolve-traversal -- skillsDir is the caller-resolved local skills/ dir, never remote input
const manifestJsonAbsent = !existsSync(join(skillsDir, 'manifest.json'));
const lowConfidenceForeignDir =
- opts?.skillsDirSource === 'cwd_walk_up' &&
+ (opts?.skillsDirSource === 'cwd_walk_up' || !!opts?.skillsDirSource?.startsWith('openclaw_workspace_')) &&
(!resolverPathOrNull || foundOnlyEmptyAgentsMd) &&
unreachable > reachable &&
manifestJsonAbsent;
@@ -430,7 +429,7 @@ export function checkResolvable(
severity: lowConfidenceForeignDir ? 'warning' : 'error',
skill: skill.name,
message: lowConfidenceForeignDir
- ? `Skill '${skill.name}' is in manifest but has no trigger row in ${RESOLVER_FILENAMES_LABEL} (this skills/ dir was found by walking up from cwd with no resolver rows -- if it belongs to a different tool, this can be ignored)`
+ ? `Skill '${skill.name}' is in manifest but has no trigger row in ${RESOLVER_FILENAMES_LABEL} (this skills/ dir was auto-detected with no resolver rows -- if it belongs to a different tool, this can be ignored)`
: `Skill '${skill.name}' is in manifest but has no trigger row in ${RESOLVER_FILENAMES_LABEL}`,
action: `Add a trigger row for 'skills/${skill.path}' in RESOLVER.md under ${section}`,
fix: {
diff --git a/test/check-resolvable.test.ts b/test/check-resolvable.test.ts
index 859b63925e..c0b3e5c78f 100644
--- a/test/check-resolvable.test.ts
+++ b/test/check-resolvable.test.ts
@@ -697,6 +697,23 @@ describe("checkResolvable — low-confidence foreign skills dir", () => {
}
expect(report.errors.some(i => i.type === "unreachable")).toBe(true);
});
+
+ test("OpenClaw workspace discovery + prose AGENTS.md at the root + third-party skills: unreachable is a warning; a manifest.json keeps it an error", () => {
+ // An OpenClaw workspace's skills/ can hold only another tool's skills
+ // (OpenClaw loads them natively) under its default prose AGENTS.md.
+ dir = mkdtempSync(join(tmpdir(), "gbrain-openclaw-workspace-"));
+ writeFileSync(join(dir, "AGENTS.md"), "# AGENTS.md\n\nWorkspace instructions, no routing table.\n");
+ const skills = join(dir, "skills");
+ for (const name of ["third-party-one", "third-party-two", "third-party-three", "third-party-four"]) makeSkillWithoutTriggers(skills, name);
+ for (const source of ["openclaw_workspace_home_root", "openclaw_workspace_env_root", "openclaw_workspace_home", "openclaw_workspace_env"] as const) {
+ const report = checkResolvable(skills, { skillsDirSource: source });
+ expect(report.issues.filter(i => i.type === "unreachable").length).toBe(4);
+ expect(report.errors.some(i => i.type === "unreachable")).toBe(false);
+ }
+ writeFileSync(join(skills, "manifest.json"), JSON.stringify({ skills: ["third-party-one", "third-party-two", "third-party-three", "third-party-four"].map(name => ({ name, path: `${name}/SKILL.md` })) }));
+ const strict = checkResolvable(skills, { skillsDirSource: "openclaw_workspace_home_root" });
+ expect(strict.errors.some(i => i.type === "unreachable")).toBe(true);
+ });
});
describe("missing_file is reported once per skill path, not once per trigger row (wave review)", () => {