🧵 fix: Strip Unsupported Claude Assistant Prefill#186
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: de9147b9cd
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c0f7f42c83
ℹ️ 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! ℹ️ 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". |
Summary
I fixed Claude 4.6+ Anthropic dispatch so requests ending with assistant messages no longer fail on models that reject assistant prefill. This addresses the root cause behind danny-avila/LibreChat#13196.
Change Type
Testing
I validated the fix with targeted unit coverage, package build, and live Vertex AI checks against
claude-sonnet-4-6.Test Configuration:
regulated-dev-441020us-east5claude-sonnet-4-6gcloud auth application-default loginCommands and checks:
npm test -- --runTestsByPath src/llm/anthropic/llm.spec.ts --runInBand --modulePathIgnorePatterns='<rootDir>/.claude' -t 'Claude assistant prefill compatibility'npm run buildgit diff --checkThis model does not support assistant message prefill. The conversation must end with a user message.ChatAnthropicfailed with the same 400, patchedCustomAnthropicsucceeded with the same finalAIMessageinput.ChatAnthropicfailed with the same 400, patchedCustomAnthropicsucceeded with the same finalAIMessageinput.Checklist