mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-06 06:41:56 +00:00
feat(cli): add skill_lookup MCP for non-native agents (#1035)
* test: reproduce issue #752 * fix: expose skill lookup MCP tool (closes #752) * test: cover ACP skill lookup instructions * fix: inject ACP skill lookup instruction * test: narrow skill lookup auto-approval * fix: restrict skill lookup auto-approval * test: cover exact skill lookup tool names
This commit is contained in:
@@ -178,6 +178,19 @@ describe('opencodeRemoteLauncher inline model switch', () => {
|
||||
harness.thoughtLevelOption = null;
|
||||
});
|
||||
|
||||
it('injects the skill lookup instruction only on the first prompt', async () => {
|
||||
const { session } = createSessionStub([
|
||||
{ message: 'first', mode: createMode() },
|
||||
{ message: 'second', mode: createMode() }
|
||||
]);
|
||||
|
||||
await opencodeRemoteLauncher(session as never);
|
||||
|
||||
expect(JSON.stringify(harness.promptContents[0])).toContain('$name');
|
||||
expect(JSON.stringify(harness.promptContents[0])).toContain('skill_lookup');
|
||||
expect(JSON.stringify(harness.promptContents[1])).not.toContain('skill_lookup');
|
||||
});
|
||||
|
||||
it('calls setModel with opencode flavor between turns when the queued model differs', async () => {
|
||||
const { session } = createSessionStub([
|
||||
{ message: 'first', mode: createMode('ollama/exaone:4.5-33b-q8') },
|
||||
|
||||
Reference in New Issue
Block a user