Add per-subreddit R4R conversation modes

This commit is contained in:
jjbrunton committed 2026-08-09 11:30:32 +01:00
1 parent 23d4c3a320
commit 0f76bcf59a
14 files changed
+343 -24

No files matched your search

+7
View File
@@ -5,6 +5,7 @@ import {
formatConversationAsUntrustedData,
mergeConversationState,
isSafeConversationReply,
isSafeR4RReply,
parseConversationState,
remainingAutomationTurns,
type ConversationMessage,
@@ -71,6 +72,7 @@ describe('conversation state', () => {
}));
expect(state?.automation).toMatchObject({ turnsUsed: 0, status: 'active' });
expect(state?.automation).toMatchObject({ policyMode: 'legacy', policyVersion: 1, maxAutomatedTurns: 3 });
});
it('treats conversation content as untrusted data rather than instructions', () => {
@@ -99,4 +101,9 @@ describe('conversation state', () => {
expect(isSafeConversationReply('One. Two. Three. Four.')).toBe(false);
expect(isSafeConversationReply('That sounds fun, what did you have in mind?')).toBe(true);
});
it('rejects media solicitation from autonomous r4r replies', () => {
expect(isSafeR4RReply('Would you send me a nude?')).toBe(false);
expect(isSafeR4RReply('I love live music too. What was your last gig?')).toBe(true);
});
});