fix(openai): surface chat-completions refusal text as visible content#102349
fix(openai): surface chat-completions refusal text as visible content#102349ZOOWH wants to merge 8 commits into
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as superseded: this PR targets the same canonical OpenAI chat-completions refusal bug as the proof-positive sibling at #102344, while this branch has no unique remaining fix and still lacks adequate real behavior proof. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Use #102344 as the canonical landing candidate, resolve its remaining CI follow-up, then close the linked issue and duplicate PRs after merge. So I’m closing this here and keeping the remaining discussion on #102344. Review detailsBest possible solution: Use #102344 as the canonical landing candidate, resolve its remaining CI follow-up, then close the linked issue and duplicate PRs after merge. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection of current main shows both OpenAI-completions assemblers can receive refusal-only delta/message shapes and never read the refusal field, leaving no visible assistant text. Is this the best way to solve the issue? No for keeping this branch as the landing candidate. The parser-parity fix shape is plausible, but the better maintainer path is the sibling PR with broader delta/message coverage and positive real behavior proof. Security review: Security review cleared: The diff only changes local TypeScript response assembly and tests; it does not alter dependencies, workflows, secrets, package metadata, install scripts, or package resolution. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 1825c9f89047. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
What Problem This Solves
Fixes #102321 — OpenAI chat-completions
refusalfield silently dropped,assistant turn resolves to empty content. User sees a blank reply.
Root Cause
Two transport paths read
content/tool_calls/reasoning but drop therefusalfield. When content is null and only refusal is present,nothing is appended to output.
Fix
Agent transport: read
choiceDelta.refusal, route as visible text.Provider: normalize
choice.delta ?? choice.messageso both streamingand aggregated refusal responses flow through the same delta path.
Evidence
Runtime refusal proof
Live Model Proof
Regression Tests
Agent:
"surfaces a streaming refusal delta when content is null"Provider:
"surfaces chat-completions refusal deltas as visible text"Provider:
"surfaces aggregated message.refusal as visible assistant text"Autoreview