{"record":{"id":"2c2382104e87d7cd","repo":"BigPizzaV3/CodexPlusPlus","slug":"error-live-restore-error","errorCode":null,"errorMessage":"同步当前供应商失败：{error}；回滚 live 配置也失败：{restore_error}","messagePattern":"同步当前供应商失败：(.+?)；回滚 live 配置也失败：(.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"apps/codex-plus-manager/src-tauri/src/commands.rs","lineNumber":668,"sourceCode":"            )\n        }\n    }\n}\n\nfn restart_codex_plus_after_stop<F>(\n    request: &LaunchRequest,\n    home: &Path,\n    settings: Option<&BackendSettings>,\n    spawn: F,\n) -> anyhow::Result<()>\nwhere\n    F: FnOnce(&LaunchRequest) -> anyhow::Result<()>,\n{\n    let snapshot = if let Some(settings) = settings {\n        let snapshot = RelayLiveSnapshot::capture(home)?;\n        if let Err(error) = sync_active_relay_to_home(settings, home) {\n            if let Err(restore_error) = snapshot.restore(home) {\n                anyhow::bail!(\"同步当前供应商失败：{error}；回滚 live 配置也失败：{restore_error}\");\n            }\n            return Err(error);\n        }\n        Some(snapshot)\n    } else {\n        None\n    };\n\n    if let Err(error) = spawn(request) {\n        if let Some(snapshot) = snapshot {\n            if let Err(restore_error) = snapshot.restore(home) {\n                anyhow::bail!(\"启动静默入口失败：{error}；回滚 live 配置也失败：{restore_error}\");\n            }\n        }\n        return Err(error);\n    }\n    Ok(())\n}","sourceCodeStart":650,"sourceCodeEnd":686,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/apps/codex-plus-manager/src-tauri/src/commands.rs#L650-L686","documentation":"Raised in restart_codex_plus_after_stop: syncing the active relay profile into the live Codex home failed, and rolling back from the captured RelayLiveSnapshot also failed, leaving the live config in an uncertain state. Both the original sync error and the restore error are chained in the message.","triggerScenarios":"Thrown at apps/codex-plus-manager/src-tauri/src/commands.rs:668 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect both errors to find the root cause of the sync failure","Manually restore config.toml/auth.json or re-apply the profile","Check file permissions/locks on the Codex home directory"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f2074595a281bc057525c748175c8eb9805b0673","analyzedAt":"2026-08-23T12:52:24.489Z","contentChangedAt":"2026-08-23T12:52:24.489Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}