Skip to content

Commit 9330bc5

Browse files
authored
fix: route GitLab Duo Workflow system prompt via flowConfig (anomalyco#18928)
1 parent 1238d1f commit 9330bc5

3 files changed

Lines changed: 16 additions & 12 deletions

File tree

bun.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/opencode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
"drizzle-orm": "catalog:",
122122
"effect": "catalog:",
123123
"fuzzysort": "3.1.0",
124-
"gitlab-ai-provider": "5.3.1",
124+
"gitlab-ai-provider": "5.3.2",
125125
"glob": "13.0.5",
126126
"google-auth-library": "10.5.0",
127127
"gray-matter": "4.0.3",

packages/opencode/src/session/llm.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,20 @@ export namespace LLM {
113113
options.instructions = system.join("\n")
114114
}
115115

116+
const isWorkflow = language instanceof GitLabWorkflowLanguageModel
116117
const messages = isOpenaiOauth
117118
? input.messages
118-
: [
119-
...system.map(
120-
(x): ModelMessage => ({
121-
role: "system",
122-
content: x,
123-
}),
124-
),
125-
...input.messages,
126-
]
119+
: isWorkflow
120+
? input.messages
121+
: [
122+
...system.map(
123+
(x): ModelMessage => ({
124+
role: "system",
125+
content: x,
126+
}),
127+
),
128+
...input.messages,
129+
]
127130

128131
const params = await Plugin.trigger(
129132
"chat.params",
@@ -190,6 +193,7 @@ export namespace LLM {
190193
// and results sent back over the WebSocket.
191194
if (language instanceof GitLabWorkflowLanguageModel) {
192195
const workflowModel = language
196+
workflowModel.systemPrompt = system.join("\n")
193197
workflowModel.toolExecutor = async (toolName, argsJson, _requestID) => {
194198
const t = tools[toolName]
195199
if (!t || !t.execute) {

0 commit comments

Comments
 (0)