fix(opencode): merge system prompts for non-anthropic providers#23656
Closed
zhangdw156 wants to merge 1 commit into
Closed
fix(opencode): merge system prompts for non-anthropic providers#23656zhangdw156 wants to merge 1 commit into
zhangdw156 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #15059
Type of change
What does this PR do?
It collapses plugin-added system prompts into a single system message for non-OpenAI-OAuth, non-workflow requests.
That keeps the existing Anthropic-compatible/messages behavior untouched, but avoids vLLM-served Qwen models failing with
System message must be at the beginning.when plugins append extra system context.It also adds a regression test covering
experimental.chat.system.transformwith an Alibaba/Qwen fixture.Related: #16560, #20785, previous attempts #15018 and #16981.
How did you verify your code works?
~/.bun/bin/bun test packages/opencode/test/session/llm.test.tsPATH=$HOME/.bun/bin:$PATH ~/.bun/bin/bun turbo typecheck --filter=opencodeScreenshots / recordings
n/a
Checklist