fix: enforce security profile language across DAVE
This commit is contained in:
@@ -131,6 +131,30 @@ test('repeated tool calls during finalization fail closed without leaking protoc
|
||||
assert.equal(result.notify, false);
|
||||
});
|
||||
|
||||
test('agent propagates preferred German language through tool and finalization prompts', async () => {
|
||||
const prompts = [];
|
||||
let call = 0;
|
||||
const agent = new TerminalAgent({
|
||||
provider: {
|
||||
isConfigured: true,
|
||||
async complete(systemPrompt) {
|
||||
prompts.push(systemPrompt);
|
||||
call++;
|
||||
return call === 1
|
||||
? { text: JSON.stringify({ type: 'tool_call', tool: 'get_status', arguments: {}, rationale: 'Status prüfen' }) }
|
||||
: { text: JSON.stringify({ type: 'final', answer: 'Die Systemlage ist stabil.', confidence: 'high', evidence: [], notify: false, priority: 'routine' }) };
|
||||
},
|
||||
},
|
||||
registry: new TerminalToolRegistry([{ name: 'get_status', handler: async () => ({ status: 'healthy' }) }]),
|
||||
maxSteps: 1,
|
||||
});
|
||||
|
||||
const result = await agent.run('Lage?', { preferredLanguage: 'de' });
|
||||
assert.equal(result.answer, 'Die Systemlage ist stabil.');
|
||||
assert.match(prompts[0], /REQUIRED RESPONSE LANGUAGE: German \(de\)/);
|
||||
assert.match(prompts[1], /REQUIRED RESPONSE LANGUAGE: German \(de\)/);
|
||||
});
|
||||
|
||||
test('scheduled presence cannot create pending mutating actions', async () => {
|
||||
let executions = 0;
|
||||
const agent = new TerminalAgent({
|
||||
|
||||
Reference in New Issue
Block a user