Merge remote-tracking branch 'refs/remotes/upstream/main'
# Conflicts: # ROADMAP.md # TODO.md # src/cli.tsx # src/config.ts # src/mcp.ts # src/permission.ts # src/prompt.ts # src/session.ts # src/snapshot.ts # src/subagent.ts # src/tools-extra.ts # src/tools.ts # src/ui/App.tsx # test/mcp.test.ts # test/prune.test.ts # test/session.test.ts # test/tools.test.ts
This commit is contained in:
@@ -131,11 +131,23 @@ test('the skill catalogue and skill tool are offered when skills are loaded', as
|
||||
expect(system).toContain('Skills available');
|
||||
});
|
||||
|
||||
test('no skill tool is offered when there are no skills', async () => {
|
||||
test('a session with skills offers the skill tool; without skills it is absent', async () => {
|
||||
// With no skills the tool is omitted from the request (no dead tools). With
|
||||
// skills it is registered; hot-reload at the next turn boundary exposes
|
||||
// newly installed ones without a rebuild.
|
||||
const { seen, model } = recorder();
|
||||
const session = new Session({ model, askApproval: async () => 'deny', skills: [] });
|
||||
for await (const _ of session.send('hi')) void _;
|
||||
expect((seen[0]?.tools ?? []).map((t) => t.name)).not.toContain('skill');
|
||||
|
||||
const { seen: seen2, model: model2 } = recorder();
|
||||
const session2 = new Session({
|
||||
model: model2,
|
||||
askApproval: async () => 'deny',
|
||||
skills: [{ name: 'debug', description: 'find bugs', origin: 'registry', body: 'help' }],
|
||||
});
|
||||
for await (const _ of session2.send('hi')) void _;
|
||||
expect((seen2[0]?.tools ?? []).map((t) => t.name)).toContain('skill');
|
||||
});
|
||||
|
||||
test('the skill tool never needs approval', async () => {
|
||||
|
||||
Reference in New Issue
Block a user