{"record":{"id":"59be3ebaf3f11ebc","repo":"BigPizzaV3/CodexPlusPlus","slug":"error-59be3e","errorCode":null,"errorMessage":"当前聚合供应商配置不完整","messagePattern":"当前聚合供应商配置不完整","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"apps/codex-plus-manager/src-tauri/src/commands.rs","lineNumber":1017,"sourceCode":"            Ok(()) => {}\n            Err(error) if error.kind() == std::io::ErrorKind::NotFound => {}\n            Err(error) => return Err(error.into()),\n        },\n    }\n    Ok(())\n}\n\nfn sync_active_relay_to_home(\n    settings: &BackendSettings,\n    home: &Path,\n) -> anyhow::Result<codex_plus_core::relay_config::RelayApplyResult> {\n    if !settings.relay_profiles_enabled {\n        anyhow::bail!(\"供应商配置总开关已关闭，未同步 live 配置\");\n    }\n    let relay = settings.active_relay_profile();\n    if relay.relay_mode == codex_plus_core::settings::RelayMode::Aggregate {\n        if settings.active_aggregate_relay_profile().is_none() {\n            anyhow::bail!(\"当前聚合供应商配置不完整\");\n        }\n        let aggregate = settings\n            .active_aggregate_relay_profile()\n            .ok_or_else(|| anyhow::anyhow!(\"当前聚合供应商配置不完整\"))?;\n        return codex_plus_core::relay_config::apply_relay_config_to_home_with_session_provider(\n            home,\n            &codex_plus_core::protocol_proxy::local_responses_proxy_base_url(\n                codex_plus_core::protocol_proxy::protocol_proxy_port(),\n            ),\n            \"codex-plus-aggregate\",\n            codex_plus_core::settings::RelayProtocol::Responses,\n            codex_plus_core::protocol_proxy::protocol_proxy_port(),\n            aggregate.session_provider,\n        );\n    }\n    if relay.relay_mode == codex_plus_core::settings::RelayMode::Official\n        && !relay.official_mix_api_key\n    {","sourceCodeStart":999,"sourceCodeEnd":1035,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/apps/codex-plus-manager/src-tauri/src/commands.rs#L999-L1035","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Open manager settings and select/define a complete aggregate relay profile for the active profile.","Verify all member profiles referenced by the aggregate exist and have valid endpoints.","Switch relay_mode back to a single-provider mode if aggregation is not intended.","Inspect the persisted BackendSettings for corruption and re-save the relay configuration."],"exampleFix":"// before: mode switched to aggregate with no aggregate configured\n\"relay_mode\": \"Aggregate\"\n// after: define and select the aggregate profile first\n\"relay_mode\": \"Aggregate\",\n\"active_aggregate_profile_id\": \"agg-1\" // with existing member profiles","handlingStrategy":"validation","validationCode":"if settings.active_relay_profile().relay_mode == RelayMode::Aggregate\n    && settings.active_aggregate_relay_profile().is_none()\n{\n    return Err(anyhow::anyhow!(\"select or complete an aggregate relay profile before launching\"));\n}","typeGuard":"fn aggregate_ready(settings: &BackendSettings) -> bool {\n    settings.active_relay_profile().relay_mode != RelayMode::Aggregate\n        || settings.active_aggregate_relay_profile().is_some()\n}","tryCatchPattern":null,"preventionTips":["Always configure an aggregate profile before switching relay_mode to Aggregate.","When deleting a member profile, validate that no aggregate references it.","Add a settings-save-time completeness check for aggregate profiles.","Avoid hand-editing the settings file; use the manager UI which enforces completeness."],"tags":["relay-profile","aggregate","incomplete-config","tauri-command"],"backgroundTag":"missing-required-config-field","analyzedSha":"b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6","analyzedAt":"2026-09-19T23:35:21.129Z","contentChangedAt":"2026-09-19T23:35:21.129Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}