Skip to content

Windows CLI: completed goals cannot be cleared by the agent; add clear_goal or auto-clear on completion #24978

@i-dedova

Description

@i-dedova

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:

  1. get_goal can show no active goal.
  2. create_goal can create a goal.
  3. update_goal({"status":"complete"}) can mark it complete.
  4. get_goal still returns that completed goal.
  5. 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:

  1. Start from a thread with no goal.
  2. Call get_goal -> null.
  3. Call create_goal with any throwaway objective.
  4. Call update_goal({"status":"complete"}).
  5. Call get_goal again -> the same goal is still present with status: "complete".
  6. 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:

  1. Add an explicit clear_goal tool to the agent-visible tool surface.
  2. If a separate tool is not desired, make update_goal({"status":"complete"}) unload/clear the goal from the thread.
  3. 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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions