You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Agent keeps replying in English to a Korean-speaking user (drifts after compaction / tool-heavy turns) #11527
In a long Korean-language session the agent keeps replying to the user in English, although the user writes only in Korean and the system prompt says to answer in the user's language. The user has had to correct this repeatedly (2026-10-19, 2026-10-20, and again 2026-10-27, the last time angrily). A persistent memory note recording this exact failure ("reply in Korean when the user writes in Korean") was in the prompt and did not prevent it.
Environment
omo-ai 5.1.48 (senpi runtime), Windows 11, terminal: Orca
Model: claude-opus-5-5 (anthropic-subscription)
Long-running session with several context compactions, many background monitors/detached eval cells
What happens
Short Korean user messages ("아직이야? 얼마나 진행됐어", "20번은 화질이 넘 작던데") get whole replies in English: the routing line, status updates, and the final Ask/For you/Now/Next handoff.
Drift is worst in turns dominated by harness-injected English text: tool-result handoffs, monitor events, comment-checker hook messages, todo/handoff reminders, and the compaction checkpoint. The compaction summary even contained MUST_PRESERVE: Reply in Korean, yet later turns were English.
The routing-line template in the system prompt ("I read this as [intent] - [plan]. I'll stop when ...") is English, so the first sentence of a turn tends to be English and the rest follows it.
Expected
The reply language follows the user's language on every turn, including after compaction and after long tool-only stretches.
Suggestions
Detect the language of the latest user message and inject it as a short per-turn reminder (e.g. "Reply language: Korean") near the end of the context, where tool/system text cannot outweigh it.
Make the routing-line and handoff templates language-neutral or localized, so they do not seed English output.
Carry the user language as a structured field through compaction, not only as prose inside the summary.
Thanks for the detailed report, @miny6121-sys. The pattern you describe (short replies staying in Korean, then drifting to English after compactions and tool-heavy turns, even with a memory note in place) is very useful to have written down. We're looking into it and will follow up here.
Root cause and fix are up in code-yeongyu/senpi#4540 (senpi owns the context assembly; omo 5.1.48 ships it).
Root cause: after a compaction, the model context holds no user turn in the user's language and nothing that names that language. The compaction prompt (packages/coding-agent/src/core/extensions/builtin/compaction/prompts.ts:31-94) produces an English-template summary with no language field. convertToLlm (packages/coding-agent/src/core/messages.ts) then renders that summary and long English tool output as-is between the user's last Korean message and every reply. The only language rule is one sentence in the Handoff section of the system prompt (dynamic-prompt/handoff.ts:27, tracked separately in senpi#4107).
Fix: the session projection derives the user's (non-Latin) language from their own messages and carries it on the compaction summary. Each request then names that language after the summary and after any long English tool-output stretch (4000+ chars), at fixed positions so the provider cache prefix is unchanged.
RED (main + a stub module with the real signatures): 11 of 15 new tests fail on assertions; the decisive one is expected [] to have a length of 1 (no language signal in the compacted Korean context). GREEN on the PR: 15/15; root tsc --noEmit exit 0; the related suites (117 files) pass except one test that needs a built dist and fails identically on main.
Activity
code-yeongyu commentedon Oct 27, 2026
Thanks for the detailed report, @miny6121-sys. The pattern you describe (short replies staying in Korean, then drifting to English after compactions and tool-heavy turns, even with a memory note in place) is very useful to have written down. We're looking into it and will follow up here.
code-yeongyu commentedon Oct 27, 2026
Root cause and fix are up in code-yeongyu/senpi#4540 (senpi owns the context assembly; omo 5.1.48 ships it).
Root cause: after a compaction, the model context holds no user turn in the user's language and nothing that names that language. The compaction prompt (
packages/coding-agent/src/core/extensions/builtin/compaction/prompts.ts:31-94) produces an English-template summary with no language field.convertToLlm(packages/coding-agent/src/core/messages.ts) then renders that summary and long English tool output as-is between the user's last Korean message and every reply. The only language rule is one sentence in the Handoff section of the system prompt (dynamic-prompt/handoff.ts:27, tracked separately in senpi#4107).Fix: the session projection derives the user's (non-Latin) language from their own messages and carries it on the compaction summary. Each request then names that language after the summary and after any long English tool-output stretch (4000+ chars), at fixed positions so the provider cache prefix is unchanged.
RED (main + a stub module with the real signatures): 11 of 15 new tests fail on assertions; the decisive one is
expected [] to have a length of 1(no language signal in the compacted Korean context). GREEN on the PR: 15/15; roottsc --noEmitexit 0; the related suites (117 files) pass except one test that needs a built dist and fails identically on main.Thanks again @miny6121-sys.