Skip to content

fix(responses): preserve streamed output items - #12048

Open
localai-org-maint-bot wants to merge 1 commit into
masterfrom
fix/responses-stream-items-9658
Open

localai-org-maint-bot wants to merge 1 commit into
masterfrom
fix/responses-stream-items-9658

Conversation

@localai-org-maint-bot

Copy link
Copy Markdown
Collaborator

Description

Fixes #9658.

Responses streams without explicit tools reused the reasoning item's output index for later answer events. The completed response could then omit the answer. Preserve each item's announced index and include the answer, reasoning, and automatically parsed tool calls in matching order. Create a reasoning item for native backend reasoning deltas as well.

Notes for Reviewers

Five regression cases exercise the real handler and serialized SSE: tagged reasoning, native backend reasoning, plain text, automatic tool parsing, and reasoning with automatic tool parsing. Four cases failed before the fix; all five now pass. The explicit tool-call streaming path is unchanged.

Validation:

  • go test ./core/http/endpoints/openresponses -count=1 passes (60 specs).
  • golangci-lint run --new-from-merge-base=https-origin/master ./core/http/endpoints/openresponses/... reports zero issues.
  • git diff --check HEAD^ HEAD passes.

Repository-wide lint could not complete: CGO is unavailable in this environment, so the unrelated backend/go/supertonic package cannot import onnxruntime_go. The linter ran through the available musl loader because make is absent.

Signed commits

  • Yes, I signed my commits.
  • Documentation updated (docs/content/) for user-facing changes, or not applicable

Keep each message and reasoning item at its announced output index.
Include the answer in completed responses with reasoning or fallback
function calls, and retain reasoning supplied through backend deltas.

Add regression coverage for stream indices, final output, plain text,
and automatic tool parsing.

Assisted-by: Codex:GPT-6
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.

reasoning extraction only happens at end of stream

1 participant