What variant of Codex are you using?
CLI (Windows)
What feature would you like to see?
Please expose an agent-facing clear_goal / delete_goal / reset_goal tool in the Windows Codex CLI, or otherwise make completed goals auto-clear from thread state so the agent can fully close the goal lifecycle.
Right now the lifecycle is incomplete from inside the agent:
get_goal can show no active goal.
create_goal can create a goal.
update_goal({"status":"complete"}) can mark it complete.
get_goal still returns that completed goal.
- A fresh
create_goal then fails because the thread still "already has a goal".
In the current tool surface there is no separate clear_goal, delete_goal, or reset_goal operation, and update_goal only supports complete and blocked. That means the agent can complete a goal but cannot actually remove it from the thread on its own.
Concrete repro from a Windows CLI session:
- Start from a thread with no goal.
- Call
get_goal -> null.
- Call
create_goal with any throwaway objective.
- Call
update_goal({"status":"complete"}).
- Call
get_goal again -> the same goal is still present with status: "complete".
- Call
create_goal again -> it fails with:
cannot create a new goal because this thread already has a goal; use update_goal only when the existing goal is complete
That leaves the thread in a stuck state from the agent's perspective: the goal is achieved, but it is not cleared, and the agent cannot start a replacement goal.
Requested behavior, in order of preference:
- Add an explicit
clear_goal tool to the agent-visible tool surface.
- If a separate tool is not desired, make
update_goal({"status":"complete"}) unload/clear the goal from the thread.
- At minimum, allow
create_goal to succeed once the prior goal is already complete.
This would bring the CLI closer to the desktop-app behavior the user sees locally, where achieved goals auto-clear instead of lingering indefinitely in thread state.
Additional information
Environment captured on 2026-05-28 from the affected Windows CLI install:
- Codex CLI:
codex-cli 0.133.0-alpha.1
- CLI executable:
C:\Users\innad\AppData\Local\OpenAI\Codex\bin\3f4fb8cdd344abc7\codex.exe
- Product version / file version:
0.133.0-alpha.1
- Platform string:
Microsoft Windows NT 10.0.26200.0 x64
- OS:
Microsoft Windows 11 Pro, build 26200, WindowsBuildLabEx=26100.1.amd64fre.ge_release.240331-1435
- Shell:
PowerShell 7.6.0 (PSEdition=Core)
- Terminal context: Zed integrated terminal
- Terminal env:
TERM_PROGRAM=zed, TERM=xterm-256color, COLORTERM=truecolor
- Terminal version from
codex doctor --json: 1.4.2+stable.292.ce85db149e4b1125769e8e4fc9f5f7f7c07ac7de
- Parent process for shell commands inside the session:
codex.exe
codex doctor --json reports:
goals=true
- current executable =
C:\Users\innad\AppData\Local\OpenAI\Codex\bin\3f4fb8cdd344abc7\codex.exe
- install context =
other
- managed by npm =
false
- managed by bun =
false
- update action =
manual or unknown
- latest version =
0.135.0
- app-server mode =
ephemeral, background server not running
User context worth preserving:
- This CLI install is updated through the Windows desktop-app distribution path rather than npm/bun.
- On this user's Windows desktop app surface, achieved goals auto-clear; the request here is CLI parity so the agent can clear or replace a completed goal without outside intervention.
Related but not identical issues:
What variant of Codex are you using?
CLI (Windows)
What feature would you like to see?
Please expose an agent-facing
clear_goal/delete_goal/reset_goaltool in the Windows Codex CLI, or otherwise make completed goals auto-clear from thread state so the agent can fully close the goal lifecycle.Right now the lifecycle is incomplete from inside the agent:
get_goalcan show no active goal.create_goalcan create a goal.update_goal({"status":"complete"})can mark it complete.get_goalstill returns that completed goal.create_goalthen fails because the thread still "already has a goal".In the current tool surface there is no separate
clear_goal,delete_goal, orreset_goaloperation, andupdate_goalonly supportscompleteandblocked. That means the agent can complete a goal but cannot actually remove it from the thread on its own.Concrete repro from a Windows CLI session:
get_goal->null.create_goalwith any throwaway objective.update_goal({"status":"complete"}).get_goalagain -> the same goal is still present withstatus: "complete".create_goalagain -> it fails with:That leaves the thread in a stuck state from the agent's perspective: the goal is achieved, but it is not cleared, and the agent cannot start a replacement goal.
Requested behavior, in order of preference:
clear_goaltool to the agent-visible tool surface.update_goal({"status":"complete"})unload/clear the goal from the thread.create_goalto succeed once the prior goal is alreadycomplete.This would bring the CLI closer to the desktop-app behavior the user sees locally, where achieved goals auto-clear instead of lingering indefinitely in thread state.
Additional information
Environment captured on 2026-05-28 from the affected Windows CLI install:
codex-cli 0.133.0-alpha.1C:\Users\innad\AppData\Local\OpenAI\Codex\bin\3f4fb8cdd344abc7\codex.exe0.133.0-alpha.1Microsoft Windows NT 10.0.26200.0 x64Microsoft Windows 11 Pro, build26200,WindowsBuildLabEx=26100.1.amd64fre.ge_release.240331-1435PowerShell 7.6.0(PSEdition=Core)TERM_PROGRAM=zed,TERM=xterm-256color,COLORTERM=truecolorcodex doctor --json:1.4.2+stable.292.ce85db149e4b1125769e8e4fc9f5f7f7c07ac7decodex.execodex doctor --jsonreports:goals=trueC:\Users\innad\AppData\Local\OpenAI\Codex\bin\3f4fb8cdd344abc7\codex.exeotherfalsefalsemanual or unknown0.135.0ephemeral, background server not runningUser context worth preserving:
Related but not identical issues:
/goal clearfailures.update_goal(status="complete")works, there is still no way for the agent to clear the completed goal from thread state.