codex - 💡(How to fix) Fix Codex self-imposed token budget on a /goal

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

This is especially harmful for large implementation goals because:

Code Example

• codex doctor --json exited 1.

  Key result: overallStatus: "fail" on codexVersion: "0.133.0".

  Main failures/warnings:

  - network.provider_reachability: fail
    https://chatgpt.com/backend-api/ connect failed (required)
  - network.websocket_reachability: warning
    DNS lookup failed for wss://chatgpt.com/backend-api/<redacted>
  - mcp.config: warning
    Optional local MCP servers unreachable: vault, email, money, notes, code, trade on localhost ports 8089-8094.
  - updates.status: warning
    Latest version probe failed: curl: (6) Could not resolve host: api.github.com.

  Everything else important looked okay: auth configured, config loads, install consistent, state DB integrity ok, sandbox readable.
RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

codex-cli 0.133.0

What subscription do you have?

Pro 20x

Which model were you using?

gpt-5.5 xhigh

What platform is your computer?

Darwin 24.4.0 arm64 arm

What terminal emulator and version are you using (if applicable)?

Codex App terminal

Codex doctor report

• codex doctor --json exited 1.

  Key result: overallStatus: "fail" on codexVersion: "0.133.0".

  Main failures/warnings:

  - network.provider_reachability: fail
    https://chatgpt.com/backend-api/ connect failed (required)
  - network.websocket_reachability: warning
    DNS lookup failed for wss://chatgpt.com/backend-api/<redacted>
  - mcp.config: warning
    Optional local MCP servers unreachable: vault, email, money, notes, code, trade on localhost ports 8089-8094.
  - updates.status: warning
    Latest version probe failed: curl: (6) Could not resolve host: api.github.com.

  Everything else important looked okay: auth configured, config loads, install consistent, state DB integrity ok, sandbox readable.

What issue are you seeing?

Title

/goal can inherit a self-imposed token budget even when user did not request one

Summary

During an Orion work session, Codex created an internal goal with a token budget that the user never requested. When that budget was reached, the system marked the goal budget_limited and instructed the agent to stop substantive work.

This caused Codex to prematurely halt a long-running implementation task even though the user’s /goal prompt did not specify any token or time budget.

What Happened

User started a goal with:

Make Orion materially better as a message-first investment research agent...

No token budget was specified.

The assistant then called create_goal with:

{
  "objective": "...",
  "token_budget": 180000
}

Later, the thread received goal context saying:

The active thread goal has reached its token budget.
Tokens used: 180402
Token budget: 180000
The assistant stopped work and summarized partial progress.

## Expected Behavior

Codex should not set a goal token budget unless the user explicitly requests one.

For open-ended /goal tasks, the goal should remain active until one of these happens:

- the objective is completed
- the user pauses/stops/cancels it
- the agent is genuinely blocked
- the system has a non-user-configurable hard limit, clearly labeled as such

## Actual Behavior

The assistant introduced a hidden/self-imposed token_budget value, which then became binding system behavior and interrupted the task.

## Impact

This is especially harmful for large implementation goals because:

- the user did not opt into the budget
- the assistant may stop before making code changes
- the user cannot easily tell whether the limit came from their prompt, repo config, or Codex internals
- it makes /goal feel unreliable for long-running engineering work

## Suggested Fix

1. Do not allow agents to set token_budget in create_goal unless the user explicitly requested a token budget.
2. Add validation or linting around create_goal calls:
    - if token_budget is present, require evidence of a user-specified budget
3. Make budget source visible in goal context:
    - budget_source: user_explicit | system_default | assistant_inferred
4. Provide a way for the user to clear or extend an accidental budget.
5. Consider warning the assistant before creating a budgeted goal:
    - “The user did not request a token budget. Omit token_budget?”

## Environment

- Codex CLI: 0.133.0
- Auth mode: ChatGPT
- Goal feature enabled

### What steps can reproduce the bug?

Uploaded thread: 019e6572-a1ef-79a1-bbfe-46bcd4582484

### What is the expected behavior?

Codex should not set a goal token budget unless the user explicitly requests one.

For open-ended /goal tasks, the goal should remain active until one of these happens:

- the objective is completed
- the user pauses/stops/cancels it
- the agent is genuinely blocked
- the system has a non-user-configurable hard limit, clearly labeled as such

### Additional information

_No response_

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Codex self-imposed token budget on a /goal