From 5daf2fa7f028f21ba79fd36ec2eb8b0603032673 Mon Sep 17 00:00:00 2001 From: Aaron Zhu <139607425+aaron-he-zhu@users.noreply.github.com> Date: Thu, 2 Apr 2026 10:44:16 +0800 Subject: [PATCH] fix(session): compaction agent responds in same language as conversation (#20581) Co-authored-by: Aaron Zhu --- packages/opencode/src/agent/prompt/compaction.txt | 1 + packages/opencode/src/session/compaction.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/opencode/src/agent/prompt/compaction.txt b/packages/opencode/src/agent/prompt/compaction.txt index 3308627e15..11deccb3af 100644 --- a/packages/opencode/src/agent/prompt/compaction.txt +++ b/packages/opencode/src/agent/prompt/compaction.txt @@ -12,3 +12,4 @@ Focus on information that would be helpful for continuing the conversation, incl Your summary should be comprehensive enough to provide context but concise enough to be quickly understood. Do not respond to any questions in the conversation, only output the summary. +Respond in the same language the user used in the conversation. diff --git a/packages/opencode/src/session/compaction.ts b/packages/opencode/src/session/compaction.ts index e48b1c7b08..3158393f11 100644 --- a/packages/opencode/src/session/compaction.ts +++ b/packages/opencode/src/session/compaction.ts @@ -190,6 +190,7 @@ export namespace SessionCompaction { Focus on information that would be helpful for continuing the conversation, including what we did, what we're doing, which files we're working on, and what we're going to do next. The summary that you construct will be used so that another agent can read it and continue the work. Do not call any tools. Respond only with the summary text. +Respond in the same language as the user's messages in the conversation. When constructing the summary, try to stick to this template: ---