t3code icon indicating copy to clipboard operation
t3code copied to clipboard

[Bug]: Codex policy error is reported as a stream disconnect and retried five times

Open jmarkiewiczlets opened this issue 1 month ago • 1 comments

[!NOTE] Written by Codex (GPT-6 Astra) on behalf of @jmarkiewiczlets, based on local logs and a reproduced failure.

Area

Not sure — Codex provider integration / error reporting.

Summary

An explicit provider error (cyber_policy) arrives in the Responses stream, but T3 Code displays a generic stream-disconnect error after five retries. The actual reason for the failure is not shown.

The error is present in the proxy-to-Codex stream, but we have not isolated whether it is lost in Codex, proxy compatibility handling, or T3’s integration.

This report concerns error reporting and retry classification, not changing the provider’s policy decision.

Steps to reproduce

Observed repeatedly in one existing conversation on October 24, 2026:

  1. Use T3 Code with Codex through local CLIProxyAPI.
  2. Continue the conversation with gpt-6-astra.
  3. The request returns HTTP 200 and starts an SSE stream.
  4. The stream emits response.created, response.in_progress, then an error event with code cyber_policy, and closes without response.completed.
  5. Codex retries five times, and T3 displays the generic failure below.

A diagnostic follow-up asking only for OK, without tools or edits, reproduced the failure in the same conversation. The existing conversation history was still included.

A separate minimal request to the same model through the same proxy completed successfully with response.completed.

The private conversation is not attached, and the exact content triggering the provider classification is unknown. This is an observed reproduction, not a portable prompt-based reproducer.

Expected behavior

Show the provider’s explicit policy-error classification and an actionable explanation.

A recognized terminal policy rejection should stop the request rather than be retried as a transient connection failure.

Actual behavior

The UI shows:

Provider error after 5/5 retries
stream disconnected before completion: stream closed before response.completed

Codex logs record retries 1/5 through 5/5. Its persisted terminal error contains:

{
  "message": "stream disconnected before completion: stream closed before response.completed",
  "codex_error_info": "other"
}

The generic message suggests a connection problem and gives no indication that the request was explicitly rejected by the provider. Repeated continuation attempts produce the same failure.

Impact

Major degradation or frequent failure in the affected conversation. The misleading error led to unnecessary connectivity, credential, and proxy troubleshooting. Other requests through the same proxy work.

Version or commit

T3 Code 0.1.2-nightly.20261021.3457, reported in the affected request’s User-Agent. Installed application commit not verified.

Environment

  • macOS 26.5.2, arm64.
  • Codex runtime 0.164.0.
  • Model: gpt-6-astra, medium reasoning effort.
  • CLIProxyAPI 8.0.40.
  • Local Responses endpoint: http://127.0.0.1:8317/v1/responses, HTTP/SSE.

The macOS and Codex versions above are reported in the affected request’s User-Agent.

Logs or stack traces

The following event was captured in the proxy’s downstream response to Codex:

{
  "type": "error",
  "error": {
    "code": "cyber_policy",
    "message": "This content was flagged for possible cybersecurity risk. If this seems wrong, try rephrasing your request. If you’re doing authorized security work that requires more cyber permissive safeguards, apply for Daybreak access via https://platform.openai.com/settings/organization/status-and-access before retrying.",
    "param": null,
    "type": "invalid_request"
  },
  "sequence_number": 3
}

The proxy’s upstream response log contains the same error code and message.

The diagnostic turn ran from 14:25:34 to 14:26:25 UTC on October 24, 2026, and ended in failure. Credentials, request contents, and session identifiers are omitted.

T3 Code displays a generic stream-disconnect error after five retries

jmarkiewiczlets avatar Oct 24 '26 14:10 jmarkiewiczlets

I'm seeing the same thing on a newer build, with a different policy code.

  • T3 Code 0.1.14-nightly.20261130.5492 on macOS arm64. Codex goes through a local CLIProxyAPI 8.1.0 proxy. The request User-Agent shows codex-tui/0.154.0.
  • On Nov 30, one long-running thread failed six turns in a row between 19:15 and 20:03 UTC. Each turn showed a few "Provider recovered" retries and then stream disconnected before completion: stream closed before response.completed.
  • The proxy kept error logs for the last two turns: 10 upstream attempts (4 and 6). Every one starts as an HTTP 200 SSE stream (response.created, response.in_progress, some partial output). Then it ends with an error event with type invalid_request_error and code misalignment_policy_violation, which the proxy records as a 400.
  • Two other turns on the same machine, model and proxy succeeded around the same time. So it looks tied to that conversation, not to the connection.

I don't know what triggered the classification, and I haven't replayed the requests. I've left out request contents, account details and session ids.

Same asks as the original report. It would be great if T3 kept the upstream error code and message when a stream ends with an error event. And a policy rejection like this should probably stop the turn instead of being retried and shown as a disconnect. Thanks!

santissimoo avatar Nov 30 '26 20:11 santissimoo