Repository navigation
fix: avoid redundant Claude Code message clone - #2362
Merged
diegosouzapw merged 1 commit intoMay 18, 2026
Merged
diegosouzapw merged 1 commit into
diegosouzapw merged 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request modifies the prepareClaudeCodeCompatibleSemanticBody function in open-sse/services/claudeCodeCompatible.ts to stop cloning the messages array from the input object, opting instead to cast it directly. This change likely improves performance by avoiding an unnecessary deep clone operation during the preparation of the semantic body. I have no feedback to provide as there were no review comments to evaluate.
diegosouzapw
merged commit May 18, 2026
6c488d6
into
cheaper-inference:release/v3.8.0
3 checks passed
Collaborator
|
Thanks @terence71-glitch! Excellent optimization. Merged into the upcoming v3.8.0 release. |
HouMinXi
pushed a commit
to HouMinXi/OmniRoute
that referenced
this pull request
Aug 2, 2026
Integrated into release/v3.8.0
Poid-ZA
pushed a commit
to Poid-ZA/OmniRoute
that referenced
this pull request
Aug 5, 2026
Integrated into release/v3.8.0
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
Integrated into release/v3.8.0
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.
Summary
messagesduring Claude Code semantic passthrough preparation.Context
This fix is based on a code review suggestion from @gemini-code-assist[bot] in PR #2351
prepareClaudeCodeCompatibleSemanticBody()was deep-cloningclaudeBody.messages, andbuildClaudeCodeCompatibleRequest()then passed those messages throughcloneClaudeCodeCompatibleMessagesFromClaude(), which clones the message objects again.This removes the first clone because the final cloning step still protects the emitted request body.
Validation
node --import tsx/esm --test tests/unit/claude-code-compatible-request.test.ts— passed (10/10)git diff --check— passednode --import tsx/esm --test tests/integration/*.test.ts— still fails with the same pre-existing integration failures observed before the fix