/goal rejects long pasted input before Codex can normalize the objective
What version of Codex CLI is running?
codex-cli 0.128.0
What subscription do you have?
Pro
Which model were you using?
GPT-5.5 xhigh
What platform is your computer?
Darwin 25.2.0 arm64 arm
What terminal emulator and version are you using (if applicable)?
Codex CLI/TUI. Terminal emulator should not affect this path.
What issue are you seeing?
The /goal slash command currently treats the slash-command argument as the final persisted ThreadGoal.objective and rejects it when the expanded objective exceeds MAX_THREAD_GOAL_OBJECTIVE_CHARS (4,000 chars).
That makes long pasted input unusable as the argument to /goal, even when the user intent is reasonable: paste a detailed task brief and let Codex turn it into a concise persisted goal. The current behavior blocks that flow before the model has a chance to normalize the source into a shorter goal.
The 4,000-character cap makes sense for the stored thread goal because it is persisted and repeatedly reinjected. It is less clear that the same cap should apply to raw user-provided /goal source text.
What steps can reproduce the bug?
- Enable the goals feature.
- Start a Codex CLI/TUI thread.
- Paste or type a
/goalcommand whose expanded argument is longer than 4,000 characters, for example:
/goal <paste a detailed task brief longer than 4000 chars>
- Submit the command.
Current result: the TUI rejects the input and does not send anything to the model.
What is the expected behavior?
ThreadGoal.objective should stay bounded, but oversized raw /goal source text should be handled as source material for goal creation, not as the final stored objective.
A better flow would be:
- If the expanded
/goalargument is within the persisted objective limit, set the goal directly as today. - If the expanded argument exceeds the persisted objective limit but still fits a normal user turn, send a one-shot model turn asking Codex to normalize the source and call
create_goalwith a concise objective. - If the raw source is too large even for that normalization prompt, reject with a goal-specific error and preserve the pasted draft where possible.
Additional information
I have a proposed fix prepared in a fork branch, but this account could not open a PR against openai/codex via gh because GitHub rejected CreatePullRequest for the upstream repo.
Patch branch:
https://github.com/trevorprater/codex/tree/codex/normalize-long-goal-input
Upstream compare URL:
https://github.com/openai/codex/compare/main...trevorprater:codex/normalize-long-goal-input?expand=1
Fork draft PR carrying the patch:
https://github.com/trevorprater/codex/pull/1
Local validation on that branch:
just fmt
cargo test -p codex-tui goal_validation
cargo test -p codex-tui
just fix -p codex-tui
5 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Thanks for reporting. This is already fixed on the main branch, and the fix will be included in 0.129.0.
Thanks. I fetched current
origin/mainat001363188aand I think #20746 fixed a related UX issue, but not the behavior reported here.On current
main,codex-rs/tui/src/chatwidget/goal_validation.rsstill rejects expanded/goalinput whenactual_chars > MAX_THREAD_GOAL_OBJECTIVE_CHARS, andcodex-rs/tui/src/chatwidget/slash_dispatch.rsstill runs that validation before anything is sent to the model. The tests also still assert oversized/goalinput is rejected (goal_slash_command_rejects_oversized_objective,goal_slash_command_rejects_large_paste_using_expanded_length, and the queued variant).The issue I am reporting is narrower: the raw
/goalargument is being treated as the final persistedThreadGoal.objective. I agree the persisted goal should stay bounded, but long raw source text should be eligible for a one-shot model normalization turn that callscreate_goalwith a concise objective.Is there another unreleased commit not visible on public
main, or would you consider the normalization flow in this compare?https://github.com/openai/codex/compare/main...trevorprater:codex/normalize-long-goal-input?expand=1
The
/goalfeature is designed to support a limited-sized objective. If you have an objective that's longer than 4000 characters, you should write the objective to a file and refer to the file in the objective. The change in PR #20746 provides this guidance.Ok, thank you.
On Thu, May 7, 2026 at 2:42 AM Eric Traut @.***> wrote: