[PR #648] [MERGED] Fix GPT-5.5 empty responses on custom providers #4713

Closed
opened 2026-10-22 04:10:02 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/648
Author: @kolacheee
Created: 5/10/2026
Status: ✅ Merged
Merged: 5/10/2026
Merged by: @SpicyMarinara

Base: main ← Head: claude/intelligent-taussig-b84428


📝 Commits (2)

  • ca06324 Fix GPT-5.5 empty responses on custom providers
  • 95ec7a8 Merge branch 'main' into claude/intelligent-taussig-b84428

📊 Changes

1 file changed (+5 additions, -1 deletions)

View changed files

📝 packages/server/src/services/llm/providers/openai.provider.ts (+5 -1)

📄 Description

Linked issue

Closes #644

Why this change

PR #643 fixed silent empty responses for GPT-5.4 but not GPT-5.5. Users report that GPT-5.5 still returns blank responses on both custom (reverse-proxy) providers and the official OpenAI provider. The root causes are:

  1. Routing: Custom providers were forced into the Responses API for GPT-5.5, but most reverse proxies only implement /chat/completions.
  2. Content format: GPT-5.5 may return content parts with type: "text" instead of "output_text", and streaming deltas as response.text.delta instead of response.output_text.delta — both silently ignored by the existing extraction logic.
  3. Silent failures: The Responses API can return status: "failed" with HTTP 200, which was never checked.

What changed

Routing fix (useResponsesAPI)

  • Reordered checks so isGenericCustomProvider() runs before isGpt55Model() — custom providers always use Chat Completions now, even for GPT-5.5.

Non-streaming status validation (chatResponses, chatCompleteResponses)

  • Added status === "failed" check that throws with the error message from the response.
  • Added status === "incomplete" warning with the reason.

Resilient content extraction (extractResponsesText)

  • Accept part.type === "text" in addition to "output_text".
  • Fall back to string item.content when structured content array is absent.

Streaming event coverage (chatResponses, chatCompleteResponses)

  • Added response.text.delta as an alternative to response.output_text.delta.

Diagnostic logging

  • When non-streaming text extraction returns empty, log the response status, output_text type, and output item types.
  • When streaming produces no text and the fallback also returns empty, log the same diagnostics.

Validation

  • pnpm check passes
  • Manually test GPT-5.5 on a custom provider (reverse proxy) — should route to Chat Completions and return text
  • Manually test GPT-5.5 on the official OpenAI provider — should return text via Responses API
  • Manually test GPT-5.4 on the official OpenAI provider — should still work (no regression)
  • Manually test "Send Test Message" in API Connections for GPT-5.5 — should show non-blank response
  • If GPT-5.5 still returns empty, check server logs for [OpenAI Responses] warnings — they now show what the API actually returned

Manual verification notes

  • The diagnostic [OpenAI Responses] log lines are critical if the fix still doesn't resolve the issue — they reveal the exact structure GPT-5.5 returns (status, output_text type, output item types) so the extraction can be further tuned.
  • The "Send Test Message" path uses non-streaming provider.chat() which exercises the chatResponses non-streaming path with the new status checks.
  • The main chat path uses streaming which exercises the chatResponses streaming path with the new response.text.delta event.

Docs and release impact

No docs or release metadata changes needed. This is a bug fix for existing OpenAI provider behavior.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/648 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 5/10/2026 **Status:** ✅ Merged **Merged:** 5/10/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `main` ← **Head:** `claude/intelligent-taussig-b84428` --- ### 📝 Commits (2) - [`ca06324`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ca06324d814e03b645ae9a51573a024472776cc6) Fix GPT-5.5 empty responses on custom providers - [`95ec7a8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/95ec7a83b43fb921a5d52f79f58ec11c18db6543) Merge branch 'main' into claude/intelligent-taussig-b84428 ### 📊 Changes **1 file changed** (+5 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/services/llm/providers/openai.provider.ts` (+5 -1) </details> ### 📄 Description ## Linked issue Closes #644 ## Why this change PR #643 fixed silent empty responses for GPT-5.4 but **not GPT-5.5**. Users report that GPT-5.5 still returns blank responses on both custom (reverse-proxy) providers and the official OpenAI provider. The root causes are: 1. **Routing**: Custom providers were forced into the Responses API for GPT-5.5, but most reverse proxies only implement `/chat/completions`. 2. **Content format**: GPT-5.5 may return content parts with `type: "text"` instead of `"output_text"`, and streaming deltas as `response.text.delta` instead of `response.output_text.delta` — both silently ignored by the existing extraction logic. 3. **Silent failures**: The Responses API can return `status: "failed"` with HTTP 200, which was never checked. ## What changed ### Routing fix (`useResponsesAPI`) - Reordered checks so `isGenericCustomProvider()` runs **before** `isGpt55Model()` — custom providers always use Chat Completions now, even for GPT-5.5. ### Non-streaming status validation (`chatResponses`, `chatCompleteResponses`) - Added `status === "failed"` check that throws with the error message from the response. - Added `status === "incomplete"` warning with the reason. ### Resilient content extraction (`extractResponsesText`) - Accept `part.type === "text"` in addition to `"output_text"`. - Fall back to string `item.content` when structured content array is absent. ### Streaming event coverage (`chatResponses`, `chatCompleteResponses`) - Added `response.text.delta` as an alternative to `response.output_text.delta`. ### Diagnostic logging - When non-streaming text extraction returns empty, log the response status, `output_text` type, and output item types. - When streaming produces no text and the fallback also returns empty, log the same diagnostics. ## Validation - [ ] `pnpm check` passes - [ ] Manually test GPT-5.5 on a **custom provider** (reverse proxy) — should route to Chat Completions and return text - [ ] Manually test GPT-5.5 on the **official OpenAI provider** — should return text via Responses API - [ ] Manually test GPT-5.4 on the official OpenAI provider — should still work (no regression) - [ ] Manually test "Send Test Message" in API Connections for GPT-5.5 — should show non-blank response - [ ] If GPT-5.5 still returns empty, check server logs for `[OpenAI Responses]` warnings — they now show what the API actually returned ### Manual verification notes - The diagnostic `[OpenAI Responses]` log lines are **critical** if the fix still doesn't resolve the issue — they reveal the exact structure GPT-5.5 returns (status, output_text type, output item types) so the extraction can be further tuned. - The "Send Test Message" path uses non-streaming `provider.chat()` which exercises the `chatResponses` non-streaming path with the new status checks. - The main chat path uses streaming which exercises the `chatResponses` streaming path with the new `response.text.delta` event. ## Docs and release impact No docs or release metadata changes needed. This is a bug fix for existing OpenAI provider behavior. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:10:02 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#4713
No description provided.