fix(preset): align minimal agent with RL composition

This commit is contained in:
Yichen Jiang
2026-08-10 18:02:11 +08:00
parent d2321d210a
commit 86d5dd4384
48 changed files with 484 additions and 406 deletions
@@ -85,4 +85,21 @@ describe('the persona row', () => {
expect(renderPrompt(await ctx.systemPrompt.assemble({ scope: key })))
.toContain('You run on deepseek-v4-pro.')
})
it('makes a complete persona the exact prompt after every other contribution', async () => {
const ctx = await harness('deployment identity')
const key: ScopeKey = { agent: 'a1' }
const scope = createScope(ctx, key)
ctx.systemPrompt.section({ name: 'global:extra', order: 100, text: 'global guidance' })
await scope.ctx.plugin(Persona, { text: 'Only this.', complete: true })
scope.ctx.on('system-prompt/assemble', async (assembly, _context, next) => {
assembly.sections.push({ name: 'late:extra', text: 'late guidance' })
return next()
}, { prepend: true })
const assembly = await ctx.systemPrompt.assemble({ scope: key })
expect(assembly.sections).toEqual([{ name: PERSONA_SECTION, text: 'Only this.' }])
expect(renderPrompt(assembly)).toBe('Only this.')
})
})