{"record":{"id":"920f2f6ad5650e2f","repo":"BigPizzaV3/CodexPlusPlus","slug":"live","errorCode":null,"errorMessage":"供应商配置总开关已关闭，未同步 live 配置","messagePattern":"供应商配置总开关已关闭，未同步 live 配置","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"apps/codex-plus-manager/src-tauri/src/commands.rs","lineNumber":1012,"sourceCode":"\nfn restore_optional_file_bytes(path: &Path, contents: Option<&[u8]>) -> anyhow::Result<()> {\n    match contents {\n        Some(contents) => codex_plus_core::settings::atomic_write(path, contents)?,\n        None => match std::fs::remove_file(path) {\n            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,","sourceCodeStart":994,"sourceCodeEnd":1030,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/apps/codex-plus-manager/src-tauri/src/commands.rs#L994-L1030","documentation":"sync_active_relay_to_home bails out early when BackendSettings.relay_profiles_enabled is false. The relay-profile feature is a global opt-in switch; when it is off the function refuses to write any relay configuration into the live config.toml, so callers (the launch command) surface this as an error instead of silently doing nothing.","triggerScenarios":"Calling a launch/sync command whose settings have relay_profiles_enabled == false, while the code path expects the active relay profile to be synced to home.","commonSituations":"User disabled the relay-profiles master switch in manager settings but still triggers launch with a relay profile selected; fresh install where the flag was never enabled; settings migrated from a version without the flag defaulting to off.","solutions":["Enable the relay profiles master switch in the manager settings (set relay_profiles_enabled = true) and retry.","If you do not need relay profiles, launch without the sync path / accept that live config is not modified.","Check BackendSettings persistence for a stale/incorrect value of the flag."],"exampleFix":"// before\n\"relay_profiles_enabled\": false\n// after (settings.toml / manager UI)\n\"relay_profiles_enabled\": true","handlingStrategy":"validation","validationCode":"if !settings.relay_profiles_enabled {\n    // skip sync or prompt user to enable the switch before launching\n    return Ok(()); // or surface a UI warning\n}","typeGuard":"fn relay_sync_applicable(settings: &BackendSettings) -> bool {\n    settings.relay_profiles_enabled\n}","tryCatchPattern":null,"preventionTips":["Enable the relay-profiles master switch when you intend to use relay profiles.","Show the flag state in the manager UI next to the launch button.","When migrating settings, default the flag to the user's previous behavior."],"tags":["feature-flag","relay-profile","config","tauri-command"],"backgroundTag":"feature-not-enabled","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"}