Skip to content

fix(handlers): declare missing systemPrompt/clientModelId params + stream passthrough fixes - #84

Open
mahdiwafy wants to merge 1 commit into
Vanszs:mainfrom
mahdiwafy:fix/pr61-signatures
Open

fix(handlers): declare missing systemPrompt/clientModelId params + stream passthrough fixes#84
mahdiwafy wants to merge 1 commit into
Vanszs:mainfrom
mahdiwafy:fix/pr61-signatures

Conversation

@mahdiwafy

Copy link
Copy Markdown

What

Fixes build-breaking lint errors from PR #61 (no-undef: systemPrompt and clientModelId are used but never declared in destructured params) plus two runtime bugs found while testing custom provider nodes.

Changes

  1. open-sse/handlers/chatCore.js — add systemPrompt + clientModelId to handleChatCore destructured params (PR feat:/fix: #61 passes them from chat.js but they were never declared → no-undef lint failure at build)
  2. open-sse/handlers/chatCore/nonStreamingHandler.js — declare clientModelId in handleNonStreamingResponse signature
  3. open-sse/handlers/chatCore/streamingHandler.js — declare clientModelId in handleStreamingResponse signature
  4. open-sse/utils/stream.js — strip empty legacy function_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 terminator
  5. src/app/api/providers/[id]/test-models/route.js — resolve alias from provider node prefix field instead of raw UUID providerId (fixes 404 "model not found" for all custom openai-compatible-chat nodes)

Verified

  • npm run build passes (no-undef lint clean)
  • st/deepseek-v4-flash streaming: exactly 1 [DONE], 0 empty function_call
  • /api/providers/[id]/test-models for node with prefix st: 4 models OK (was 100% 404)

… 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant