fix: remove redundant per-message directive hints from envelope (#415)
This commit is contained in:
@@ -181,20 +181,11 @@ describe('formatMessageEnvelope', () => {
|
||||
expect(result).toContain('**Mentioned**: yes');
|
||||
});
|
||||
|
||||
it('includes directives hint for group chats', () => {
|
||||
const msg = createMessage({ isGroup: true });
|
||||
const result = formatMessageEnvelope(msg);
|
||||
expect(result).toContain('Response Directives');
|
||||
expect(result).toContain('<no-reply/>');
|
||||
expect(result).toContain('<actions>');
|
||||
});
|
||||
|
||||
it('includes directives hint for DMs', () => {
|
||||
const msg = createMessage({ isGroup: false });
|
||||
const result = formatMessageEnvelope(msg);
|
||||
expect(result).toContain('Response Directives');
|
||||
expect(result).toContain('<no-reply/>');
|
||||
expect(result).toContain('<actions>');
|
||||
it('does not include per-message directive hints (covered by system prompt)', () => {
|
||||
const groupMsg = createMessage({ isGroup: true });
|
||||
const dmMsg = createMessage({ isGroup: false });
|
||||
expect(formatMessageEnvelope(groupMsg)).not.toContain('Response Directives');
|
||||
expect(formatMessageEnvelope(dmMsg)).not.toContain('Response Directives');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -256,7 +256,7 @@ function buildChatContextLines(msg: InboundMessage, options: EnvelopeOptions): s
|
||||
if (msg.wasMentioned) {
|
||||
lines.push(`- **Mentioned**: yes`);
|
||||
}
|
||||
lines.push(`- **Hint**: See Response Directives below for \`<no-reply/>\` and \`<actions>\``);
|
||||
lines.push(`- **Hint**: Use \`<no-reply/>\` to skip replying, \`<actions>\` for reactions/voice`);
|
||||
} else {
|
||||
lines.push(`- **Type**: Direct message`);
|
||||
}
|
||||
@@ -351,15 +351,6 @@ export function formatMessageEnvelope(
|
||||
sections.push(`## Chat Context\n${contextLines.join('\n')}`);
|
||||
}
|
||||
|
||||
// Response directives hint
|
||||
const directiveLines = [
|
||||
`- To skip replying: \`<no-reply/>\``,
|
||||
`- To perform actions: wrap in \`<actions>\` at the start of your response`,
|
||||
` Example: \`<actions><react emoji="thumbsup" /></actions>Your text here\``,
|
||||
`- To send a voice memo: \`<actions><voice>Your message here</voice></actions>\``,
|
||||
];
|
||||
sections.push(`## Response Directives\n${directiveLines.join('\n')}`);
|
||||
|
||||
// Build the full system-reminder block
|
||||
const reminderContent = sections.join('\n\n');
|
||||
const reminder = `${SYSTEM_REMINDER_OPEN}\n${reminderContent}\n${SYSTEM_REMINDER_CLOSE}`;
|
||||
|
||||
Reference in New Issue
Block a user