Skip to content

Commit 88bcd04

Browse files
committed
tweak: tell the model what model it is in environment section of prompt
1 parent 077d17d commit 88bcd04

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/opencode/src/session/prompt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ export namespace SessionPrompt {
598598
agent,
599599
abort,
600600
sessionID,
601-
system: [...(await SystemPrompt.environment()), ...(await SystemPrompt.custom())],
601+
system: [...(await SystemPrompt.environment(model)), ...(await SystemPrompt.custom())],
602602
messages: [
603603
...MessageV2.toModelMessages(sessionMessages, model),
604604
...(isLastStep

packages/opencode/src/session/system.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,11 @@ export namespace SystemPrompt {
5252
return [PROMPT_ANTHROPIC_WITHOUT_TODO]
5353
}
5454

55-
export async function environment() {
55+
export async function environment(model: Provider.Model) {
5656
const project = Instance.project
5757
return [
5858
[
59+
`You are powered by the model named ${model.api.id}. The exact model ID is ${model.providerID}/${model.api.id}`,
5960
`Here is some useful information about the environment you are running in:`,
6061
`<env>`,
6162
` Working directory: ${Instance.directory}`,

0 commit comments

Comments
 (0)