Expose Goal controls outside the interactive TUI, both for external automation and agent-side workflows.
What variant of Codex are you using?
CLI
What feature would you like to see?
Feature request: expose Goal controls outside the interactive TUI, both for external automation and agent-side workflows.
Current behavior:
/goal resumeworks in the interactive TUI.codex exec resume <SESSION_ID> "resume the goal..."resumes the thread, but does not flip the internal Goal state from paused/blocked to active.- Prompting the agent to resume the goal is therefore not equivalent to the
/goal resumeslash command. - The agent can call
get_goal()and observe goal status, timeUsedSeconds, tokensUsed, etc., but cannot resume or pause the goal through a tool.
Why this matters:
I want to automate long-running Goal work while respecting usage/rate limits. The clean path would be a scheduler or codex exec resume, but Goal mode currently requires manual TUI intervention to resume.
Without a noninteractive Goal control, the fallback is brittle UI automation such as sleeping and using xdotool to type /goal resume into the TUI.
Requested external/API surface:
Please add documented noninteractive Goal commands, for example:
codex goal status <SESSION_ID> --jsoncodex goal resume <SESSION_ID>codex goal pause <SESSION_ID>codex goal clear <SESSION_ID>
Or equivalent flags on codex exec resume, for example:
codex exec resume <SESSION_ID> --goal-resume "continue working..."codex exec resume <SESSION_ID> --goal-status --json
Requested agent-side tool surface:
Please also consider exposing Goal lifecycle tools to the agent, complementing the existing get_goal() tool:
resume_goal()pause_goal()- possibly
clear_goal() - possibly
get_usage()/get_rate_limits()for the same data shown by/statusor/usage
Useful semantics:
resume_goal()should resume an existing paused/blocked goal without changing the objective.pause_goal()should pause work without marking the goal complete or blocked.- These tools should return the same accounting fields as
get_goal(), including status, timeUsedSeconds, tokensUsed, and objective. - They should be available in both interactive sessions and
codex exec resumeruns, subject to policy. - Transitions should be auditable in the transcript, like
update_goal.
Concrete use case:
A user wants to run bounded unattended Goal work from cron/systemd or another scheduler:
- Resume the saved Codex thread.
- Resume the existing Goal.
- Let the agent work for a user-defined slice, e.g. 20 minutes of Goal time.
- Have the agent pause/stop before the cap.
- Repeat later when rate limits have reset.
Today, step 2 requires the TUI slash command or app UI. A first-class CLI/API/tool surface would make this workflow reliable without UI automation.
Additional information
Codex wrote the feature request, but I reviewed it and LGTM. Whole point was to really push the /goalmaxxing to its logical (and perhaps absurd but we'll see 😄) conclusion, hahaha!
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗