Skip to content

Fix Codex OAuth empty responses for gpt-5.4#2443

Open
Pepelospalotes2005 wants to merge 1 commit intosipeed:mainfrom
Pepelospalotes2005:fix/codex-oauth-empty-response-linux-arm64
Open

Fix Codex OAuth empty responses for gpt-5.4#2443
Pepelospalotes2005 wants to merge 1 commit intosipeed:mainfrom
Pepelospalotes2005:fix/codex-oauth-empty-response-linux-arm64

Conversation

@Pepelospalotes2005
Copy link
Copy Markdown

Summary

Fix empty-response handling for Codex/OpenAI OAuth gpt-5.4 by improving fallback extraction when the final SDK response arrives completed but without hydrated output items.

Problem

With OpenAI OAuth connected and model gpt-5.4, PicoClaw could reach the Codex backend successfully, consume tokens, and still return an empty assistant response.

Observed behavior:

  • OAuth credentials were saved correctly
  • auth_method = oauth was applied correctly to openai/gpt-5.4
  • the runtime entered the Codex/OpenAI OAuth path
  • the backend completed the request
  • but PicoClaw ended with content_len=0 and surfaced the fallback:
    • The model returned an empty response. This may indicate a provider error or token limit.

Root cause

Two related response-shape issues:

  1. responses.Response could arrive completed but with no hydrated Output items
  2. streaming text deltas could carry usable text even when the final Response object remained effectively empty

Fix

1. Responses parser fallback

In pkg/providers/openai_responses_common/responses_common.go:

  • fallback to apiResp.OutputText() when the manual Output traversal produces empty content

2. Codex streaming fallback

In pkg/providers/codex_provider.go:

  • accumulate stream events from:
    • response.output_text.delta
    • response.output_text.done
    • response.reasoning_text.delta
  • use those accumulated buffers as fallback when the final parsed response still comes back empty

Validation

Validated on a live ARM64 Linux VPS running the forked binary behind the real launcher/dashboard flow:

  • OAuth login works
  • gpt-5.4 now returns actual text instead of the empty-response fallback

Notes

This PR intentionally excludes local ARM64 Matrix/libolm build workarounds used only for building on the test VPS.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 9, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@Pepelospalotes2005 Pepelospalotes2005 force-pushed the fix/codex-oauth-empty-response-linux-arm64 branch from a688e03 to 28830bc Compare April 9, 2026 12:23
@sipeed-bot sipeed-bot bot added type: bug Something isn't working domain: provider labels Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: provider type: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants