Skip to content

stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses) #30958

Open

Description

@zhangwenzheng0451

What version of the Codex App are you using (From “About Codex” dialog)?

26.623.81905

What subscription do you have?

Pro 20x

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

Since yesterday, I have been encountering recurring connection errors while using Codex, which are blocking my ability to complete tasks. The stream consistently drops before the completion of the response.

Error Message(s):

"stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses)"

"Error running remote compact task: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses)"

Context & Observations:

The issue occurs frequently during normal usage, often when the model is generating longer responses or performing remote compaction tasks.

What steps can reproduce the bug?

Anything, even something like "continue"

What is the expected behavior?

No response

Additional information

No response

Activity

  1. added
    bugSomething isn't working
    connectivityIssues involving networking or endpoint connectivity problems (disconnections)
    contextIssues related to context management (including compaction)
    on Jul 2, 2026
  2. Kodai0322 commented on Jul 7, 2026

    @Kodai0322

    Adding another data point for this issue.

    I’m seeing the same error:

    Error running remote compact task: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses)
    

    Observed behavior:

    • The failure tends to happen after a Codex session has accumulated a large amount of context.
    • Once the context grows, Codex can get interrupted by the remote compact / responses stream failure, forcing the user to stop and start a new chat/session.
    • This significantly reduces productivity during long-running coding tasks.
    • After manually compressing/reducing the context, the timeout stopped occurring.

    This makes the issue look strongly correlated with large thread context and/or the remote compaction payload/stream path, rather than a simple local network problem.

    Expected behavior:

    • Remote compact should handle large sessions reliably.
    • If compaction fails, the session should remain recoverable and should not force the user to create a new chat/session.
    • Ideally Codex should compact earlier, reduce the compaction payload, retry/fallback more robustly, or surface a safe recovery path before the session becomes stuck.

    Please prioritize a fix for long-context remote compaction / responses stream reliability.

  3. rellaqaq commented on Jul 23, 2026

    @rellaqaq

    Adding a reproducible macOS Codex App data point from 2026-07-23.

    Environment:

    • macOS on Apple Silicon
    • Codex CLI, managed app server, and app-server protocol version: 0.144.6
    • ChatGPT-backed Codex App task

    The exact error occurred twice in one day across two different workloads:

    stream disconnected before completion: error sending request for url
    (https://chatgpt.com/backend-api/codex/responses)
    
    1. A bounded background research task disconnected before returning or
      persisting its result.
    2. A foreground operational-diagnosis task disconnected after several
      successful tool calls, before it could create the issue and finish the
      remediation. The App UI displayed the error directly.

    The second occurrence is important because it was not merely an idle background
    worker or a remote-compaction-only symptom: an actively progressing foreground
    turn was terminated. The managed app server remained running, and GitHub/API
    connectivity succeeded immediately afterward. No logout, restart, upgrade, or
    local-state deletion was attempted.

    Expected behavior: a transient responses-stream failure should retry/resume
    without terminating the turn, and already completed tool-call state should
    remain recoverable so the user can continue the same operational task.

  4. rellaqaq commented on Jul 23, 2026

    @rellaqaq

    Correction to my previous recurrence report: later network diagnostics found a local confounder for the 2026-07-23 15:24 CST event.

    An anonymized shared proxy leaf was consistently failing direct health probes across Discord, GitHub, GitHub Raw, OpenAI WebSocket, and the ChatGPT responses endpoint during the correlated incident window. That leaf has now been removed from the local persistent candidate pools.

    Therefore, please do not treat this particular 15:24 occurrence as a clean Codex App-only reproduction. The earlier background occurrence may still be relevant, and I will monitor after the local network repair before attributing another recurrence upstream.

  5. rellaqaq commented on Jul 23, 2026

    @rellaqaq

    Final local follow-up: the confounder was two distinct failed proxy leaves rather than one. Both were removed only from their affected persistent candidate pools.

    After an OpenClash-only restart and a 10-minute soak, all remaining controller candidates passed the Discord, GitHub, GitHub API/Raw, OpenAI WebSocket, and ChatGPT responses probes; client-path checks also passed.

    This further disqualifies my 2026-07-23 15:24 CST event as a clean App-only reproduction. I will report a new occurrence only if it happens after this local repair.

  6. piemvibes-hue commented on Oct 8, 2026

    @piemvibes-hue

    Same failure class as the stream-disconnect deaths — the thread just stops mid-turn and nothing resumes it. I built a watchdog for exactly this: it reads ~/.codex's sqlite turn history (a killed/failed turn shows as failed with error_json, or stays orphaned inProgress when the process dies mid-turn), then revives the thread via codex exec resume — or codex queue when a live surface still holds the thread. Verifies the thread is producing events again, alerts via ntfy/webhook if it can't. MIT, zero deps: https://github.com/piemvibes-hue/agentwatch

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingconnectivityIssues involving networking or endpoint connectivity problems (disconnections)contextIssues related to context management (including compaction)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions