Repository navigation
fix(kosong): skip empty OpenAI-compatible reasoning stream values - #2508
mangeshraut712 wants to merge 33 commits into
Conversation
🦋 Changeset detectedLatest commit: c3d2b82 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1ce0e7ec0f
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
commit: |
HelloWorldU
left a comment
There was a problem hiding this comment.
Test that empty reasoning fields still preserve dialect detection
|
@HelloWorldU the dialect-preservation test you asked for is in this PR now.
Latest commit |
02411ed to
fad96f5
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7b6f3a494a
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
fc94e1e to
193c36f
Compare
38a4c7e to
4a95738
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4a9573838c
ℹ️ 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".
4605edb to
648f97a
Compare
Gateways that keep reasoning_content: "" after thinking ends were journaling thousands of no-op think parts. Still observe the key for dialect detection; only yield think parts with non-empty text (fixes MoonshotAI#2506).
The kosong provider copy was removed when the human LLM layer landed. Apply the same empty-reasoning skip on the OpenAI chat-completions stream parser.
Match other server tests so afterAll does not fail with ENOTEMPTY when events are still being flushed.
List only the published CLI package and describe the user-visible behavior.
bbbcd19 to
afbd929
Compare
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
@HelloWorldU the dialect-preservation test is on the branch. Could you or another maintainer say whether that covers the review, or what still needs to change? I will leave the branch alone until then. |
Confirm the CLI-scoped, user-facing kosong-skip-empty-think changeset on the branch so CI re-runs after the review replies.
5edd79e to
beaf861
Compare
Co-authored-by: Mangesh Raut <mangeshraut712@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: af4c90d27a
ℹ️ 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".
Dropping every empty reasoning delta also dropped the only marker when a tool call came back with reasoning_content: "", so the next request omitted reasoning_content. Keep the first empty marker per message and drop only the repeats, in the Kimi, OpenAI legacy and v2 parsers.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bbb8173eb4
ℹ️ 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".
…nk-7813' into pr-2508
After bbb8173 the first empty reasoning delta in a message is kept as the marker, so the resume test now expects it ahead of the later non-empty reasoning.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4d2ee492df
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5e81e9adce
ℹ️ 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".
…rs it An empty reasoning field on a text delta is deferred behind pending text and then dropped. Retain that key only once the marker cannot be discarded, and replay it ahead of a tool call in the same chunk so follow-up requests still send the field.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 06c0fecb49
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 43928eef1b
ℹ️ 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".
…kip-empty-think-7813
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 70c2f6f653
ℹ️ 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".
…kip-empty-think-7813
…ter routed arguments
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 711e4d453f
ℹ️ 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".
|
@HelloWorldU Confirmed on 8973a5d: packages/kosong/test/kimi.test.ts contains "keeps one empty reasoning marker and preserves later non-empty deltas." It begins with an empty streamed reasoning field and verifies the next request serializes under reasoning rather than the default reasoning_content. I ran that test directly: 1 passing. |
|
@HelloWorldU Could you please review the latest push, 8973a5d? It is the final requested update for the deferred empty-reasoning tool-call case; no additional Codex review round will be triggered. |
Summary
thinkparts when OpenAI-compatible streams keepreasoning_content: ""after thinking ends (fixes [kosong] OpenAI-compatible stream parser journals an empty think part per chunk carrying reasoning_content: "" #2506).openai-legacyandkimiproviders.Test plan
pnpm exec vitest run test/openai-legacy.test.ts test/kimi.test.tsinpackages/kosong(178 passed)Fixes #2506