Skip to content

Commit fb1e435

Browse files
committed
fix(opencode): add language instruction to synthetic user messages
1 parent e7c4839 commit fb1e435

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

packages/opencode/src/session/message-v2.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,13 +239,13 @@ export const toModelMessagesEffect = Effect.fnUntraced(function* (
239239
if (part.type === "compaction") {
240240
userMessage.parts.push({
241241
type: "text",
242-
text: "What did we do so far?",
242+
text: "What did we do so far? Respond in the same language as the conversation.",
243243
})
244244
}
245245
if (part.type === "subtask") {
246246
userMessage.parts.push({
247247
type: "text",
248-
text: "The following tool was executed by the user",
248+
text: "The following tool was executed by the user. Continue in the same language as the conversation.",
249249
})
250250
}
251251
}

packages/opencode/src/session/prompt.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ export const layer = Layer.effect(
427427
messageID: summaryUserMsg.id,
428428
sessionID,
429429
type: "text",
430-
text: "Summarize the task tool output above and continue with your task.",
430+
text: "Summarize the task tool output above and continue with your task. Respond in the same language as the conversation.",
431431
synthetic: true,
432432
} satisfies SessionV1.TextPart)
433433
})
@@ -465,7 +465,7 @@ export const layer = Layer.effect(
465465
id: PartID.ascending(),
466466
messageID: userMsg.id,
467467
sessionID: input.sessionID,
468-
text: "The following tool was executed by the user",
468+
text: "The following tool was executed by the user. Continue in the same language as the conversation.",
469469
synthetic: true,
470470
}
471471
yield* sessions.updatePart(userPart)
@@ -1315,7 +1315,7 @@ export const layer = Layer.effect(
13151315
"The user sent the following message:",
13161316
p.text,
13171317
"",
1318-
"Please address this message and continue with your tasks.",
1318+
"Please address this message and continue with your tasks. Respond in the same language as the user's message.",
13191319
"</system-reminder>",
13201320
].join("\n")
13211321
}

0 commit comments

Comments
 (0)