{"record":{"id":"661d648d17b299dc","repo":"jlcodes99/cockpit-tools","slug":"instances-form-modelrouting-restartrollbackfailed","errorCode":"instances.form.modelRouting.restartRollbackFailed","errorMessage":"${String(restartError)}\\n新路由启动失败，恢复原配置后仍无法启动：${String(rollbackError)}","messagePattern":"(.+?)\\\\n新路由启动失败，恢复原配置后仍无法启动：(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/components/InstancesManager.tsx","lineNumber":1601,"sourceCode":"          } catch (restartError) {\n            if (!formCodexQuickConfig) throw restartError;\n            try {\n              await saveCodexInstanceConfiguration({\n                instanceId: editing.id,\n                bindAccountId: editing.bindAccountId ?? null,\n                modelRouting: editing.modelRouting ?? null,\n                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\");","sourceCodeStart":1583,"sourceCodeEnd":1619,"githubUrl":"https://github.com/jlcodes99/cockpit-tools/blob/1ed8b77992d62ca81fabf744deb0839ad361d5bf/src/components/InstancesManager.tsx#L1583-L1619","documentation":"Composite failure in InstancesManager's config-save flow: restarting the Codex instance with the new model routing failed, the code rolled back to the original configuration, but the post-rollback restart ALSO failed. The original restart error and the rollback restart error are joined into one message so both causes are visible; the instance is left unable to start under either config.","triggerScenarios":"Thrown at src/components/InstancesManager.tsx:1601 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read both chained errors: the root cause is the first (new-routing restart), the second confirms rollback also failed","Manually restore a known-good configuration and start the instance","Check Codex binary/runtime health — failure under both configs usually points at the environment, not the routing change"],"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"}