Repository navigation
Fixed OpenAI-compatible models with strict chat templates failing with "System message must be at the beginning" - #201
Conversation
…h "System message must be at the beginning" Mid-conversation system messages (Claude Code >= 2.1.288) were forwarded in place as role:system. They are now merged into the leading system message, or turned into <system-reminder> user text later in the conversation. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1230718e64
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Mid-conversation system text after a multipart (image) user turn is now added as a text part of that turn instead of a second consecutive user message. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1a814a3bcb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A mid-conversation system message that precedes the first user turn (explicit cache breakpoint case) is now folded into that user turn instead of producing two consecutive user messages. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 44a8818440
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A reminder created between an assistant tool_use and its tool_result turn is now placed after the tool messages so the call/result pair stays adjacent. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (last != null && "user".equals(last.path("role").asText()) && last.path("content").isTextual()) { | ||
| ((ObjectNode) last).put("content", last.path("content").asText() + "\n\n" + reminder); | ||
| return null; |
There was a problem hiding this comment.
Coalesce the next user after appending a reminder
When an in-band system message separates two textual user entries (user A, system S, user B), this branch appends S to A but leaves pendingReminder unset; processing B then adds another user message. The translator consequently emits user,user, which strict chat templates that require user/assistant alternation reject even though the non-leading system role has been removed; coalesce B into the same turn as well.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in c1f199d: a user turn following a user message that received a reminder (user A, system S, user B) is now coalesced into that message (text+text concatenated, or merged into a multipart content array), so no two user messages are adjacent. Added tests for both the text and the image case.
🤖 Generated with Claude Code
A user turn that follows a user message which received a mid-conversation system text is now coalesced into it, so no two user messages are adjacent. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Adds the `# 1.3` release heading to line 1 of CHANGELOG.md for the unreleased fix of OpenAI-compatible models with strict chat templates (#201). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Oleg Samarin <osamarin@openintegration.inc> Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude Code >= 2.1.288 sends mid-conversation
role:"system"messages; the Chat Completions translator forwarded them in place (system, user, system), which vLLM chat templates reject with HTTP 400. They are now merged into the leading system message, or become<system-reminder>text in a user message later in the conversation. The Codex translator is unchanged.🤖 Generated with Claude Code