Codex agents incorrectly stop or declare completion while tasks are still incomplete

Open 💬 2 comments Opened Aug 27, 2026 by tamnhi3009
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex CLI is running?

0.150.1

What subscription do you have?

Plus

Which model were you using?

gpt-5.6-terra > gpt-5.6-sol

What platform is your computer?

WSL

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

_No response_

Codex doctor report

{
  "schemaVersion": 1,
  "generatedAt": "1787852709s since unix epoch",
  "overallStatus": "ok",
  "codexVersion": "0.150.1",
  "checks": {
    "app_server.status": {
      "id": "app_server.status",
      "category": "app-server",
      "status": "ok",
      "summary": "background server is not running",
      "details": {
        "control socket": "/home/thanhtam23/.codex/app-server-control/app-server-control.sock",
        "daemon state dir": "/home/thanhtam23/.codex/app-server-daemon",
        "mode": "ephemeral",
        "pid file": "/home/thanhtam23/.codex/app-server-daemon/app-server.pid (missing)",
        "settings": "/home/thanhtam23/.codex/app-server-daemon/settings.json (missing)",
        "status": "not running",
        "update-loop pid file": "/home/thanhtam23/.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/thanhtam23/.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/thanhtam23/.codex",
        "config.toml": "/home/thanhtam23/.codex/config.toml",
        "config.toml parse": "ok",
        "cwd": "/home/thanhtam23/projects/tastet",
        "enabled feature flags": "shell_tool, view_image, unified_exec, unified_exec_zsh_fork, shell_snapshot, code_mode_host, terminal_resize_reflow, sqlite, hooks, enable_request_compression, unbounded_connection_retries, multi_agent, apps, tool_search_always_defer_mcp_tools, tool_suggest, plugins, in_app_browser, in_app_chat, in_app_dictation, in_app_local_automation, 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, compaction_image_budget, workspace_dependencies",
        "feature flag overrides": "none",
        "feature flags enabled": "45",
        "log dir": "/home/thanhtam23/.codex/log",
        "mcp servers": "0",
        "model": "gpt-5.6-sol",
        "model provider": "openai",
        "sqlite home": "/home/thanhtam23/.codex"
      },
      "remediation": null,
      "durationMs": 0
    },
    "git.environment": {
      "id": "git.environment",
      "category": "git",
      "status": "ok",
      "summary": "git version 2.43.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.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": "true",
        "repo root": "/home/thanhtam23/projects/tastet",
        "selected git": "/usr/bin/git"
      },
      "remediation": null,
      "durationMs": 297
    },
    "installation": {
      "id": "installation",
      "category": "install",
      "status": "ok",
      "summary": "installation looks consistent",
      "details": {
        "PATH codex #1": "/home/thanhtam23/.npm-global/bin/codex",
        "current executable": "/home/thanhtam23/.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/thanhtam23/.npm-global/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl, bin /home/thanhtam23/.npm-global/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/bin, resources /home/thanhtam23/.npm-global/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/codex-resources, path /home/thanhtam23/.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/thanhtam23/.npm-global/lib/node_modules/@openai/codex",
        "npm update target": "/home/thanhtam23/.npm-global/lib/node_modules/@openai/codex"
      },
      "remediation": null,
      "durationMs": 183
    },
    "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": {
        "managed proxy": "not configured",
        "proxy env vars": "none",
        "respect system proxy": "disabled"
      },
      "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 inference URL": "https://chatgpt.com/backend-api/<redacted> reachable (HTTP 405)",
        "reachability mode": "ChatGPT auth"
      },
      "remediation": null,
      "durationMs": 362
    },
    "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",
        "provider name": "OpenAI",
        "proxy env vars": "none",
        "reasoning header": "false",
        "server model present": "false",
        "supports websockets": "true",
        "wire API": "responses"
      },
      "remediation": null,
      "durationMs": 975
    },
    "runtime.provenance": {
      "id": "runtime.provenance",
      "category": "runtime",
      "status": "ok",
      "summary": "running npm on linux-x86_64",
      "details": {
        "commit": "unknown",
        "current executable": "/home/thanhtam23/.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/thanhtam23/.npm-global/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl, bin /home/thanhtam23/.npm-global/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/bin, resources /home/thanhtam23/.npm-global/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/codex-resources, path /home/thanhtam23/.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.150.1"
      },
      "remediation": null,
      "durationMs": 0
    },
    "runtime.search": {
      "id": "runtime.search",
      "category": "search",
      "status": "ok",
      "summary": "search is OK (bundled)",
      "details": {
        "search command": "/home/thanhtam23/.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": "OnRequest",
        "codex-linux-sandbox helper": "/home/thanhtam23/.codex/tmp/arg0/codex-arg0sHNqLZ/codex-linux-sandbox",
        "execve wrapper helper": "/home/thanhtam23/.codex/tmp/arg0/codex-arg0sHNqLZ/codex-execve-wrapper",
        "filesystem sandbox": "restricted",
        "network sandbox": "restricted"
      },
      "remediation": null,
      "durationMs": 0
    },
    "security.endpoint": {
      "id": "security.endpoint",
      "category": "security",
      "status": "ok",
      "summary": "endpoint protection is not inspected on this platform",
      "details": {
        "endpoint products": "not inspected on this platform"
      },
      "remediation": null,
      "durationMs": 0
    },
    "state.paths": {
      "id": "state.paths",
      "category": "state",
      "status": "ok",
      "summary": "state paths and databases are inspectable",
      "details": {
        "CODEX_HOME": "/home/thanhtam23/.codex (dir)",
        "active rollout files": "550 files, 1045580917 total bytes, 1901056 average bytes",
        "archived rollout files": "0 files, 0 total bytes, 0 average bytes",
        "goals DB": "/home/thanhtam23/.codex/goals_1.sqlite (file)",
        "goals DB integrity": "ok",
        "log DB": "/home/thanhtam23/.codex/logs_2.sqlite (file)",
        "log DB integrity": "ok",
        "log dir": "/home/thanhtam23/.codex/log (dir)",
        "memories DB": "/home/thanhtam23/.codex/memories_1.sqlite (file)",
        "memories DB integrity": "ok",
        "queue DB": "/home/thanhtam23/.codex/queue_1.sqlite (file)",
        "queue DB integrity": "ok",
        "sqlite home": "/home/thanhtam23/.codex (dir)",
        "state DB": "/home/thanhtam23/.codex/state_5.sqlite (file)",
        "state DB integrity": "ok",
        "thread history DB": "/home/thanhtam23/.codex/thread_history_1.sqlite (file)",
        "thread history DB integrity": "ok"
      },
      "remediation": null,
      "durationMs": 788
    },
    "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": "550",
        "rollout DB active rows": "550",
        "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=550",
        "rollout DB rows": "550",
        "rollout DB scan cap reached": "false",
        "rollout DB scan errors": "0",
        "rollout DB sources": "cli=423, subagent:thread_spawn=127",
        "rollout DB stale rows": "0"
      },
      "remediation": null,
      "durationMs": 751
    },
    "system.disk": {
      "id": "system.disk",
      "category": "disk",
      "status": "ok",
      "summary": "sufficient free disk space (912.5 GiB)",
      "details": {
        "CODEX_HOME available": "912.5 GiB",
        "failure threshold": "1.0 GiB",
        "warning threshold": "5.0 GiB",
        "worktree available": "912.5 GiB"
      },
      "remediation": null,
      "durationMs": 0
    },
    "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": 18
    },
    "terminal.env": {
      "id": "terminal.env",
      "category": "terminal",
      "status": "ok",
      "summary": "terminal metadata was detected",
      "details": {
        "DISPLAY": "present",
        "TERM": "xterm-256color",
        "WAYLAND_DISPLAY": "present",
        "WSL_DISTRO_NAME": "present",
        "WSL_INTEROP": "present",
        "color output": "enabled",
        "effective locale": "C.UTF-8",
        "stderr is terminal": "true",
        "stdin is terminal": "true",
        "stdout is terminal": "true",
        "terminal": "unknown",
        "terminal size": "120x30"
      },
      "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": "tastet",
        "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.150.1",
        "check for update on startup": "true",
        "last checked at": "2026-08-27T17:17:30.318124844Z",
        "latest version": "0.150.1",
        "latest version status": "current version is not older",
        "npm update target": "/home/thanhtam23/.npm-global/lib/node_modules/@openai/codex",
        "update action": "npm install -g @openai/codex",
        "version cache": "/home/thanhtam23/.codex/version.json"
      },
      "remediation": null,
      "durationMs": 739
    }
  }
}

What issue are you seeing?

I am seeing a recurring reliability problem with Codex determining whether a software-engineering task is actually complete.

In the same large, cross-cutting story, I observed two opposite failure modes:

  • GPT-5.6 Terra: correctly knew substantial work remained, but repeatedly stopped anyway.
  • GPT-5.6 Sol: continued working to the end, but declared the story complete despite unmet acceptance criteria and a failing required repository check.

This is not a complaint that AI-generated code requires review. I expect review. The problem is that the agent's own determination of "done" is unreliable.

Terra: stops despite knowing the task is incomplete

Terra stopped partway through the story and explicitly acknowledged that major implementation work and required tests remained.

It also acknowledged there was no blocker and that it should have continued.

After I explicitly told it to continue, it performed a small amount of additional work, reported that other parts were still "in progress," and stopped again.

The model therefore appeared to understand the state of the task correctly but treated an intermediate milestone as a valid termination point.

Sol: declares completion without verifying completion

I switched to Sol in the same context and asked it to continue.

Sol was much better at persistence and continued until it considered the story complete.

However, an independent code-review pass against the original story found eight missing or broken requirements, including several basic user workflows.

It also found that an existing mandatory repository build check was failing.

After receiving this feedback, Sol itself acknowledged that when it moved the story to review:

  • Several explicit acceptance criteria were not implemented.
  • The story checklist was still incomplete.
  • A required production build had not passed.
  • It had not verified each acceptance criterion against the finished behavior.
  • It had substituted narrower tests for a required repository gate without establishing equivalence.
  • Some unmet requirements had been documented as deviations rather than treated as unfinished work.

In other words, this was not simply a case where subtle defects escaped review. There was already evidence available to the agent that the task was not complete.

Why this matters

The independent reviewer was also an AI.

I fully expect AI-generated software to require review, just as human-written software does. But review should be an additional quality layer, not the mechanism required to determine whether the implementing agent actually completed the explicitly assigned work.

Another AI, given the original story and resulting implementation, was readily able to identify the unmet requirements and failing repository gate.

For an autonomous coding agent handling an engineering story end-to-end, I would expect "done" to require at minimum:

  • All explicit acceptance criteria accounted for.
  • Required repository/build/test gates passing.
  • Major end-to-end workflows verified.
  • No known unfinished checklist items.
  • No known unmet requirements represented merely as deviations.
  • Continued autonomous work whenever actionable work remains and no user decision or external blocker is required.

The two models exhibited opposite versions of the same underlying problem:

Terra: knows the task is incomplete, but stops.

Sol: knows or has evidence that the task is incomplete, but declares completion.

For long-running engineering work, reliable completion detection and self-verification are as important as raw coding capability. A user should be able to distinguish between "the agent reached an intermediate checkpoint" and "the assigned story has actually been completed and is ready for review."

What steps can reproduce the bug?

Uploaded thread: 01a043ec-ba0d-7e71-ab17-ba1fdf2456a9

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 17 hours ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #40938
  • #40139
  • #39948
  • #40646
  • #40560

Powered by Codex Action

byte271 · 10 hours ago

I audited the goal lifecycle on current openai/codex main (41d3dc56a0, #41239) because this report looks like more than a model-behavior problem.

update_goal currently accepts Complete / Blocked in handle_update and persists the new goal state without first checking for live unified-exec processes or non-terminal child agents:

https://github.com/openai/codex/blob/41d3dc56a0e1de47e30a9585c1b49253c082f8f7/codex-rs/ext/goal/src/tool.rs#L234-L247

That creates a concrete lifecycle hole: goal completion and process/subagent completion are separate authorities. A model can therefore legitimately call update_goal(Complete) while work represented elsewhere is still non-terminal.

I built a small observation/reducer experiment for this invariant:

cd codex-agent-kernel
cargo run -p codex-kernel-cli -- experiment goal-complete

The disagreement is reported as goal_complete_unfinished_work.

The minimal invariant I would expect is: before persisting Complete, reject completion while the thread still owns a live process or a non-terminal child. This also keeps MODEL_FINISHED_TURN distinct from GOAL_COMPLETED.

Full RCA / reproducible artifact: https://github.com/byte271/codex/blob/main/codex-agent-kernel/docs/UPSTREAM.md

This is root-cause evidence for the issue, not an external code PR.