Skip to content

Goal resume enters endless loop #37304

Open

Description

@nikolageorgiev2000

What version of Codex CLI is running?

0.146.0

What subscription do you have?

Plus

Which model were you using?

gpt-5.6

What platform is your computer?

linux x64

What terminal emulator and version are you using (if applicable)?

cursor terminal

Codex doctor report

{
  "schemaVersion": 1,
  "generatedAt": "1786036350s since unix epoch",
  "overallStatus": "ok",
  "codexVersion": "0.146.0",
  "checks": {
    "app_server.status": {
      "id": "app_server.status",
      "category": "app-server",
      "status": "ok",
      "summary": "background server is not running",
      "details": {
        "control socket": "/root/.codex/app-server-control/app-server-control.sock",
        "daemon state dir": "/root/.codex/app-server-daemon",
        "mode": "ephemeral",
        "pid file": "/root/.codex/app-server-daemon/app-server.pid (missing)",
        "settings": "/root/.codex/app-server-daemon/settings.json (missing)",
        "status": "not running",
        "update-loop pid file": "/root/.codex/app-server-daemon/app-server-updater.pid (missing)"
      },
      "remediation": null,
      "durationMs": 0
    },
    "auth.credentials": {
      "id": "auth.credentials",
      "category": "auth",
      "status": "ok",
      "summary": "auth is configured",
      "details": {
        "auth file": "/root/.codex/auth.json",
        "auth storage mode": "File",
        "stored API key": "false",
        "stored ChatGPT tokens": "true",
        "stored agent identity": "false",
        "stored auth mode": "chatgpt"
      },
      "remediation": null,
      "durationMs": 0
    },
    "config.load": {
      "id": "config.load",
      "category": "config",
      "status": "ok",
      "summary": "config loaded",
      "details": {
        "CODEX_HOME": "/root/.codex",
        "config.toml": "/root/.codex/config.toml",
        "config.toml parse": "ok",
        "cwd": "/workspace",
        "enabled feature flags": "shell_tool, unified_exec, shell_snapshot, code_mode_host, terminal_resize_reflow, sqlite, hooks, enable_request_compression, multi_agent, apps, tool_search_always_defer_mcp_tools, tool_suggest, plugins, in_app_browser, in_app_updates, browser_use, browser_use_full_cdp_access, browser_use_external, computer_use, remote_plugin, plugin_sharing, image_generation, resize_all_images, item_ids, skill_mcp_dependency_install, skill_search, mentions_v2, steer, guardian_approval, goals, collaboration_modes, tool_call_mcp_elicitation, auth_elicitation, personality, fast_mode, tui_app_server, remote_compaction_v2, workspace_dependencies",
        "feature flag overrides": "none",
        "feature flags enabled": "38",
        "log dir": "/root/.codex/log",
        "mcp servers": "0",
        "model": "<default>",
        "model provider": "openai",
        "sqlite home": "/root/.codex"
      },
      "remediation": null,
      "durationMs": 0
    },
    "git.environment": {
      "id": "git.environment",
      "category": "git",
      "status": "ok",
      "summary": "git version 2.43.0",
      "details": {
        "PATH git #1": "/usr/bin/git",
        "PATH git #2": "/bin/git",
        "PATH git entries": "2",
        "git build options": "git version 2.43.0; cpu: x86_64; no commit associated with this build; sizeof-long: 8; sizeof-size_t: 8; shell-path: /bin/sh",
        "git exec path": "/usr/lib/git-core",
        "git version": "git version 2.43.0",
        "repo detected": "false",
        "selected git": "/usr/bin/git"
      },
      "remediation": null,
      "durationMs": 51
    },
    "installation": {
      "id": "installation",
      "category": "install",
      "status": "ok",
      "summary": "installation looks consistent",
      "details": {
        "PATH codex #1": "/root/.local/bin/codex",
        "current executable": "/root/.codex/packages/standalone/releases/0.146.0-x86_64-unknown-linux-musl/bin/codex",
        "install context": "standalone (unix, package /root/.codex/packages/standalone/releases/0.146.0-x86_64-unknown-linux-musl, bin /root/.codex/packages/standalone/releases/0.146.0-x86_64-unknown-linux-musl/bin, resources /root/.codex/packages/standalone/releases/0.146.0-x86_64-unknown-linux-musl/codex-resources, path /root/.codex/packages/standalone/releases/0.146.0-x86_64-unknown-linux-musl/codex-path)",
        "managed by bun": "false",
        "managed by npm": "false",
        "managed by pnpm": "false",
        "managed package root": "not set"
      },
      "remediation": null,
      "durationMs": 1
    },
    "mcp.config": {
      "id": "mcp.config",
      "category": "mcp",
      "status": "ok",
      "summary": "no MCP servers configured",
      "details": {},
      "remediation": null,
      "durationMs": 0
    },
    "network.env": {
      "id": "network.env",
      "category": "network",
      "status": "ok",
      "summary": "network-related environment looks readable",
      "details": {
        "proxy env vars": "none"
      },
      "remediation": null,
      "durationMs": 0
    },
    "network.provider_reachability": {
      "id": "network.provider_reachability",
      "category": "reachability",
      "status": "ok",
      "summary": "active provider endpoints are reachable over HTTP",
      "details": {
        "ChatGPT base URL": "https://chatgpt.com/backend-api/ reachable (HTTP 403)",
        "reachability mode": "ChatGPT auth"
      },
      "remediation": null,
      "durationMs": 107
    },
    "network.websocket_reachability": {
      "id": "network.websocket_reachability",
      "category": "websocket",
      "status": "ok",
      "summary": "Responses WebSocket handshake succeeded",
      "details": {
        "DNS": "2 IPv4, 2 IPv6, first IPv4",
        "auth mode": "chatgpt",
        "connect timeout": "15000 ms",
        "endpoint": "wss://chatgpt.com/backend-api/<redacted>",
        "handshake result": "HTTP 101 Switching Protocols",
        "model provider": "openai",
        "models etag present": "true",
        "provider name": "OpenAI",
        "proxy env vars": "none",
        "reasoning header": "false",
        "server model present": "false",
        "supports websockets": "true",
        "wire API": "responses"
      },
      "remediation": null,
      "durationMs": 641
    },
    "runtime.provenance": {
      "id": "runtime.provenance",
      "category": "runtime",
      "status": "ok",
      "summary": "running standalone on linux-x86_64",
      "details": {
        "commit": "unknown",
        "current executable": "/root/.codex/packages/standalone/releases/0.146.0-x86_64-unknown-linux-musl/bin/codex",
        "install method": "standalone (unix, package /root/.codex/packages/standalone/releases/0.146.0-x86_64-unknown-linux-musl, bin /root/.codex/packages/standalone/releases/0.146.0-x86_64-unknown-linux-musl/bin, resources /root/.codex/packages/standalone/releases/0.146.0-x86_64-unknown-linux-musl/codex-resources, path /root/.codex/packages/standalone/releases/0.146.0-x86_64-unknown-linux-musl/codex-path)",
        "platform": "linux-x86_64",
        "version": "0.146.0"
      },
      "remediation": null,
      "durationMs": 0
    },
    "runtime.search": {
      "id": "runtime.search",
      "category": "search",
      "status": "ok",
      "summary": "search is OK (bundled)",
      "details": {
        "search command": "/root/.codex/packages/standalone/releases/0.146.0-x86_64-unknown-linux-musl/codex-path/rg",
        "search command readiness": "file exists",
        "search provider": "bundled"
      },
      "remediation": null,
      "durationMs": 0
    },
    "sandbox.helpers": {
      "id": "sandbox.helpers",
      "category": "sandbox",
      "status": "ok",
      "summary": "sandbox configuration is readable",
      "details": {
        "approval policy": "OnRequest",
        "codex-linux-sandbox helper": "/root/.codex/tmp/arg0/codex-arg0H7VoJ2/codex-linux-sandbox",
        "execve wrapper helper": "/root/.codex/tmp/arg0/codex-arg0H7VoJ2/codex-execve-wrapper",
        "filesystem sandbox": "restricted",
        "network sandbox": "restricted"
      },
      "remediation": null,
      "durationMs": 0
    },
    "state.paths": {
      "id": "state.paths",
      "category": "state",
      "status": "ok",
      "summary": "state paths and databases are inspectable",
      "details": {
        "CODEX_HOME": "/root/.codex (dir)",
        "active rollout files": "3 files, 65094241 total bytes, 21698080 average bytes",
        "archived rollout files": "0 files, 0 total bytes, 0 average bytes",
        "goals DB": "/root/.codex/goals_1.sqlite (file)",
        "goals DB integrity": "ok",
        "log DB": "/root/.codex/logs_2.sqlite (file)",
        "log DB integrity": "ok",
        "log dir": "/root/.codex/log (missing)",
        "memories DB": "/root/.codex/memories_1.sqlite (file)",
        "memories DB integrity": "ok",
        "sqlite home": "/root/.codex (dir)",
        "standalone release cache": "1 entries in /root/.codex/packages/standalone/releases",
        "state DB": "/root/.codex/state_5.sqlite (file)",
        "state DB integrity": "ok",
        "thread history DB": "/root/.codex/thread_history_1.sqlite (missing)",
        "thread history DB integrity": "skipped (missing)"
      },
      "remediation": null,
      "durationMs": 113
    },
    "state.rollout_db_parity": {
      "id": "state.rollout_db_parity",
      "category": "threads",
      "status": "ok",
      "summary": "rollout files and state DB thread inventory agree",
      "details": {
        "default model provider": "openai",
        "rollout DB active files": "3",
        "rollout DB active rows": "3",
        "rollout DB archive mismatches": "0",
        "rollout DB archived files": "0",
        "rollout DB archived rows": "0",
        "rollout DB duplicate DB paths": "0",
        "rollout DB duplicate rollout thread ids": "0",
        "rollout DB malformed file names": "0",
        "rollout DB missing active rows": "0",
        "rollout DB missing archived rows": "0",
        "rollout DB model providers": "openai=3",
        "rollout DB rows": "3",
        "rollout DB scan cap reached": "false",
        "rollout DB scan errors": "0",
        "rollout DB sources": "cli=3",
        "rollout DB stale rows": "0"
      },
      "remediation": null,
      "durationMs": 54
    },
    "system.environment": {
      "id": "system.environment",
      "category": "system",
      "status": "ok",
      "summary": "OS language C",
      "details": {
        "EDITOR": "not set",
        "LANG": "C.UTF-8",
        "VISUAL": "not set",
        "os": "Ubuntu 24.4.0 (noble) [64-bit]",
        "os language": "C",
        "os type": "Ubuntu",
        "os version": "24.4.0"
      },
      "remediation": null,
      "durationMs": 9
    },
    "terminal.env": {
      "id": "terminal.env",
      "category": "terminal",
      "status": "ok",
      "summary": "terminal metadata was detected",
      "details": {
        "COLORTERM": "truecolor",
        "SSH_CLIENT": "present",
        "SSH_CONNECTION": "present",
        "TERM": "xterm-256color",
        "TERM_PROGRAM": "xterm.js(6.1.0-beta.291)",
        "VSCODE_IPC_HOOK_CLI": "present",
        "color output": "disabled (stdout is not a terminal)",
        "effective locale": "C.UTF-8",
        "multiplexer": "tmux 3.4",
        "stderr is terminal": "true",
        "stdin is terminal": "true",
        "stdout is terminal": "false",
        "terminal": "unknown",
        "terminal size": "108x54",
        "tmux allow-passthrough": "off",
        "tmux client termname": "xterm-256color",
        "tmux client termtype": "xterm.js(6.1.0-beta.291)",
        "tmux extended-keys": "off",
        "tmux focus-events": "off",
        "tmux set-clipboard": "external",
        "tmux xterm-keys": "on"
      },
      "remediation": null,
      "durationMs": 24
    },
    "terminal.title": {
      "id": "terminal.title",
      "category": "title",
      "status": "ok",
      "summary": "terminal title default",
      "details": {
        "terminal title activity": "true",
        "terminal title items": "activity, project-name",
        "terminal title project source": "cwd",
        "terminal title project value": "workspace",
        "terminal title source": "default"
      },
      "remediation": null,
      "durationMs": 0
    },
    "updates.status": {
      "id": "updates.status",
      "category": "updates",
      "status": "ok",
      "summary": "update configuration is locally consistent",
      "details": {
        "cached latest version": "0.146.1",
        "check for update on startup": "true",
        "last checked at": "2026-08-06T14:10:31.097330096Z",
        "latest version": "0.146.1",
        "latest version status": "newer version is available",
        "update action": "standalone installer",
        "version cache": "/root/.codex/version.json"
      },
      "remediation": null,
      "durationMs": 580
    }
  }
}

What issue are you seeing?

────────────────────────────────────────────────────────────────────────────────────────────────────────────

• Still paused as requested, awaiting your explicit instruction to resume.

────────────────────────────────────────────────────────────────────────────────────────────────────────────

• Work remains paused as requested. Awaiting your explicit instruction to resume.

────────────────────────────────────────────────────────────────────────────────────────────────────────────

• Still paused as requested, awaiting your explicit instruction to resume.

────────────────────────────────────────────────────────────────────────────────────────────────────────────

• Work remains paused as requested. Awaiting your explicit instruction to resume.

────────────────────────────────────────────────────────────────────────────────────────────────────────────

• Still paused as requested, awaiting your explicit instruction to resume.

────────────────────────────────────────────────────────────────────────────────────────────────────────────

• Work remains paused as requested. Awaiting your explicit instruction to resume.

────────────────────────────────────────────────────────────────────────────────────────────────────────────

• Still paused as requested, awaiting your explicit instruction to resume.

────────────────────────────────────────────────────────────────────────────────────────────────────────────

• Work remains paused as requested. Awaiting your explicit instruction to resume.

────────────────────────────────────────────────────────────────────────────────────────────────────────────

• Still paused as requested, awaiting your explicit instruction to resume.

────────────────────────────────────────────────────────────────────────────────────────────────────────────

• Work remains paused as requested. Awaiting your explicit instruction to resume.

────────────────────────────────────────────────────────────────────────────────────────────────────────────

• Still paused as requested, awaiting your explicit instruction to resume.

What steps can reproduce the bug?

Uploaded thread: 019fd18b-2300-7e32-ad48-aae801d53a59

What is the expected behavior?

I ran /goal resume then left for ~1 hour.
When I returned the model had entered this loop. No actual work was done.

Additional information

No response

Activity

  1. nikolageorgiev2000 commented on Aug 6, 2026

    @nikolageorgiev2000
    Author

    I think what happened is that I had previously mentioned to summarize work because we were running out of credits. When I resume the goal the model entered this loop. Ideally Codex should detect loops like this to prevent wasting tokens!

  2. nikolageorgiev2000 commented on Aug 6, 2026

    @nikolageorgiev2000
    Author

    closed by mistake

  3. kimjansheden commented on Sep 5, 2026

    @kimjansheden

    Reproduced this today (2026-09-05, Europe/Stockholm) with Goal mode on GPT-6 Astra, with severe quota impact.

    What happened

    I had a Goal-mode thread that had previously been paused. At about 01:25 local time I resumed the thread. Instead of resuming work, it repeatedly emitted the same no-progress message:

    Fortsatt pausat enligt din instruktion. Inga nya åtgärder har utförts.
    ("Still paused according to your instruction. No new actions have been performed.")

    The message was repeated over and over without useful work or tool progress. I did not notice until about 02:10, so the loop ran for roughly 45 minutes before I stopped it.

    Impact

    During this no-op loop, roughly 30% of my weekly usage quota was consumed.

    This is much worse than the behavior I had observed previously, where Goal mode would stop after only a few unsuccessful/no-progress continuation attempts. In this run there was effectively no circuit breaker: the same paused state + same response + zero progress continued indefinitely while consuming quota.

    Expected behavior

    After resume, either:

    1. the Goal should actually resume, or
    2. if the model still sees the thread as paused / cannot make progress, Goal mode should stop after a small bounded number of identical no-progress turns.

    It should never keep generating identical no-op continuations indefinitely.

    This looks related to the broader unbounded Goal auto-continuation / quota-consumption failure mode reported in #34248. Please also consider quota protection for this failure mode, e.g. detect repeated identical state/response with zero tool progress and terminate the Goal automatically.

    Given that about 30% of a weekly quota was consumed while no work was being performed, I would also appreciate guidance on having the affected quota reviewed/restored.

  4. zack-avino-cld commented on Sep 7, 2026

    @zack-avino-cld

    Same failure on a newer build, with the cost quantified. Codex CLI 0.153.4, model gpt-6-astra, Linux x64 (Arch, kernel 7.0.10), Pro plan. Thread 01a07671-502f-7a80-ab67-f30b68a04a6d.

    Worth noting that this is a different model generation from the original report (gpt-5.6 there, gpt-6-astra here) and seven releases later, so the bug is neither model-specific nor fixed.

    Same shape as the original report: a persistent goal was active, I told the agent to stop, it acknowledged the stop, and then it kept re-invoking itself with the same "Paused." / "Work remains paused as requested." strings. The difference is that I did not come back after an hour. It ran for 13.5 hours and consumed my entire weekly quota.

    Timeline (UTC)

    Time Event
    2026-09-06 22:06:09 Persistent goal enabled, <codex_internal_context source="goal"> injected
    2026-09-07 00:18:57 Last user message: "Okay let's take a break. Find a good stopping point..."
    2026-09-07 00:19:02 Agent completes the task, reports a stopping point, loop begins
    2026-09-07 00:19 to 13:49 7,692 self-triggered turns, zero user input
    2026-09-07 13:49:18 Loop stops because the weekly quota is exhausted

    That is one turn every 6.3 seconds for 13.5 hours.

    What it emitted after the stop instruction

    From the session rollout, assistant messages in the loop window:

    • 7,692 task_started events
    • 11 distinct assistant outputs total
    • 7,682 of them were empty strings
    • the remainder were single lines: "Paused.", "Paused as requested.", etc...

    Cost

    From token_usage_record.thread_token_usage in the rollout file:

    Tokens
    Cumulative at the moment I said stop 88,619,878
    Cumulative when the loop died 1,130,337,577
    Billed after the stop instruction 1,041,717,699
    Output tokens in that window 173,389 (almost all empty responses)

    92.2 percent of the thread's lifetime token consumption happened after I asked the agent to stop. The requested work was finished, validated and documented before the loop began.

    Two things that make this expensive rather than just annoying

    1. An empty response does not terminate the loop. 7,682 consecutive empty assistant messages, each one a fully billed turn. The loop has no notion of "the model has nothing to say."
    2. Auto-compaction fires inside the loop. 47 compactions in that window, each re-submitting full context. So the loop gets more expensive the longer it runs instead of degrading toward nothing. That is what turns 88M tokens into 1.13B.

    Suggested termination conditions

    Any one of these would have caught it:

    • model returns an empty response, especially N times consecutively
    • user issues a stop instruction and the agent acknowledges it
    • the same short response repeats N times with no tool calls and no state change
    • a per-goal turn budget or token budget is exceeded

    The last one seems worth having regardless, since the current behavior has no ceiling short of the account's quota.

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions