fix(handlers): declare missing systemPrompt/clientModelId params + stream passthrough fixes - #84
Open
mahdiwafy wants to merge 1 commit into
Open
fix(handlers): declare missing systemPrompt/clientModelId params + stream passthrough fixes#84mahdiwafy wants to merge 1 commit into
mahdiwafy wants to merge 1 commit into
Conversation
… passthrough fixes Cherry-picked from fork main: - handleChatCore: accept systemPrompt + clientModelId (PR Vanszs#61 references them but never declared them in the destructured params) - nonStreamingHandler/streamingHandler: declare clientModelId in signature - stream: strip empty legacy function_call deltas (client loops) + dedupe [DONE] in passthrough - test-models: resolve alias from provider node prefix
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.
What
Fixes build-breaking lint errors from PR #61 (no-undef:
systemPromptandclientModelIdare used but never declared in destructured params) plus two runtime bugs found while testing custom provider nodes.Changes
open-sse/handlers/chatCore.js— addsystemPrompt+clientModelIdtohandleChatCoredestructured params (PR feat:/fix: #61 passes them from chat.js but they were never declared →no-undeflint failure at build)open-sse/handlers/chatCore/nonStreamingHandler.js— declareclientModelIdinhandleNonStreamingResponsesignatureopen-sse/handlers/chatCore/streamingHandler.js— declareclientModelIdinhandleStreamingResponsesignatureopen-sse/utils/stream.js— strip empty legacyfunction_call: {name:"",arguments:""}deltas (some providers e.g. Shiteru send these on the final chunk → clients interpret as pending tool call → infinite loop); skip upstream[DONE]in passthrough so flush handler emits exactly one terminatorsrc/app/api/providers/[id]/test-models/route.js— resolve alias from provider nodeprefixfield instead of raw UUID providerId (fixes 404 "model not found" for all custom openai-compatible-chat nodes)Verified
npm run buildpasses (no-undef lint clean)st/deepseek-v4-flashstreaming: exactly 1[DONE], 0 emptyfunction_call/api/providers/[id]/test-modelsfor node with prefixst: 4 models OK (was 100% 404)