Skip to content

CLI goals repeatedly stall with {"detail":"Bad Request"}; /goal resume and restarting do not recover (0.166.0) #58639

Open

Description

@dllu

What version of Codex CLI is running?

codex-cli 0.166.0

What platform is your computer?

ARM64 Linux

What issue are you seeing?

An active goal repeatedly gets blocked by the same unexplained error:

{"detail":"Bad Request"}

This happened three times in the same thread:

  1. The goal stopped with the error.
  2. I tried /goal resume, but it immediately failed with the same error.
  3. I quit Codex and restarted it. It did some work for about two seconds, then failed with the same error again.

The UI ends up showing Goal stalled (/goal resume), but the suggested recovery does not recover the goal. The error gives no actionable explanation.

What steps can reproduce the bug?

Uploaded thread: 01a18b58-5d28-7df0-97a8-3f5dca3128a5

Continue the active goal in that thread, then try /goal resume or quit and restart Codex after the error. Both recovery attempts failed as described above. I do not have a minimal reproduction or a confirmed trigger.

What is the expected behavior?

The goal should continue, or resuming/restarting should recover it. If the request cannot be accepted, Codex should explain what is wrong and provide an actionable recovery path instead of repeatedly returning a generic Bad Request.

Additional information

The task was optimising StarCraft II performance in Wine + FEX on ARM64 Linux. This seems to be a general goal/continuation problem rather than a project-specific failure, but I have not established the root cause or tested unrelated goals.

Possibly related: #58569 describes similar repeated Bad Request failures blocking continuation in the desktop app. This report concerns the CLI; a shared cause is not confirmed.

Activity

  1. added
    bug
    CLI
    agent
    on Nov 1, 2026
  2. github-actions commented on Nov 1, 2026

    @github-actions
    Contributor
  3. dllu commented on Nov 1, 2026

    @dllu
    Author

    Additional diagnostics from the local CLI diagnostic database and session event log. This adds a fourth failure recorded after the issue was filed. All times below are UTC on 2026-11-01; these correspond to the evening of October 31 in America/Los_Angeles.

    Confirmed failing requests

    All four are HTTP 400 responses to POST https://chatgpt.com/backend-api/codex/responses, with the same response {"detail":"Bad Request"}. The client records codex_error_info: "other", without a rejected field or validation reason.

    Response time (UTC) x-oai-request-id Observed sequence
    00:30:12 f64224e7-ba76-4ea1-a27e-e75e2461308f An ongoing turn fails after successful tool activity.
    03:38:22 1b5b965a-1bf0-45b3-8256-86d2de317a45 Goal resume fails after 1.561 seconds, with no new tool calls.
    03:39:24 395509ce-5949-425b-a0e9-5498ecbb0ef5 A subsequent resume briefly works: two model requests return HTTP 200, tools run, and the next model request returns 400. The turn lasts 27.291 seconds.
    04:54:10 78a20345-3529-4f6f-bbee-62fbd7d9118a A later pause/resume attempt fails after 1.504 seconds, with no new tool calls.

    These belong to the thread already identified in the issue: 01a18b58-5d28-7df0-97a8-3f5dca3128a5.

    Environment and restart behavior

    • Model: gpt-6.1-sol; reasoning effort: xhigh; authentication: ChatGPT.
    • Transport: responses_http, HTTP/1.1.
    • The serving process is the managed Codex app-server daemon, version 0.166.0, on Linux aarch64.
    • All four failures are logged by the same daemon process, which predates the failures. At 03:38:55 the app-server explicitly logs a running-thread resume with no active turn. Thus, quitting and reopening the CLI did not constitute a fresh app-server restart in this case. I have not tested whether restarting that daemon changes the outcome.

    Request sizes and context accounting

    The client logs these serialized request-body sizes before and after zstd compression. Times are response times; byte counts come from the corresponding preceding compression records.

    Time (UTC) HTTP status Before zstd (bytes) After zstd (bytes)
    00:29:55 200 79,730,373 27,486,368
    00:30:12 400 79,738,419 27,492,035
    03:38:22 400 79,745,785 27,494,995
    03:39:02 200 79,753,151 27,495,100
    03:39:16 200 79,758,524 27,498,323
    03:39:24 400 86,853,515 27,516,923
    04:54:10 400 86,861,328 27,519,903

    The successful 03:39:02 and 03:39:16 requests are larger than the first two failures, so these records do not establish a fixed request-size cutoff. For server-side comparison, their request IDs are b42f4ab7-5533-40d1-a6bf-fb9358fbc6d8 and 42d7c7d1-d088-4466-b414-95dd5ef26b38, respectively.

    Immediately before the 00:30:12 and 03:39:24 failures, the core reports context usage of 232,689 and 237,851 tokens, respectively, against a configured auto-compaction threshold of 450,000 and full-context limit of 475,000. Both token_limit_reached and full_context_window_limit_reached are false. The last recorded compaction was at 23:49:41 UTC on October 31. The goal has no configured token budget. These are client-side observations, not evidence of how the server validated the requests.

    The inspected tool calls preceding those two failures have matching tool outputs in the session log. The workload includes shell commands and screenshot viewing; one rejected continuation follows text-only tool output, another follows image plus text output. Screenshot subprocesses that had already returned a running-session handle subsequently exit successfully. The recorded error is from the model HTTP request, rather than a reported shell failure.

    Please use the failing and successful request IDs to compare backend validation/routing and identify the rejection reason. These diagnostics support the similar symptoms in #58569 and #57874, but do not establish a common root cause. No raw transcripts, screenshots, credentials, or machine-specific project paths are included here.

  4. etraut-openai commented on Nov 1, 2026

    @etraut-openai
    Contributor

    (response from codex)

    Thanks for the detailed logs. This was a backend issue. The model endpoint returned HTTP 400 while Codex was continuing the thread. The goal feature didn’t cause the error.

    Goals are designed to stop when a turn encounters an unrecoverable error. That’s why the CLI showed Goal stalled. Running /goal resume let Codex try again, but the backend returned the same error on a later request.

  5. dllu commented on Nov 2, 2026

    @dllu
    Author

    A fresh session also stalled due to the same issue. Feedback uploaded with 01a19922-8c0d-75d0-b18b-877acad24934.

  6. publicmain commented on Nov 2, 2026

    @publicmain

    Additional occurrence: long-running goals repeatedly stall

    I am also experiencing recurring Bad Request errors during long-running work in the desktop app. A development goal has been running across several days, and repeated interruptions now leave the goal stalled and require manual continuation.

    This resembles the continuation problem described in this issue. I have not established a shared root cause or a deterministic reproduction. In particular, I cannot conclude that elapsed runtime alone is the trigger.

    Observed workflow

    1. Continue an existing long-running development goal.
    2. Work is interrupted by a generic Bad Request error.
    3. The goal becomes stalled and requires attention to continue.
    4. The problem recurs, disrupting unattended work.

    Expected behavior

    The goal should continue reliably, or the app should provide a specific, actionable error and a supported recovery path that preserves existing work.

    A private report has also been submitted through the application's official feedback channel. This public comment contains only the symptom summary and impact; no private diagnostic identifiers, exact incident timestamps, runtime measurements, logs, conversation contents or project files are included.

  7. dllu commented on Nov 3, 2026

    @dllu
    Author

    Is there a fix for the backend issue? I am frequently running into this issue, which blocks my work entirely, and there seems to be no recourse to fix it or work around it from my end.

  8. liuzhao1225 commented on Nov 30, 2026

    @liuzhao1225

    Additional Windows observation: a long tool-using turn fails, then /goal resume fails before the next tool call

    I reviewed the activity records for two occurrences on different days in the same T3 Code conversation on Windows x64, using its Codex provider. Both started during a goal that had already been doing work for more than half an hour. There were five recorded provider errors in total: the two original failures, two failed resume attempts, and one failed attempt to submit the full goal again. This may help distinguish the first failure from what happens when the user tries to recover.

    Observation First occurrence Second occurrence
    Time from start of the affected turn to failure About 47 minutes About 34½ minutes
    Work recorded in that turn About 340 dynamic tool calls About 340 dynamic tool calls, plus a few local command executions
    Last event before the provider error A tool returned successfully A tool returned successfully
    Time from that tool result to the error Under 2 seconds Under 2 seconds
    Retry in the same conversation /goal resume failed in about 3 seconds /goal resume failed in about 2 seconds

    Error as recorded by T3. All five failures had the same fields. This is the provider error visible to the client; I do not have the raw HTTP exchange.

    {
      "error": {
        "message": "Bad Request",
        "type": null,
        "code": null,
        "param": null
      },
      "status": 400
    }

    What happened on recovery

    1. In the first occurrence, after the failed resume, I switched the same T3 conversation to a different provider. It successfully read the current state and performed another action through the same tool service. Switching back to Codex and submitting the full goal again produced the same 400 about three seconds after that Codex run started. No intervening tool call was recorded in either failed Codex retry.
    2. In the second occurrence, after the failed resume, the other provider picked up the task, used the same tools for roughly four more hours, and completed the work. This verifies that the tool service and task were still usable. A provider handoff uses a different model session, so this does not establish that the original Codex session recovered.
    3. There is a successful context-compaction event in the preceding Codex turn on the second day. Codex then continued to perform tool calls, including throughout the subsequent 34½-minute turn. The failure event itself contains no compaction error. The two occurrences used different Codex models.

    How to interpret the counts. I counted dynamic-tool activity items once per recorded item in each failing turn, including individual tool calls that returned errors earlier and after which Codex continued working. Local command executions were counted separately. These are client-side counts. The similar totals are an observation from two runs; the number of items serialized in the rejected requests is unknown.

    The earlier maintainer reply identified a backend rejection in the original report. Our client records establish the same visible sequence, but contain no request ID, response headers, request-body size, or token count for the rejected requests. I cannot tell whether these two failures shared the original backend cause. I also have no same-provider, fresh-conversation control at either failure time.

    Diagnostic question: If this recurs on Windows with Codex running through an app-server client, which Codex diagnostic event or supported feedback command should we capture immediately to correlate the first rejection and the failed resume? A way to collect the request ID and rejection category without uploading conversation text or tool payloads would make a follow-up much more actionable.

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

    CLIagentbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions