test: cover project instruction configuration branches

This commit is contained in:
Yichen Jiang
2026-06-29 10:58:43 +08:00
parent 86519889c5
commit 2b99d8f5c2
5 changed files with 84 additions and 0 deletions

View File

@@ -46,6 +46,18 @@ describe('dsh-acp-agent composition', () => {
await ctx.fiber.dispose()
})
it('forwards explicit project-instruction controls to the bundled spine', async () => {
const ctx = await mount({
model: 'mock',
systemPrompt: 'hi',
persistenceRoot: '/tmp/dsh-acp-agent-project-instructions',
projectInstructions: false,
})
expect(ctx.get('agents')).toBeDefined()
expect(ctx.get('agentLoop')).toBeDefined()
await ctx.fiber.dispose()
})
it('exposes its plugin shape', () => {
expect(acpAgent.name).toBe('acp-agent')
expect(acpAgent.Config).toBeDefined()

View File

@@ -51,6 +51,17 @@ describe('dsh-stdio-agent app', () => {
await ctx.fiber.dispose()
})
it('forwards explicit project-instruction controls to the bundled spine', async () => {
const ctx = await mount({
model: 'mock',
systemPrompt: 'hi',
persistenceRoot: '/tmp/dsh-stdio-agent-spec-project-instructions',
projectInstructions: false,
})
expect(ctx.get('agents')?.get(AgentId('main'))).toBeDefined()
await ctx.fiber.dispose()
})
it('forwards resumeSessionId onto the pre-created agent when set', async () => {
// A resume id defers agent creation until persistence loads; with no backing
// session the resume is contained + logged, so no `main` agent registers —