fix: enforce security profile language across DAVE
This commit is contained in:
@@ -114,16 +114,18 @@ export class DavePresence {
|
||||
context: String(await this.getContext()).slice(0, 12000),
|
||||
runtime,
|
||||
mode: 'presence',
|
||||
preferredLanguage: profile.language,
|
||||
});
|
||||
if (result.pendingAction || !result.notify) {
|
||||
this._scheduleDynamic(now, runtime?.delta, false);
|
||||
return this._result(false, result.pendingAction ? 'mutation_rejected' : 'agent_declined');
|
||||
}
|
||||
|
||||
const german = profile.language === 'de';
|
||||
const evidence = result.evidence?.length
|
||||
? `\n\nEvidence:\n${result.evidence.slice(0, 4).map(item => `- ${item}`).join('\n')}`
|
||||
? `\n\n${german ? 'Belege' : 'Evidence'}:\n${result.evidence.slice(0, 4).map(item => `- ${item}`).join('\n')}`
|
||||
: '';
|
||||
const sent = await this.alerter.sendMessage(`[DAVE // ACTIVE]\n${result.answer}${evidence}`, { parseMode: null });
|
||||
const sent = await this.alerter.sendMessage(`[DAVE // ${german ? 'AKTIV' : 'ACTIVE'}]\n${result.answer}${evidence}`, { parseMode: null });
|
||||
if (!sent?.ok && sent !== true) {
|
||||
this._schedule(now, this.minIntervalMs);
|
||||
return this._result(false, 'send_failed');
|
||||
|
||||
Reference in New Issue
Block a user