Fix reply language ignored when user writes Chinese.

Strengthen Host prompt injection with a per-step reply reminder, read live settings, and stop persona from forcing follow-user language.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-09-15 20:38:51 +08:00
parent d52c05e774
commit 91f2e9a5c8
7 changed files with 108 additions and 19 deletions

View file

@ -6,6 +6,7 @@ import {
normalizeReplyLanguage,
normalizeThinkingLanguage,
replyInstruction,
replyReminder,
resolveThinkingLanguage,
thinkingInstruction,
thinkingReminder,
@ -48,5 +49,12 @@ test('thinkingInstruction and reminder mention the target language', () => {
test('replyInstruction is empty for follow-user and forces otherwise', () => {
assert.equal(replyInstruction('follow-user'), '')
assert.match(replyInstruction('en'), /English/)
assert.match(replyInstruction('en'), /Do not switch to the user's language/)
assert.match(replyInstruction('zh'), /简体中文/)
})
test('replyReminder is empty for follow-user and reminds otherwise', () => {
assert.equal(replyReminder('follow-user'), '')
assert.match(replyReminder('en'), /Mandatory/)
assert.match(replyReminder('en'), /English/)
})