{"record":{"id":"0cf9e0992f752678","repo":"jlcodes99/cockpit-tools","slug":"codexmodelproviders-0cf9e0","errorCode":null,"errorMessage":"[CodexModelProviders] 更新凭据后写入供应商失败","messagePattern":"\\[CodexModelProviders\\] 更新凭据后写入供应商失败","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/pages/useCodexAccountsAccessController.tsx","lineNumber":4108,"sourceCode":"                apiKey: validation.apiKey,\n                integrationType: savedProvider.integrationType ?? null,\n              });\n              if (\n                (usageSummary.mode === \"sub2api\" ||\n                  usageSummary.mode === \"new_api\") &&\n                usageSummary.mode !== savedProvider.integrationType\n              ) {\n                await saveCodexModelProviderDetectedIntegrationType(\n                  savedProvider.id,\n                  usageSummary.mode,\n                );\n              }\n            } catch (usageErr) {\n              console.warn(\"[CodexModelProviders] 额度类型探测失败\", usageErr);\n            }\n            await reloadManagedProviders();\n          } catch (providerErr) {\n            console.warn(\n              \"[CodexModelProviders] 更新凭据后写入供应商失败\",\n              providerErr,\n            );\n          }\n        }\n        setMessage({\n          text:\n            Object.keys(parsedWindows.windows).length > 0 ||\n            editingApiSyncModelCatalogToCodex\n              ? `${t(\"instances.messages.updated\", \"实例已更新\")} ${t(\n                  \"codex.api.modelCatalog.restartHint\",\n                  \"模型目录已更新。若 Codex 正在运行，请重启后生效。\",\n                )}`\n              : t(\"instances.messages.updated\", \"实例已更新\"),\n        });\n        setApiKeyUsageMap((previous) => {\n          const next = { ...previous };\n          delete next[accountId];","sourceCodeStart":4090,"sourceCodeEnd":4126,"githubUrl":"https://github.com/jlcodes99/cockpit-tools/blob/1ed8b77992d62ca81fabf744deb0839ad361d5bf/src/pages/useCodexAccountsAccessController.tsx#L4090-L4126","documentation":"Non-fatal warning in the update-credentials flow of useCodexAccountsAccessController: after updating a provider's API key, the usage probe that would persist the detected integration type (sub2api/new_api) failed; the catch logs '[CodexModelProviders] 更新凭据后写入供应商失败' and continues. The credential update itself succeeded; only the integration-type auto-detection was lost.","triggerScenarios":"Thrown at src/pages/useCodexAccountsAccessController.tsx:4108 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the new API key works against the provider's usage endpoint","Re-trigger provider detection by editing/saving the provider again","Confirm integrationType in provider settings if auto-detection keeps failing"],"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"}