Skip to content

Commit 9c7656c

Browse files
committed
fix(skills): use remote-aware Gateway skills.status in CLI when available
Sweeper 🦞 #94956: the CLI skills subcommands (list, check, info) used a local-only status build that did not account for remote macOS node capabilities. Even after the parser fix (#71877) for system.which object-map payloads, CLI status reports still showed darwin+bins(memo) as missing on Linux gateways with connected macOS nodes. Now loadSkillsStatusReport tries the Gateway skills.status RPC (which already builds with getRemoteSkillEligibility) when config.gateway.remote.url is set, falling back to local-only buildWorkspaceSkillStatus when the Gateway is unreachable. Test results: - skills-cli.commands: 52/52 pass - skills/runtime/remote: 12/12 pass - gateway skills.proposals: 10/10 pass
1 parent 2b3a7c5 commit 9c7656c

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

src/cli/skills-cli.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,35 @@ async function loadSkillsStatusReport(
100100
): Promise<SkillStatusReport> {
101101
const { config, workspaceDir, agentId } = resolveSkillsWorkspace(options);
102102
const { buildWorkspaceSkillStatus } = await import("../skills/discovery/status.js");
103+
104+
// When a Gateway URL is configured (local or remote), prefer the remote-aware
105+
// skills.status RPC so that remote node capabilities (e.g. darwin + memo from
106+
// a connected macOS node for apple-notes) are reflected in skill eligibility.
107+
// Fall back to local-only status when the Gateway is unreachable.
108+
const gatewayUrl = config.gateway?.remote?.url;
109+
if (gatewayUrl) {
110+
try {
111+
const { callGatewayFromCli } = await import("./gateway-rpc.js");
112+
const result = await callGatewayFromCli(
113+
"skills.status",
114+
{ url: gatewayUrl, timeout: "5000" },
115+
{ agentId: agentId || undefined },
116+
{ clientName: "openclaw-cli" },
117+
);
118+
if (result && typeof result === "object" && (result as { ok?: boolean }).ok) {
119+
const skills = (result as { skills?: unknown[] }).skills;
120+
if (Array.isArray(skills)) {
121+
return {
122+
skills: skills as SkillStatusReport["skills"],
123+
workspaceDir,
124+
};
125+
}
126+
}
127+
} catch {
128+
// Gateway unreachable — fall through to local-only status.
129+
}
130+
}
131+
103132
return buildWorkspaceSkillStatus(workspaceDir, { config, agentId });
104133
}
105134

0 commit comments

Comments
 (0)