Codex entered a repetitive output loop without making meaningful progress

Open 💬 4 comments Opened Jul 11, 2026 by kgbook

What version of Codex CLI is running?

0.144.1

What subscription do you have?

plus

Which model were you using?

gpt-5.6-terra medium

What platform is your computer?

debian 13

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

Konsole

Codex doctor report

codex doctor --json
{
  "schemaVersion": 1,
  "generatedAt": "1783776935s since unix epoch",
  "overallStatus": "warning",
  "codexVersion": "0.144.1",
  "checks": {
    "app_server.status": {
      "id": "app_server.status",
      "category": "app-server",
      "status": "ok",
      "summary": "background server is not running",
      "details": {
        "control socket": "/home/<USER>/.codex/app-server-control/app-server-control.sock",
        "daemon state dir": "/home/<USER>/.codex/app-server-daemon",
        "mode": "ephemeral",
        "pid file": "/home/<USER>/.codex/app-server-daemon/app-server.pid (missing)",
        "settings": "/home/<USER>/.codex/app-server-daemon/settings.json (missing)",
        "status": "not running",
        "update-loop pid file": "/home/<USER>/.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": "/home/<USER>/.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": "/home/<USER>/.codex",
        "config.toml": "/home/<USER>/.codex/config.toml",
        "config.toml parse": "ok",
        "cwd": "/home/<USER>/workspace/me/av/<PROJECT>",
        "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, browser_use, browser_use_full_cdp_access, browser_use_external, computer_use, remote_plugin, plugin_sharing, image_generation, resize_all_images, skill_mcp_dependency_install, 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": "35",
        "log dir": "/home/<USER>/.codex/log",
        "mcp servers": "0",
        "model": "gpt-5.6-terra",
        "model provider": "openai",
        "sqlite home": "/home/<USER>/.codex"
      },
      "remediation": null,
      "durationMs": 0
    },
    "git.environment": {
      "id": "git.environment",
      "category": "git",
      "status": "ok",
      "summary": "git version 2.52.0",
      "details": {
        ".git entry": "directory",
        "PATH git #1": "/usr/bin/git",
        "PATH git #2": "/bin/git",
        "PATH git entries": "2",
        "git branch": "main",
        "git build options": "git version 2.52.0; cpu: x86_64; no commit associated with this build; sizeof-long: 8; sizeof-size_t: 8; shell-path: /bin/sh; rust: disabled; libcurl: 7.81.0; zlib: 1.2.11; SHA-1: SHA1_DC; SHA-256: SHA256_BLK; default-ref-format: files; default-hash: sha1",
        "git exec path": "/usr/lib/git-core",
        "git version": "git version 2.52.0",
        "repo detected": "true",
        "repo root": "/home/<USER>/workspace/me/av/<PROJECT>",
        "selected git": "/usr/bin/git"
      },
      "remediation": null,
      "durationMs": 113
    },
    "installation": {
      "id": "installation",
      "category": "install",
      "status": "ok",
      "summary": "installation looks consistent",
      "details": {
        "PATH codex #1": "/home/<USER>/.npm-global/bin/codex",
        "PATH codex #2": "/usr/bin/codex",
        "PATH codex #3": "/bin/codex",
        "PATH codex entries": "3",
        "current executable": "/home/<USER>/.npm-global/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/bin/codex",
        "install context": "npm (package /home/<USER>/.npm-global/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl, bin /home/<USER>/.npm-global/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/bin, resources /home/<USER>/.npm-global/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/codex-resources, path /home/<USER>/.npm-global/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/codex-path)",
        "managed by bun": "false",
        "managed by npm": "true",
        "managed by pnpm": "false",
        "managed package root": "/home/<USER>/.npm-global/lib/node_modules/@openai/codex",
        "npm update target": "/home/<USER>/.npm-global/lib/node_modules/@openai/codex"
      },
      "remediation": null,
      "durationMs": 490
    },
    "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": 543
    },
    "network.websocket_reachability": {
      "id": "network.websocket_reachability",
      "category": "websocket",
      "status": "ok",
      "summary": "Responses WebSocket handshake succeeded",
      "details": {
        "DNS": "1 IPv4, 0 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": 1689
    },
    "runtime.provenance": {
      "id": "runtime.provenance",
      "category": "runtime",
      "status": "ok",
      "summary": "running npm on linux-x86_64",
      "details": {
        "commit": "unknown",
        "current executable": "/home/<USER>/.npm-global/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/bin/codex",
        "install method": "npm (package /home/<USER>/.npm-global/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl, bin /home/<USER>/.npm-global/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/bin, resources /home/<USER>/.npm-global/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/codex-resources, path /home/<USER>/.npm-global/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/codex-path)",
        "platform": "linux-x86_64",
        "version": "0.144.1"
      },
      "remediation": null,
      "durationMs": 0
    },
    "runtime.search": {
      "id": "runtime.search",
      "category": "search",
      "status": "ok",
      "summary": "search is OK (bundled)",
      "details": {
        "search command": "/home/<USER>/.npm-global/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/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": "Never",
        "codex-linux-sandbox helper": "/home/<USER>/.codex/tmp/arg0/codex-arg0tg4W1s/codex-linux-sandbox",
        "execve wrapper helper": "/home/<USER>/.codex/tmp/arg0/codex-arg0tg4W1s/codex-execve-wrapper",
        "filesystem sandbox": "unrestricted",
        "network sandbox": "enabled"
      },
      "remediation": null,
      "durationMs": 0
    },
    "state.paths": {
      "id": "state.paths",
      "category": "state",
      "status": "ok",
      "summary": "state paths and databases are inspectable",
      "details": {
        "CODEX_HOME": "/home/<USER>/.codex (dir)",
        "active rollout files": "172 files, 202180622 total bytes, 1175468 average bytes",
        "archived rollout files": "0 files, 0 total bytes, 0 average bytes",
        "goals DB": "/home/<USER>/.codex/goals_1.sqlite (file)",
        "goals DB integrity": "ok",
        "log DB": "/home/<USER>/.codex/logs_2.sqlite (file)",
        "log DB integrity": "ok",
        "log dir": "/home/<USER>/.codex/log (dir)",
        "memories DB": "/home/<USER>/.codex/memories_1.sqlite (file)",
        "memories DB integrity": "ok",
        "sqlite home": "/home/<USER>/.codex (dir)",
        "state DB": "/home/<USER>/.codex/state_5.sqlite (file)",
        "state DB integrity": "ok"
      },
      "remediation": null,
      "durationMs": 17993
    },
    "state.rollout_db_parity": {
      "id": "state.rollout_db_parity",
      "category": "threads",
      "status": "warning",
      "summary": "rollout files and state DB thread inventory differ",
      "details": {
        "default model provider": "openai",
        "rollout DB active files": "172",
        "rollout DB active rows": "128",
        "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": "44",
        "rollout DB missing active sample": [
          "/home/<USER>/.codex/sessions/2026/03/29/rollout-2026-03-29T16-20-32-019d38ae-2d1b-7611-b342-5410803d860c.jsonl",
          "/home/<USER>/.codex/sessions/2026/04/17/rollout-2026-04-17T10-26-41-019d9943-0ce4-7441-8446-f2702f97bea0.jsonl",
          "/home/<USER>/.codex/sessions/2026/04/10/rollout-2026-04-10T15-30-26-019d764c-a1ac-7170-b23e-2cf736b2e305.jsonl",
          "/home/<USER>/.codex/sessions/2026/04/10/rollout-2026-04-10T16-12-30-019d7673-22fb-7211-9054-c70dd4f3b1b6.jsonl",
          "/home/<USER>/.codex/sessions/2026/04/14/rollout-2026-04-14T11-09-12-019d89f6-e4a0-7fd0-bae5-ce4259609eb4.jsonl"
        ],
        "rollout DB missing archived rows": "0",
        "rollout DB model providers": "openai=128",
        "rollout DB rows": "128",
        "rollout DB scan cap reached": "false",
        "rollout DB scan errors": "0",
        "rollout DB sources": "cli=122, subagent:thread_spawn=5, exec=1",
        "rollout DB stale rows": "0"
      },
      "issues": [
        {
          "severity": "warning",
          "cause": "rollout files are missing from the state DB",
          "measured": "44 active, 0 archived",
          "expected": "every rollout file has a matching threads row",
          "remedy": null,
          "fields": []
        }
      ],
      "remediation": null,
      "durationMs": 13759
    },
    "system.environment": {
      "id": "system.environment",
      "category": "system",
      "status": "ok",
      "summary": "OS language zh-CN",
      "details": {
        "EDITOR": "not set",
        "LANG": "zh_CN.UTF-8",
        "LC_CTYPE": "zh_CN.UTF-8",
        "LESS": "set",
        "PAGER": "set",
        "VISUAL": "not set",
        "os": "Debian 13.0.0 (trixie) [64-bit]",
        "os language": "zh-CN",
        "os type": "Debian",
        "os version": "13.0.0"
      },
      "remediation": null,
      "durationMs": 7
    },
    "terminal.env": {
      "id": "terminal.env",
      "category": "terminal",
      "status": "ok",
      "summary": "terminal metadata was detected",
      "details": {
        "COLORFGBG": "15;0",
        "COLORTERM": "truecolor",
        "DISPLAY": "present",
        "color output": "enabled",
        "effective locale": "zh_CN.UTF-8",
        "stderr is terminal": "true",
        "stdin is terminal": "true",
        "stdout is terminal": "true",
        "terminal": "Konsole",
        "terminal size": "316x85",
        "terminal version": "250402"
      },
      "remediation": null,
      "durationMs": 0
    },
    "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": "git repo root",
        "terminal title project value": "<PROJECT>",
        "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.144.1",
        "check for update on startup": "true",
        "last checked at": "2026-07-11T02:36:58.694450442Z",
        "latest version": "0.144.1",
        "latest version status": "current version is not older",
        "npm update target": "/home/<USER>/.npm-global/lib/node_modules/@openai/codex",
        "update action": "npm install -g @openai/codex",
        "version cache": "/home/<USER>/.codex/version.json"
      },
      "remediation": null,
      "durationMs": 1021
    }
  }
}

What issue are you seeing?

Codex entered a repetitive output loop while executing a code refactoring task initiated with the /goal command. It repeatedly generated the same message, “继续按上述边界整改。”, without making meaningful progress on the refactoring task.

Despite producing no useful result, the session continued consuming my 5-hour usage allowance until the limit was fully exhausted.

This appears to be a model or agent execution failure rather than normal usage. Please review the attached screenshot

Plan: ChatGPT Plus
Date of incident: July 11, 2026
Codex version: 0.144.1
Model: GPT-5.6 Terra, Medium reasoning effort
Command/workflow: /goal — code refactoring task
Environment: Debian Linux, Codex CLI

The relevant session ID and diagnostic details have already been provided in the attached codex doctor --json output. Please review those logs together with the screenshot when investigating the incident.

What steps can reproduce the bug?

  1. Launch Codex CLI 0.144.1 on Debian Linux.
  2. Open a C/C++ project and select GPT-5.6 Terra with Medium reasoning effort.
  3. Run the /goal command and assign Codex a code-refactoring task with defined scope and constraints.
  4. Allow Codex to inspect the repository, modify the code, and perform its initial refactoring pass.
  5. Ask Codex to fix the module boundaries and relocate shared types, PacingClock, and codec config to the appropriate modules.
  6. Codex may then enter a repetitive output loop, repeatedly generating the same sentence without performing additional file edits, tool calls, tests, or other meaningful work.
  7. The loop continues consuming the 5-hour usage allowance until the usage limit is exhausted.

What is the expected behavior?

No fucking repetitive output!

Additional information

<img width="1574" height="1137" alt="Image" src="https://github.com/user-attachments/assets/7f09f086-816c-4d60-af22-e0acc117ec79" />

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗