Skip to content

fix(claude): write non-stream reasoning to canonical reasoning_content - #5145

Closed
warelik wants to merge 1 commit into
router-for-me:devfrom
warelik:ao/airouters-12-fix-claude-openai-nonstream-reasoning
Closed

fix(claude): write non-stream reasoning to canonical reasoning_content#5145
warelik wants to merge 1 commit into
router-for-me:devfrom
warelik:ao/airouters-12-fix-claude-openai-nonstream-reasoning

Conversation

@warelik

@warelik warelik commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Stock port of kaitranntt/CLIProxyAPIPlus#193.

Ensures Claude → OpenAI non-stream conversion writes thinking output to
choices.0.message.reasoning_content instead of the legacy reasoning
field, matching the streaming path.

This change closes the stock side of the Plus fix and keeps the two
repos in sync.

Port of kaitranntt/CLIProxyAPIPlus#193 to stock.

Reasoning_content field is already used; this adds parity,
absence, and redacted_thinking coverage, and tightens the
existing reasoning test.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4b91f4e368

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

}
}

func TestConvertClaudeResponseToOpenAINonStream_OmitsReasoningContentWhenAbsent(t *testing.T) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Follow the standalone translator authorization gate

This commit modifies only internal/translator/, which repository policy prohibits unless the required gh repo view --json viewerPermission -q .viewerPermission check confirms WRITE, MAINTAIN, or ADMIN; in the inspected environment that command cannot authenticate, so authorization cannot be confirmed. Verify the permission under the submitting identity before landing this change, or follow the documented issue-only path.

AGENTS.md reference: AGENTS.md:L49-L50

Useful? React with 👍 / 👎.

@warelik

warelik commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

This PR touches internal/translator/ and therefore fails the translator-path-guard workflow, which blocks any PR in that path from a READ-only account. I have opened #5148 with the defect description, root cause file:line, and proposed patch. This PR is left open as a ready reference implementation for the maintenance team.

@warelik

warelik commented Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

Stock path-guard makes internal/translator PR unmergeable. Corresponding issue #5148 is now closed. Implementation remains retained upstream in Plus #193 and in warelik/mission-integration.

@warelik warelik closed this Aug 22, 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.

1 participant