fix: enforce security profile language across DAVE
All checks were successful
Codex Template Compliance / template-compliance (pull_request) Successful in 10s
Build / test-and-image (pull_request) Successful in 56s

This commit is contained in:
2026-07-06 09:14:55 +02:00
parent dce8c278a5
commit 73af4abfa2
9 changed files with 98 additions and 17 deletions

View File

@@ -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');