Skip to content

Commit ee8ee83

Browse files
committed
test(agent-core): invoke the saved skill instead of only listing it
Asserting the Skill tool is present and the registry holds the skill does not exercise the lookup that activation performs. Call the tool with audit-routes and check it does not error, so a broken lookup fails the test that claims the skill is invocable.
1 parent 579e093 commit ee8ee83

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

packages/agent-core/test/session/init.test.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,10 +1259,16 @@ describe('AgentAPI.startBtw', () => {
12591259

12601260
// The tool reads the registry as it runs, so the reload is all it needs
12611261
// to reach a skill written after the session opened.
1262-
expect(main.tools.loopTools.map((tool) => tool.name)).toContain('Skill');
1263-
expect(
1264-
(await session.listSkills()).map((skill) => skill.name),
1265-
).toContain('audit-routes');
1262+
const skill = main.tools.loopTools.find((tool) => tool.name === 'Skill');
1263+
expect(skill).toBeDefined();
1264+
const result = await executeTool(skill!, {
1265+
turnId: '0',
1266+
toolCallId: 'call_skill',
1267+
args: { skill: 'audit-routes' },
1268+
signal: new AbortController().signal,
1269+
});
1270+
expect(result.isError).not.toBe(true);
1271+
expect(JSON.stringify(result.output)).toContain('audit-routes');
12661272
expect(setActiveTools).not.toHaveBeenCalled();
12671273
} finally {
12681274
await session.close();

0 commit comments

Comments
 (0)