openai/codex · error · RequirementsCompositionError

failed to parse merged requirements

Error message

failed to parse merged requirements: {message}

What it means

After merging all requirements layers, the combined TOML value could not be parsed back into the requirements model ({message} is the field-level error) — the layers are individually valid but their merged shape violates the requirements schema, e.g. conflicting types for the same key.

Solutions

  1. Fix the conflicting or invalid fields across the merged requirements layers.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at codex-rs/config/src/requirements_layers/stack.rs:41 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


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

Appendix: source

Thrown at codex-rs/config/src/requirements_layers/stack.rs:41

use std::io;
use thiserror::Error;
use toml::Value as TomlValue;

use super::hooks::HookDirectoryField;
use super::hooks::HookMergeState;
use super::layer::ComposableRequirementsLayer;
use super::layer::RequirementsLayerEntry;
use super::models::AutoReviewModelsMergeState;
use super::permissions::DenyReadMergeState;

#[derive(Debug, Error, PartialEq, Eq)]
pub enum RequirementsCompositionError {
    #[error("failed to parse requirements layer {layer_source}: {message}")]
    Parse {
        layer_source: RequirementSource,
        message: String,
    },
    #[error("failed to parse merged requirements: {message}")]
    ComposedParse { message: String },
    #[error(
        "failed to compose requirements field `{field}` between {existing_source} and {incoming_source}: {message}"
    )]
    Conflict {
        field: String,
        existing_source: RequirementSource,
        incoming_source: RequirementSource,
        message: String,
    },
}

impl From<RequirementsCompositionError> for io::Error {
    fn from(error: RequirementsCompositionError) -> Self {
        io::Error::new(io::ErrorKind::InvalidData, error)
    }
}

View on GitHub (pinned to 339751715c)