fix(adapter): route muse-spark models to openai-responses and adapt reasoning parameters — 0.3.4 - #12
Open
tinytinycn wants to merge 1 commit into
Open
tinytinycn wants to merge 1 commit into
tinytinycn wants to merge 1 commit into
Conversation
…easoning parameters — 0.3.4 - Route muse-spark-* models to pi-ai's openai-responses (/v1/responses) endpoint instead of /chat/completions (which returned bare 500 errors). - Extend stream body idle watchdog from 120s to 300s (RESPONSES_BODY_IDLE_MS = 300_000) for responses-only models to accommodate bursty reasoning periods. - Adapt reasoning parameter format for /v1/responses: inject selected thinking level into reasoning.effort and strip root reasoning_effort (which triggered 400 unknown parameter 'reasoning_effort'). - Strip default reasoning.effort: 'none' for responses models to prevent 400 invalid_request_error since upstream muse-spark models do not support 'none'. - Update CHANGELOG.md and bump package version to 0.3.4.
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 of Changes
Route Responses-only models (
muse-spark-*):muse-spark-*models to pi-ai'sopenai-responses(/v1/responses) API instead of/chat/completions(which returns bare 500 errors upstream).toPiAssistantto assignapi: 'openai-responses'formuse-spark-*so that conversation history is correctly reconstructed.Watchdog Timeout:
RESPONSES_BODY_IDLE_MS = 300_000) for responses-only models to tolerate bursty reasoning periods.Fix 400 parameter errors for reasoning effort:
/v1/responsesrejects root-levelreasoning_effortwith[invalid_request_error] unknown parameter reasoning_effort. For responses models, rootreasoning_effortis deleted and formatted intoreasoning: { effort: ... }.muse-sparkrejectsreasoning_effort 'none'. When default thinking level is selected,reasoning.effort === 'none'is stripped from the payload rather than sent. If off/none is explicitly requested, it is safely clamped tominimal.Tests & Build:
zen-adapter.test.tscovering routing, watchdog timeouts, and effort payload transformations.0.3.4and updatedCHANGELOG.md.