Windows CLI: completed goals cannot be cleared by the agent; add clear_goal or auto-clear on completion
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_goalcan show no active goal.create_goalcan create a goal.update_goal({"status":"complete"})can mark it complete.get_goalstill returns that completed goal.- A fresh
create_goalthen 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_goalwith any throwaway objective. - Call
update_goal({"status":"complete"}). - Call
get_goalagain -> the same goal is still present withstatus: "complete". - Call
create_goalagain -> 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_goaltool 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_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:
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, build26200,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 --jsonreports: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:
- #24094 covers sessions where goal tools are not exposed at all.
- #24423 covers app-side
/goal clearfailures. - This request is narrower: in a Windows CLI session where goal tools are exposed and
update_goal(status="complete")works, there is still no way for the agent to clear the completed goal from thread state.