Skip to content

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
FishBottle7:masterfrom
tinytinycn:fix/responses-models
Open

tinytinycn wants to merge 1 commit into
FishBottle7:masterfrom
tinytinycn:fix/responses-models

Conversation

@tinytinycn

Copy link
Copy Markdown

Summary of Changes

  1. Route Responses-only models (muse-spark-*):

    • Route muse-spark-* models to pi-ai's openai-responses (/v1/responses) API instead of /chat/completions (which returns bare 500 errors upstream).
    • Fix toPiAssistant to assign api: 'openai-responses' for muse-spark-* so that conversation history is correctly reconstructed.
  2. Watchdog Timeout:

    • Extend stream idle watchdog to 300s (RESPONSES_BODY_IDLE_MS = 300_000) for responses-only models to tolerate bursty reasoning periods.
  3. Fix 400 parameter errors for reasoning effort:

    • Upstream /v1/responses rejects root-level reasoning_effort with [invalid_request_error] unknown parameter reasoning_effort. For responses models, root reasoning_effort is deleted and formatted into reasoning: { effort: ... }.
    • Upstream muse-spark rejects reasoning_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 to minimal.
  4. Tests & Build:

    • Added comprehensive unit tests in zen-adapter.test.ts covering routing, watchdog timeouts, and effort payload transformations.
    • Bumped version to 0.3.4 and updated CHANGELOG.md.

…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.
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