Repository navigation
fix(chat): skip null entries in tools and input in the session fingerprint and the Claude tool conversion - #17023
Merged
diegosouzapw merged 2 commits intoOct 18, 2026
Conversation
…print and the Claude tool conversion tools and input are z.array(z.unknown()) in the request schema. generateSessionId read t.name on every tools entry and msg.role on every messages/input entry, and the OpenAI to Claude conversion read tool.function, so a null entry threw a TypeError (messages: [null] has answered 400 since cheaper-inference#13755). Guard the three readers in sessionManager.ts and the tool map in openai-to-claude.ts; a null entry is ignored, as an entry without a name already is.
diegosouzapw
merged commit Oct 18, 2026
4c1472d
into
cheaper-inference:release/v3.8.52
42 of 60 checks passed
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
nullentry intools(or ininput/messageswhen the session fingerprint is computed) madegenerateSessionIdand the OpenAI→Claude tool conversion throw aTypeErrorinstead of ignoring the entry. Such entries are now skipped, as an entry without a name already is. A request withoutnullentries behaves as before.toolsandinputarez.array(z.unknown())in the request schema, so anullentry reaches these readers.generateSessionIdreadt.nameon everytoolsentry andmsg.roleon everymessages/inputentry, andopenaiToClaudeRequestreadtool.function, all without a guard.messages: [null]already answers 400 since fix(chat): reject null/non-object entries in messages[] (#12643) #13755.Related Issues
Target Branch
release/v3.8.xbranch (the highest openrelease/v*, hererelease/v3.8.52), notmainProof Of Fix (required)
tests/unit/null-entries-in-tools-and-input.test.ts(new, 3 cases: anullentry intoolsand ininput/messagesfor the session fingerprint, and anullentry intoolsfor the OpenAI→Claude conversion, which keeps the valid tool).release/v3.8.52with onlysessionManager.tsandopenai-to-claude.tsreverted):TypeErrorbecomes there.Scope
open-sse/services/sessionManager.ts,open-sse/translator/request/openai-to-claude.ts, the new test and a one-line changelog fragment.Validation
tests/unit/openai-to-claude*andsession*test file, run together with the new file: 739 of 739 pass.prettier --checkon the new test and the changelog fragment,check:ai-attribution --rangeandcheck:changelog-integritypass.eslintonopenai-to-claude.tsreports one unusedtoolNameMap; it is on the base and this change does not touch it.Reviewer Notes
changelog.d/fixes/PENDING-null-entries-in-tools-and-input.md, one line, left for you to rename.