{"record":{"id":"04da7d8dcd5952fe","repo":"jlcodes99/cockpit-tools","slug":"instances-form-modelrouting-restartrolledback","errorCode":"instances.form.modelRouting.restartRolledBack","errorMessage":"新路由启动失败，已恢复原配置并重新启动 Codex：{{error}}","messagePattern":"新路由启动失败，已恢复原配置并重新启动 Codex：(.+?)\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/components/InstancesManager.tsx","lineNumber":1608,"sourceCode":"                deferBindAccountApplication: true,\n                experimentalModelCatalogEnabled:\n                  formCodexQuickConfig.experimental_model_catalog_enabled,\n                experimentalModelCatalogModels:\n                  formCodexQuickConfig.experimental_model_catalog_models,\n                experimentalModelCatalogDefaultModelId:\n                  formCodexQuickConfig.experimental_model_catalog_default_model_id ??\n                  null,\n              });\n              await startInstance(editing.id);\n            } catch (rollbackError) {\n              throw new Error(\n                `${String(restartError)}\\n${t(\n                  \"instances.form.modelRouting.restartRollbackFailed\",\n                  \"新路由启动失败，恢复原配置后仍无法启动：\",\n                )}${String(rollbackError)}`,\n              );\n            }\n            throw new Error(\n              t(\"instances.form.modelRouting.restartRolledBack\", {\n                defaultValue:\n                  \"新路由启动失败，已恢复原配置并重新启动 Codex：{{error}}\",\n                error: String(restartError).replace(/^Error:\\s*/, \"\"),\n              }),\n            );\n          }\n        }\n        setMessage({ text: t(\"instances.messages.updated\", \"实例已更新\") });\n      } else {\n        setActionLoading(\"create\");\n        const created = await createInstance({\n          name: formName.trim(),\n          userDataDir: formPath.trim(),\n          workingDir: nextWorkingDir,\n          extraArgs: formExtraArgs,\n          initMode: isGrokApp ? \"empty\" : formInitMode,\n          launchMode: nextLaunchMode,","sourceCodeStart":1590,"sourceCodeEnd":1626,"githubUrl":"https://github.com/jlcodes99/cockpit-tools/blob/1ed8b77992d62ca81fabf744deb0839ad361d5bf/src/components/InstancesManager.tsx#L1590-L1626","documentation":"Rollback-path error in InstancesManager: after the new model-routing restart failed, the original configuration was saved and the instance restarted, but that restart still failed. The error message ('新路由启动失败，已恢复原配置并重新启动 Codex：{{error}}') reports that the original config was restored yet the instance still cannot start, with the rollback restart error interpolated.","triggerScenarios":"Thrown at src/components/InstancesManager.tsx:1608 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use the interpolated error to diagnose why the previously working config no longer starts (port conflict, stale process, binary issue)","Kill orphaned Codex processes holding resources, then start again","Verify the restored configuration file was written correctly before retrying"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1ed8b77992d62ca81fabf744deb0839ad361d5bf","analyzedAt":"2026-09-05T09:51:41.178Z","contentChangedAt":"2026-09-05T09:51:41.178Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}