fix: route GitLab Duo Workflow system prompt via flowConfig#18928
Conversation
Send the system prompt to DWS workflow models via the SDK's systemPrompt setter instead of prepending system messages to the prompt array. This uses flowConfig.prompts[].prompt_template.system to override DWS's default system prompt, fixing the identity conflict where the model identifies as 'GitLab Duo' instead of 'OpenCode'. Plan mode reminders injected as <system-reminder> tags in user messages are automatically stripped from the DWS goal and routed to additional_context by gitlab-ai-provider 5.3.2. Closes anomalyco#18841
|
The following comment was made by an LLM, it may be inaccurate: I found a related PR: Related PR:
Why it might be related: PR #18884 appears to be addressing the same issue with routing GitLab Duo Workflow prompts via flowConfig. This could be an earlier attempt at the same fix or an overlapping solution. The current PR (#18928) may be a refinement or alternative approach to the same problem (system prompt routing for DWS workflow models). |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
|
Hi @vglafirov do you have any issues with the additional_context if you switch from plan to build to plan and then to build again? I think system reminders are persisted during the entire workflow and it confuse the LLM. This issue was replicated here #18884 (comment) |
It works with changing agents. I've tested: plan->build->plan->build->plan flow by asking to add and remove myself from CODEOWNERS file. It worked as expected. |
Nice thank you! |
Issue for this PR
Closes #18841
Type of change
What does this PR do?
DWS workflow models receive conflicting system prompts because OpenCode sends its system prompt as
{ role: "system" }messages while DWS injects its own server-side — DWS wins, so the model identifies as "GitLab Duo". Additionally, plan mode<system-reminder>tags injected into user messages become part of the DWS goal, polluting the conversation.gitlab-ai-provider5.3.2 added asystemPromptsetter onGitLabWorkflowLanguageModelthat sends the prompt viaflowConfig.prompts[].prompt_template.system, which properly overrides the DWS default. It also strips<system-reminder>tags from the goal and routes them toadditional_context.This PR bumps the SDK to 5.3.2 and wires it up in
llm.ts:workflowModel.systemPromptbefore each stream (alongsidetoolExecutor)flowConfignow)This is ~4 lines of change vs the 400+ line approach in #18884, because the heavy lifting is in the SDK.
How did you verify your code works?
bun run typecheck— clean across all 13 workspace packagesbun test test/provider/gitlab-duo.test.ts— 13 tests passbun test test/session/llm.test.ts— 11 tests passduo-workflow-*models confirming correct identity and clean goalsScreenshots / recordings
Not a UI change.
Checklist