v0.133.0: /goal sets active goal but get_goal/update_goal are not exposed to the model

Open 💬 6 comments Opened May 22, 2026 by nyl199310
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

Summary

On codex-cli 0.133.0, Goal mode can create an active goal, but the model does not receive the goal-management tools (get_goal, create_goal, update_goal). This leaves a goal visibly active while the agent cannot inspect or complete it with update_goal({"status":"complete"}).

This appears different from a plain DB read/write failure: in the smoke tests below, no get_goal call is attempted at all because the tools are absent from the exposed tool surface.

Environment

  • Codex CLI: codex-cli 0.133.0
  • Platform: Linux / WSL2 (6.6.87.2-microsoft-standard-WSL2, x86_64)
  • Model: gpt-5.5, reasoning xhigh
  • codex features list reports:
goals                                   stable             true

Reproduction 1: TUI /goal

  1. Start a fresh Codex CLI TUI session after closing previous Codex/App/IDE processes.
  2. Run:
/goal test goal support; finish by reporting whether get_goal/update_goal are available.
  1. The TUI displays:
Goal active Objective: test goal support; finish by reporting whether get_goal/update_goal are available.
  1. The agent reports:
get_goal is not available.
update_goal is not available.

It also checked deferred tool discovery; only multi-agent tools were discoverable, not goal-management tools. Because update_goal was unavailable, the agent could not mark the smoke-test goal complete.

Relevant log line from the goal thread:

ToolCall: tool_search get_goal update_goal goal status complete blocked thread_id=019e5002-0a71-7572-81d0-c4e8f0a0f8e4

There is no corresponding ToolCall: get_goal ... in that thread.

Reproduction 2: non-interactive codex exec

Command:

codex exec --json --enable goals -C <repo> \
  'Goal tool exposure smoke test. Do not edit files. Do not run shell commands. If a tool named get_goal is available, call get_goal now, then answer exactly AVAILABLE. If get_goal/create_goal/update_goal are not available, answer exactly MISSING.' \
  | tee /tmp/codex-goal-exec-smoke.jsonl

Observed output:

{"type":"thread.started","thread_id":"019e5006-5331-75e3-8fb4-137b7bd3f128"}
{"type":"turn.started"}
{"type":"item.completed","item":{"id":"item_0","type":"agent_message","text":"MISSING"}}
{"type":"turn.completed","usage":{"input_tokens":16453,"cached_input_tokens":3456,"output_tokens":233,"reasoning_output_tokens":225}}

The persisted rollout for thread 019e5006-5331-75e3-8fb4-137b7bd3f128 contains only the user prompt and final MISSING answer. It contains no get_goal, create_goal, or update_goal tool call.

Local goal DB state

Goal storage appears to exist and be migrated, so this does not look like a missing goals DB:

state_5.sqlite:
(34, 'drop thread goals', 1)
(33, 'thread goal stopped statuses', 1)
(32, 'threads preview', 1)

goals_1.sqlite:
thread_goals table exists
row count: 5

Expected behavior

When Goal mode is enabled and a session supports persisted goals:

  • /goal should create or activate the goal.
  • The model should receive get_goal, create_goal, and update_goal in the tool surface.
  • The agent should be able to call get_goal for synchronization and update_goal({"status":"complete"}) when the objective is finished.

Actual behavior

  • /goal creates/displays an active goal.
  • codex exec --enable goals also runs with goals enabled.
  • The model-visible tools do not include get_goal, create_goal, or update_goal.
  • The agent cannot complete the active goal.

Why this matters

This creates a stuck Goal mode: users can enter Goal mode, but the agent cannot use the required lifecycle tools to inspect or complete the goal. For long-running goals, this removes the main completion mechanism and makes the visible active goal misleading.

Related

This may be adjacent to #23984 because that issue discusses 0.133 goal storage changes and stale schema/process problems. This report is specifically about the goal tools not being exposed at all, even in a fresh non-interactive codex exec smoke test where no get_goal call is attempted.

View original on GitHub ↗

6 Comments

jshaofa-ui · 1 month ago

Solution: openai/codex #24094 — /goal Sets Active Goal But get_goal/update_goal Not Exposed to Model

🔍 Root Cause

The /goal TUI command creates an active goal in session state, but the goal management tools (get_goal, create_goal, update_goal) are not injected into the model's tool namespace. The agent can see the goal in the TUI but cannot interact with it programmatically.

The tool registration path is broken:

TUI /goal → GoalManager.set_active_goal() → ??? → Model tool registry (MISSING)

🔧 Fix

Register goal tools when goal is set via TUI

// codex-rs/tui/src/commands/goal.rs (or equivalent)
fn handle_goal_command(app: &mut App, goal_text: &str) {
    app.goal_manager.set_active_goal(goal_text);
    // Register goal tools with the model
    app.tool_registry.register_tools(&[
        Tool::GetGoal, Tool::CreateGoal, Tool::UpdateGoal,
    ]);
}

Include goal tools in model's tool namespace on startup

fn build_tool_namespace(app: &App) -> Vec<ToolDefinition> {
    let mut tools = app.tool_registry.get_all_tools();
    if app.goal_manager.has_active_goal() {
        tools.extend([
            ToolDefinition::get_goal(),
            ToolDefinition::create_goal(),
            ToolDefinition::update_goal(),
        ]);
    }
    tools
}

Dynamic registration on goal state change

When goal is set/cleared/completed, update the tool registry accordingly.

🧪 Testing

  • Verify goal tools registered when goal set via TUI
  • Agent can call get_goal() after /goal command
  • Tools NOT registered when no goal active
  • Tool registration updates when goal cleared/completed

⚠️ Edge Cases

  • Tools should persist across session compaction
  • In headless mode, goal tools available if goal set via API
gndk · 1 month ago

Yup, completely broken in 0.133.0.

nyl199310 · 1 month ago

One clarification: this is not limited to the TUI /goal command path. The non-interactive codex exec --json --enable goals smoke test also returns MISSING and contains no get_goal, create_goal, or update_goal calls, so the bug appears to be in the shared tool-surface / goal capability gating path rather than only in TUI command handling.

etraut-openai contributor · 1 month ago

Thanks for the bug report. I'm not able to repro the problem.

Here's what I see:
<img width="757" height="209" alt="Image" src="https://github.com/user-attachments/assets/8c5046a0-9c64-41d8-bacb-c366dbd033f2" />

Let's see if we can figure out why you're seeing something different.

I have a couple of theories:

  1. Please look in your config.toml and make sure that the goals feature flag isn't explicitly set to false. As of 0.133.0, it should now default to true.
  2. Make sure that you don't have other instances of codex running on your system. Restart them all. This is especially important if you've run codex app-server --listen <port> or codex app-server daemon. When you launch new instances of the TUI, it will look for a locally-running app server daemon and connect to it if present. But if that app server is an older version than 0.133.0, you won't get the goal tools.
gndk · 1 month ago
2. Make sure that you don't have other instances of codex running on your system. Restart them all. This is especially important if you've run codex app-server --listen <port> or codex app-server daemon. When you launch new instances of the TUI, it will look for a locally-running app server daemon and connect to it if present. But if that app server is an older version than 0.133.0, you won't get the goal tools.

It seems like this was actually my issue. I had one or more long running codex instances open while I did the update and used the new version in a new instance, although those old instances had the goals enabled via config too (they were 0.132.0 with goals = true). Maybe it would be worth having a check/warning for this.

etraut-openai contributor · 1 month ago
Maybe it would be worth having a check/warning for this

This was a one-time problem when moving from 0.132.0 (where goals were still experimental) and 0.133.0 (where goals became enabled by default). Now that the feature is stable, we will guarantee forward compatibility moving forward.