openai/codex · error · CodexErr

duplicate tool

Error message

duplicate tool: {0}

What it means

Registration-time guard fired when multiple registered tools resolve to the same effective name (after any name mangling/prefixing). The String payload is the colliding name; it prevents ambiguous tool dispatch at startup or when MCP servers register overlapping tools.

Solutions

  1. Rename or disable one of the colliding tools in config
  2. Adjust MCP server tool prefixes so effective names no longer clash
  3. Audit recently added MCP servers for tools that shadow built-in tool names
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at codex-rs/protocol/src/error.rs:124 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of openai/codex@339751715c (2026-08-25). Data as JSON: /api/errors/a3bd18172b54c71a. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/protocol/src/error.rs:124

    Timeout,
    #[error("request timed out")]
    RequestTimeout,
    /// Returned by run_command_stream when the child could not be spawned (its stdout/stderr pipes
    /// could not be captured). Analogous to the previous `CodexError::Spawn` variant.
    #[error("spawn failed: child stdout/stderr not captured")]
    Spawn,
    /// Returned by run_command_stream when the user pressed Ctrl-C (SIGINT). Session uses this to
    /// surface a polite FunctionCallOutput back to the model instead of crashing the CLI.
    #[error("interrupted (Ctrl-C). Something went wrong? Hit `/feedback` to report the issue.")]
    Interrupted,
    /// Unexpected HTTP status code.
    #[error("{0}")]
    UnexpectedStatus(UnexpectedResponseError),
    /// Invalid request.
    #[error("{0}")]
    InvalidRequest(String),
    /// Multiple registered tools share the same effective name.
    #[error("duplicate tool: {0}")]
    ToolCollision(String),
    /// Invalid image.
    #[error("Image poisoning")]
    InvalidImageRequest(),
    #[error("{0}")]
    UsageLimitReached(UsageLimitReachedError),
    #[error("Selected model is at capacity. Please try a different model.")]
    ServerOverloaded,
    #[error("{message}")]
    CyberPolicy { message: String },
    #[error("{message}")]
    MisalignmentPolicyViolation { message: String },
    #[error("{0}")]
    ResponseStreamFailed(ResponseStreamFailed),
    #[error("{0}")]
    ConnectionFailed(ConnectionFailedError),
    #[error("Quota exceeded. Check your plan and billing details.")]
    QuotaExceeded,

View on GitHub (pinned to 339751715c)