Request review path for AI goal replacement guidance

Resolved 💬 1 comment Opened May 18, 2026 by lidge-jun Closed May 18, 2026

Summary

I prepared a small patch for the Goals UX, but opening a PR from my fork is blocked by the repository policy:

An owner of this repository has limited the ability to open a pull request to users that are collaborators on this repository.

Could a maintainer advise whether this change is worth reviewing and, if so, what path external contributors should use when direct PR creation is restricted?

Compare URL:

https://github.com/openai/codex/compare/main...lidge-jun:jaw/goal-reset-command-260519?expand=1

Fork branch:

https://github.com/lidge-jun/codex/tree/jaw/goal-reset-command-260519

Commit:

https://github.com/lidge-jun/codex/commit/5d6caae1cbcc09be968adbd415458a451d6ec115

Problem

Clarification: this is not about blocking the manual /goal ... path. A user can still manage goals through the TUI slash-command flow.

The issue is the AI/tool path. When a user asks Codex in natural language to set a new goal, the model may call create_goal/set_goal while the thread already has a goal. create_goal intentionally fails in that case. That is the right safety boundary, but the recovery path is not clear enough for the model to explain what the user should do next.

The design constraint I wanted to preserve is that the model should not get a reset/clear authority. Goal replacement should remain user-controlled.

The patch therefore makes the recovery path explicit: when the AI cannot set a replacement goal because one already exists, it should tell the user to use the user-facing goal controls first. In particular, the user can run /goal clear to clear the current goal before asking Codex to set a different one. The patch also adds /goal reset as a discoverable alias for the existing /goal clear command.

It distinguishes these intents:

  • To change the objective of the current goal through the UI, use /goal edit.
  • To discard the current goal before starting a different one, use /goal clear or /goal reset, then ask Codex to set the new goal again.

Patch contents

  • Treat /goal reset as an alias for /goal clear in the TUI slash command dispatcher.
  • Update goal summary hints to show /goal clear/reset.
  • Add slash-command coverage that /goal reset emits ClearThreadGoal.
  • Clarify core create_goal existing-goal failure guidance:
  • update_goal is only for legitimate status updates.
  • /goal edit is the user path for changing an objective.
  • /goal clear or /goal reset is the user-controlled path for discarding an existing goal before asking Codex to set a different one.
  • Keep the extension spec aligned while preserving its complete-only update_goal semantics.

This does not add any model-visible reset/clear tool or new app-server protocol surface.

Validation run locally

  • Frontend read-only verification: PASS, high confidence.
  • External GPT Pro review: first requested the /goal edit distinction; after revision, verdict was APPROVE_PR.
  • just fmt
  • cargo test -p codex-tui goal_control_slash_commands_emit_goal_events
  • cargo test -p codex-tui goal_menu
  • cargo test -p codex-core create_goal_tool_rejects_existing_goal
  • cargo insta pending-snapshots --as-json
  • no .snap.new files found
  • git diff --check
  • just fix -p codex-tui
  • just fix -p codex-core

Note: just fmt completed successfully. While running the Python SDK ruff step, uv printed an existing sdk/python/pyproject.toml warning about exclude-newer = \"7 days\", but the command exited successfully and left Python files unchanged.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗