Repository navigation
Conversation
hartmark
marked this pull request as draft
August 3, 2026 12:38
Contributor
Author
|
Still a work in progress — more testing in progress, not ready for review yet. |
hartmark
force-pushed
the
fix/responses-api-index-collision
branch
from
August 3, 2026 12:59
74fc86a to
b491d13
Compare
hartmark
marked this pull request as ready for review
August 3, 2026 19:19
…and empty tool_calls in reasoning replay Squashes the working history for the big-pickle multi-turn tool-calling fixes into a single commit: - Prevent output_index collision between reasoning, message, and tool calls in the Responses API stream. - Prevent data truncation in multi-choice and reasoning chunks. - Preserve reasoning history and improve turn grouping across turns. - Enable reasoning capture/extraction and replay for big-pickle. - Fix multi-turn reasoning replay and turn index hardcoding. - Strip empty `tool_calls: []` from assistant turns in the Responses -> Chat Completions downgrade — upstreams like opencode-zen/big-pickle reject the empty array with a 400. Still WIP: further live agentic-workflow testing against the "default" combo in progress.
…ead side The turn-index-hardcoding fix updated the reasoning-cache read side (translator/index.ts) to key lookups by the assistant message's real position in the messages array, but chatCore.ts's write side (both the streaming and non-streaming completion paths) still cached every response under the old hardcoded `messageIndex: 0`. Past the first assistant turn the two conventions no longer matched, so DeepSeek/ Xiaomi-mimo plain-turn reasoning replay silently missed the cache and fell back to the placeholder in ordinary multi-turn conversations. Compute the write-side index from the incoming request's message count instead, matching the position the response will occupy once the client appends it to history for the next turn. Found via coverage analysis surfacing two now-fixed pre-existing tests (reasoning-cache.test.ts, translator-helper-branches.test.ts) whose fixture keys assumed the old hardcoded convention; added an end-to-end write/read regression test.
hartmark
force-pushed
the
fix/responses-api-index-collision
branch
from
August 3, 2026 20:06
e1cb77e to
f681467
Compare
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes several critical bugs in the Responses API implementation that caused data loss, truncated responses, and incorrect turn grouping in multi-turn conversations.
Key Fixes:
Verification: