codex - 💡(How to fix) Fix Bug: rejects update_plan in Plan mode — contradictory error message

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…

In codex-rs/core/src/tools/handlers/plan.rs lines 86-89, the handle_update_plan function returns an error when the collaboration mode is Plan:

if turn_context.collaboration_mode.mode == ModeKind::Plan {
    return Err(FunctionCallError::RespondToModel(
        "update_plan is a TODO/checklist tool and is not allowed in Plan mode".to_string(),
    ));
}

This is contradictory — update_plan is a tool specifically designed for managing plans (TODOs/checklists). Rejecting it in Plan mode, where the user explicitly wants to plan, makes the tool unusable in the one mode where it would be most useful.

Additionally, the error message says "update_plan is a TODO/checklist tool and is not allowed in Plan mode" which is confusing to the model receiving it — the tool name and mode name overlap, making the rejection seem like a bug rather than intentional behavior.

Error Message

if turn_context.collaboration_mode.mode == ModeKind::Plan { return Err(FunctionCallError::RespondToModel( "update_plan is a TODO/checklist tool and is not allowed in Plan mode".to_string(), )); }

Root Cause

In codex-rs/core/src/tools/handlers/plan.rs lines 86-89, the handle_update_plan function returns an error when the collaboration mode is Plan:

if turn_context.collaboration_mode.mode == ModeKind::Plan {
    return Err(FunctionCallError::RespondToModel(
        "update_plan is a TODO/checklist tool and is not allowed in Plan mode".to_string(),
    ));
}

This is contradictory — update_plan is a tool specifically designed for managing plans (TODOs/checklists). Rejecting it in Plan mode, where the user explicitly wants to plan, makes the tool unusable in the one mode where it would be most useful.

Additionally, the error message says "update_plan is a TODO/checklist tool and is not allowed in Plan mode" which is confusing to the model receiving it — the tool name and mode name overlap, making the rejection seem like a bug rather than intentional behavior.

Code Example

if turn_context.collaboration_mode.mode == ModeKind::Plan {
    return Err(FunctionCallError::RespondToModel(
        "update_plan is a TODO/checklist tool and is not allowed in Plan mode".to_string(),
    ));
}
RAW_BUFFERClick to expand / collapse

Description

In codex-rs/core/src/tools/handlers/plan.rs lines 86-89, the handle_update_plan function returns an error when the collaboration mode is Plan:

if turn_context.collaboration_mode.mode == ModeKind::Plan {
    return Err(FunctionCallError::RespondToModel(
        "update_plan is a TODO/checklist tool and is not allowed in Plan mode".to_string(),
    ));
}

This is contradictory — update_plan is a tool specifically designed for managing plans (TODOs/checklists). Rejecting it in Plan mode, where the user explicitly wants to plan, makes the tool unusable in the one mode where it would be most useful.

Additionally, the error message says "update_plan is a TODO/checklist tool and is not allowed in Plan mode" which is confusing to the model receiving it — the tool name and mode name overlap, making the rejection seem like a bug rather than intentional behavior.

Expected behavior

Either:

  1. Allow update_plan in Plan mode (it seems like the natural place to use it), or
  2. If there's a design reason to reject it, clarify the error message to explain why it's rejected.

Environment

  • File: codex-rs/core/src/tools/handlers/plan.rs, lines 80-96

extent analysis

TL;DR

The handle_update_plan function should be updated to either allow update_plan in Plan mode or provide a clear error message explaining why it's rejected.

Guidance

  • Review the design reasons behind rejecting update_plan in Plan mode to determine if it's intentional or a mistake.
  • Consider removing the error return for ModeKind::Plan to allow update_plan in Plan mode, as it seems to be the intended use case.
  • If rejection is intentional, update the error message to clearly explain why update_plan is not allowed in Plan mode, avoiding confusion with the overlapping tool and mode names.
  • Verify the updated behavior by testing update_plan in Plan mode and checking the response.

Example

// Potential update to allow update_plan in Plan mode
if turn_context.collaboration_mode.mode == ModeKind::Plan {
    // Remove error return or add logic to handle update_plan in Plan mode
}

Notes

The fix depends on the intended design and behavior of update_plan in Plan mode, which is not explicitly stated in the issue.

Recommendation

Apply workaround: Update the handle_update_plan function to either allow update_plan in Plan mode or provide a clear error message, as this will address the immediate issue and improve the user experience.

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…

FAQ

Expected behavior

Either:

  1. Allow update_plan in Plan mode (it seems like the natural place to use it), or
  2. If there's a design reason to reject it, clarify the error message to explain why it's rejected.

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 Bug: rejects update_plan in Plan mode — contradictory error message