Skip to content

fix(gateway): streamed tool calls silently omit assistant commentary - #128353

Merged
steipete merged 1 commit into
mainfrom
codex/responses-tool-commentary-qa
Aug 23, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/responses-tool-commentary-qa

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where applications streaming Gateway /v1/responses tool calls would receive no assistant commentary delta when the model returned its explanation only in the final payload. The completed response contained the text, but live stream consumers saw nothing before the function call.

Why This Change Was Made

Remove an incorrect condition that limited pending-tool commentary emission to explicitly required or pinned tools. Every successful tool-call response now flushes its existing commentary exactly once when it has not already streamed, matching the sibling chat-completions endpoint.

User Impact

Responses API clients now receive live assistant text such as “Let me check that.” before the corresponding function-call events when tools are selected automatically. Required/pinned tool enforcement, already-streamed text, empty commentary, and final event ordering remain unchanged.

Evidence

  • Pre-fix red: the existing real Gateway HTTP streaming regression fails in both normal and isolated server projects because response.output_text.delta is absent.
  • Post-fix green: all 260 Responses and sibling chat-completions real Gateway/official-SDK tests pass, including tool-choice validation, replacement safety, ordinary/required tools, and terminal event consistency.
  • Core and Gateway-test TypeScript, focused oxlint/oxfmt, and assertion-safety/max-lines ratchets pass.
  • Production change removes one unnecessary condition without adding any production lines or public protocol/configuration surface.
  • Fresh independent in-session source-aware review checks exact SSE event ordering, required-tool enforcement, duplicate prevention, SDK accumulation, and sibling endpoint behavior; the external review CLI was unavailable under the session approval boundary.

@clawsweeper

clawsweeper Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XS maintainer Maintainer-authored PR labels Aug 23, 2026
@steipete
steipete marked this pull request as ready for review August 23, 2026 20:28
@steipete
steipete merged commit d97d350 into main Aug 23, 2026
294 checks passed
@steipete
steipete deleted the codex/responses-tool-commentary-qa branch August 23, 2026 20:40
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime maintainer Maintainer-authored PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant