Skip to content

[codex] Split leading reasoning blocks#2

Merged
HisenWeb merged 4 commits into
mainfrom
codex/reasoning-content-split
Jun 24, 2026
Merged

[codex] Split leading reasoning blocks#2
HisenWeb merged 4 commits into
mainfrom
codex/reasoning-content-split

Conversation

@HisenWeb

Copy link
Copy Markdown
Owner

Summary

  • Added shared text helpers for leading reasoning blocks in Chat content.
  • Split non-streaming leading reasoning blocks into Responses reasoning plus visible message output.
  • Added a streaming leading-block detector so partial opening/closing tags do not leak reasoning into output_text.
  • Added regression tests for non-stream and streaming conversion behavior.

Why

Some OpenAI-compatible Chat upstreams may return reasoning embedded at the start of content rather than in explicit reasoning_content / reasoning fields. The adapter should preserve that as Responses reasoning output and avoid emitting hidden reasoning as ordinary assistant text.

Scope

This keeps the adapter narrow:

  • no provider registry changes
  • no cc-switch module copy
  • no codex_chat_common.rs extraction yet
  • no README changes, because the current main already lists codex_chat_common.rs as a shared helper reference

Validation

Not run locally in this environment. Recommended:

cargo fmt --check
cargo test --lib
cargo test --test reasoning_block_regression
cargo test

@HisenWeb
HisenWeb marked this pull request as ready for review June 24, 2026 19:44
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@HisenWeb
HisenWeb merged commit bfcc4f5 into main Jun 24, 2026
2 checks passed
@HisenWeb
HisenWeb deleted the codex/reasoning-content-split branch June 24, 2026 19:45
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