Bug: rejects update_plan in Plan mode — contradictory error message

Resolved 💬 1 comment Opened Apr 20, 2026 by hobostay Closed Apr 20, 2026

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

View original on GitHub ↗

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