Skip to content

Commit 91fbdfa

Browse files
committed
Update system prompt construction
1 parent 18a1318 commit 91fbdfa

File tree

1 file changed

+6
-6
lines changed
  • packages/opencode/src/session

1 file changed

+6
-6
lines changed

packages/opencode/src/session/llm.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ export namespace LLM {
7272
system.push(
7373
[
7474
// use agent prompt otherwise provider prompt
75-
...(input.agent.prompt ? [input.agent.prompt] : SystemPrompt.provider(input.model)),
75+
...(input.agent.prompt ? [input.agent.prompt] : (input.user.system && input.agent.name !== "title" ? [input.user.system] : SystemPrompt.provider(input.model))),
7676
// any custom prompt passed into this call
7777
...input.system,
7878
// any custom prompt from last user message
79-
...(input.user.system ? [input.user.system] : []),
79+
...((input.agent.prompt && input.user.system) ? [input.user.system] : []),
8080
]
8181
.filter((x) => x)
8282
.join("\n"),
@@ -100,10 +100,10 @@ export namespace LLM {
100100
const base = input.small
101101
? ProviderTransform.smallOptions(input.model)
102102
: ProviderTransform.options({
103-
model: input.model,
104-
sessionID: input.sessionID,
105-
providerOptions: provider.options,
106-
})
103+
model: input.model,
104+
sessionID: input.sessionID,
105+
providerOptions: provider.options,
106+
})
107107
const options: Record<string, any> = pipe(
108108
base,
109109
mergeDeep(input.model.options),

0 commit comments

Comments
 (0)