惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 三生石上(FineUI控件)
博客园 - 叶小钗
博客园 - 聂微东
博客园 - 司徒正美
Hugging Face - Blog
Hugging Face - Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Google DeepMind News
Google DeepMind News
Recent Announcements
Recent Announcements
IT之家
IT之家
J
Java Code Geeks
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
I
InfoQ
爱范儿
爱范儿
Vercel News
Vercel News
Apple Machine Learning Research
Apple Machine Learning Research
阮一峰的网络日志
阮一峰的网络日志
博客园 - Franky
U
Unit 42
酷 壳 – CoolShell
酷 壳 – CoolShell
腾讯CDC
F
Fortinet All Blogs
V
Visual Studio Blog
人人都是产品经理
人人都是产品经理

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(ui): add agent selector to skills page (#93487) · ope...
goutamadwant · 2026-06-16 · via Recent Commits to openclaw:main

@@ -4,8 +4,11 @@ import { beforeEach, describe, expect, it, vi } from "vitest";

44

import { callGatewayHandler } from "./skills.test-helpers.js";

5566

const loadConfigMock = vi.fn(() => ({}));

7+

const listAgentIdsMock = vi.fn<(_cfg: unknown) => string[]>(() => ["main"]);

78

const resolveDefaultAgentIdMock = vi.fn(() => "main");

8-

const resolveAgentWorkspaceDirMock = vi.fn(() => "/tmp/workspace");

9+

const resolveAgentWorkspaceDirMock = vi.fn<(_cfg: unknown, _agentId: string) => string>(

10+

() => "/tmp/workspace",

11+

);

912

const buildWorkspaceSkillStatusMock = vi.fn();

1013

const readLocalSkillCardContentSyncMock = vi.fn();

1114

const fetchClawHubSkillSecurityVerdictsMock = vi.fn();

@@ -19,10 +22,11 @@ vi.mock("../../config/config.js", () => ({

1922

}));

20232124

vi.mock("../../agents/agent-scope.js", () => ({

22-

listAgentIds: vi.fn(() => ["main"]),

25+

listAgentIds: (cfg: unknown) => listAgentIdsMock(cfg),

2326

resolveAgentConfig: vi.fn(() => undefined),

2427

resolveDefaultAgentId: () => resolveDefaultAgentIdMock(),

25-

resolveAgentWorkspaceDir: () => resolveAgentWorkspaceDirMock(),

28+

resolveAgentWorkspaceDir: (cfg: unknown, agentId: string) =>

29+

resolveAgentWorkspaceDirMock(cfg, agentId),

2630

resolveSessionAgentId: vi.fn(() => undefined),

2731

}));

2832

@@ -82,6 +86,7 @@ async function expectEmptySecurityVerdictsWithoutFetch(): Promise<void> {

8286

describe("skills gateway handlers (clawhub)", () => {

8387

beforeEach(() => {

8488

loadConfigMock.mockReset();

89+

listAgentIdsMock.mockReset();

8590

resolveDefaultAgentIdMock.mockReset();

8691

resolveAgentWorkspaceDirMock.mockReset();

8792

buildWorkspaceSkillStatusMock.mockReset();

@@ -92,6 +97,7 @@ describe("skills gateway handlers (clawhub)", () => {

9297

updateSkillsFromClawHubMock.mockReset();

93989499

loadConfigMock.mockReturnValue({});

100+

listAgentIdsMock.mockReturnValue(["main"]);

95101

resolveDefaultAgentIdMock.mockReturnValue("main");

96102

resolveAgentWorkspaceDirMock.mockReturnValue("/tmp/workspace");

97103

buildWorkspaceSkillStatusMock.mockReturnValue(emptySkillStatusReport());

@@ -101,6 +107,26 @@ describe("skills gateway handlers (clawhub)", () => {

101107

await expectEmptySecurityVerdictsWithoutFetch();

102108

});

103109110+

it("builds status with the selected agent filter", async () => {

111+

listAgentIdsMock.mockReturnValue(["main", "research"]);

112+

resolveAgentWorkspaceDirMock.mockImplementation((_cfg, agentId) =>

113+

agentId === "research" ? "/tmp/research-workspace" : "/tmp/workspace",

114+

);

115+116+

const { ok, error } = await callSkillsHandler("skills.status", { agentId: "research" });

117+118+

expect(ok).toBe(true);

119+

expect(error).toBeUndefined();

120+

expect(buildWorkspaceSkillStatusMock).toHaveBeenCalledWith(

121+

"/tmp/research-workspace",

122+

expect.objectContaining({

123+

agentId: "research",

124+

config: {},

125+

eligibility: expect.any(Object),

126+

}),

127+

);

128+

});

129+104130

it("fetches one bulk ClawHub verdict batch for linked installed skills", async () => {

105131

buildWorkspaceSkillStatusMock.mockReturnValue({

106132

workspaceDir: "/tmp/workspace",

@@ -262,6 +288,37 @@ describe("skills gateway handlers (clawhub)", () => {

262288

expect(result?.version).toBe("1.2.3");

263289

});

264290291+

it("routes explicit agent ClawHub installs through that agent workspace", async () => {

292+

listAgentIdsMock.mockReturnValue(["main", "research"]);

293+

resolveAgentWorkspaceDirMock.mockImplementation((_cfg, agentId) =>

294+

agentId === "research" ? "/tmp/research-workspace" : "/tmp/workspace",

295+

);

296+

installSkillFromClawHubMock.mockResolvedValue({

297+

ok: true,

298+

slug: "calendar",

299+

version: "1.2.3",

300+

targetDir: "/tmp/research-workspace/skills/calendar",

301+

});

302+303+

const { ok, error } = await callSkillsHandler("skills.install", {

304+

agentId: "research",

305+

source: "clawhub",

306+

slug: "calendar",

307+

version: "1.2.3",

308+

});

309+310+

expect(resolveAgentWorkspaceDirMock).toHaveBeenCalledWith({}, "research");

311+

expect(installSkillFromClawHubMock).toHaveBeenCalledWith({

312+

workspaceDir: "/tmp/research-workspace",

313+

slug: "calendar",

314+

version: "1.2.3",

315+

force: false,

316+

config: {},

317+

});

318+

expect(ok).toBe(true);

319+

expect(error).toBeUndefined();

320+

});

321+265322

it("accepts deprecated unsafe override without forwarding it to skill installs", async () => {

266323

installSkillMock.mockResolvedValue({

267324

ok: true,