BigPizzaV3/CodexPlusPlus · error · anyhow::Error

当前聚合供应商配置不完整

Error message

当前聚合供应商配置不完整

What it means

When the active relay profile's relay_mode is Aggregate, sync_active_relay_to_home requires active_aggregate_relay_profile() to return Some — i.e. the aggregate profile must exist and reference complete sub-profiles. If it returns None (or the settings are otherwise malformed), the function bails with this error because it cannot render an aggregate relay config into the live home.

Solutions

  1. Open manager settings and select/define a complete aggregate relay profile for the active profile.
  2. Verify all member profiles referenced by the aggregate exist and have valid endpoints.
  3. Switch relay_mode back to a single-provider mode if aggregation is not intended.
  4. Inspect the persisted BackendSettings for corruption and re-save the relay configuration.

Example fix

// before: mode switched to aggregate with no aggregate configured
"relay_mode": "Aggregate"
// after: define and select the aggregate profile first
"relay_mode": "Aggregate",
"active_aggregate_profile_id": "agg-1" // with existing member profiles
Defensive patterns

Strategy: validation

Validate before calling

if settings.active_relay_profile().relay_mode == RelayMode::Aggregate
    && settings.active_aggregate_relay_profile().is_none()
{
    return Err(anyhow::anyhow!("select or complete an aggregate relay profile before launching"));
}

Type guard

fn aggregate_ready(settings: &BackendSettings) -> bool {
    settings.active_relay_profile().relay_mode != RelayMode::Aggregate
        || settings.active_aggregate_relay_profile().is_some()
}

Prevention

When it happens

Trigger: Calling launch/sync with settings whose active profile has relay_mode == Aggregate but no valid aggregate profile configured (missing member profiles, missing active aggregate selection, or corrupt settings).

Common situations: User switched relay_mode to Aggregate without adding/selecting an aggregate profile; deleted a member profile that the aggregate references; settings file edited manually or migrated incompletely.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@b1ed92e5e4 (2026-09-19). Data as JSON: /api/errors/59be3ebaf3f11ebc. Report an issue: GitHub.

Appendix: source

Thrown at apps/codex-plus-manager/src-tauri/src/commands.rs:1017

            Ok(()) => {}
            Err(error) if error.kind() == std::io::ErrorKind::NotFound => {}
            Err(error) => return Err(error.into()),
        },
    }
    Ok(())
}

fn sync_active_relay_to_home(
    settings: &BackendSettings,
    home: &Path,
) -> anyhow::Result<codex_plus_core::relay_config::RelayApplyResult> {
    if !settings.relay_profiles_enabled {
        anyhow::bail!("供应商配置总开关已关闭,未同步 live 配置");
    }
    let relay = settings.active_relay_profile();
    if relay.relay_mode == codex_plus_core::settings::RelayMode::Aggregate {
        if settings.active_aggregate_relay_profile().is_none() {
            anyhow::bail!("当前聚合供应商配置不完整");
        }
        let aggregate = settings
            .active_aggregate_relay_profile()
            .ok_or_else(|| anyhow::anyhow!("当前聚合供应商配置不完整"))?;
        return codex_plus_core::relay_config::apply_relay_config_to_home_with_session_provider(
            home,
            &codex_plus_core::protocol_proxy::local_responses_proxy_base_url(
                codex_plus_core::protocol_proxy::protocol_proxy_port(),
            ),
            "codex-plus-aggregate",
            codex_plus_core::settings::RelayProtocol::Responses,
            codex_plus_core::protocol_proxy::protocol_proxy_port(),
            aggregate.session_provider,
        );
    }
    if relay.relay_mode == codex_plus_core::settings::RelayMode::Official
        && !relay.official_mix_api_key
    {

View on GitHub (pinned to b1ed92e5e4)