Skip to content

fix(transformers): translate reasoning object to reasoning_effort for chat completions - #3

Closed
micookie2 wants to merge 1 commit into
mainfrom
fix/reasoning-effort-cross-format-783
Closed

micookie2 wants to merge 1 commit into
mainfrom
fix/reasoning-effort-cross-format-783

Conversation

@micookie2

Copy link
Copy Markdown
Owner

Summary

Fixes mcowger#783 (cross-posted for verification on fork).

When a Responses-API client (e.g. Claude Code) routes through Plexus to a Chat Completions provider, the nested reasoning: { effort, summary } object was forwarded verbatim onto the outbound Chat Completions payload. Chat Completions does not accept that nested object — it expects the top-level reasoning_effort string — so strict upstreams rejected the request with UNKNOWN_FIELD: reasoning.effort.

This PR translates the nested object to reasoning_effort on cross-format routes (responses -> chat). Same-format (chat -> chat) pass-through is left untouched.

Verification PR for upstream submission — do not merge here.

… chat completions

When a Responses-API client (e.g. Claude Code) routes through Plexus to a
Chat Completions provider, the nested `reasoning: { effort, summary }`
object was forwarded verbatim onto the outbound Chat Completions payload.
Chat Completions does not accept that nested object — it expects the
top-level `reasoning_effort` string — so strict upstreams rejected the
request with `UNKNOWN_FIELD: reasoning.effort`.

Translate the nested object to `reasoning_effort` on cross-format routes
(responses -> chat). Same-format (chat -> chat) pass-through is left
untouched: it starts from the client's originalBody, which already
preserves whatever reasoning shape the chat client sent.

Fixes mcowger#783

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Failed to generate code suggestions for PR

@micookie2

Copy link
Copy Markdown
Owner Author

Verification complete — CI passed (Typecheck + backend tests). Submitting upstream PR to mcowger/plexus.

@micookie2 micookie2 closed this Aug 3, 2026
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.

[BUG] UNKNOWN_FIELD error for reasoning.effort when using Claude Code with Plexus

1 participant