{"record":{"id":"321907a3566d8416","repo":"HKUDS/DeepTutor","slug":"model-configuration-is-managed-by-an-administrator","errorCode":null,"errorMessage":"Model configuration is managed by an administrator.","messagePattern":"Model configuration is managed by an administrator\\.","errorType":"http","errorClass":"HTTPException","httpStatus":403,"severity":"error","filePath":"deeptutor/api/routers/settings.py","lineNumber":408,"sourceCode":"    router saves alongside six capability writes lost every one of the router's.\n\n    Prefer :func:`patch_ui_settings` for changing individual fields. This\n    replaces the whole document, so a caller that builds it from\n    ``load_ui_settings`` writes the merged defaults back as stored values and\n    stops following later changes to any of them.\n    \"\"\"\n    payload = dict(settings)\n    atomic_update(_settings_file(), lambda _stored: payload)\n\n\ndef patch_ui_settings(**fields: Any) -> None:\n    \"\"\"Change individual UI fields without rewriting the rest of the document.\"\"\"\n    atomic_update(_settings_file(), lambda stored: {**stored, **fields})\n\n\ndef _require_settings_admin() -> None:\n    if not get_current_user().is_admin:\n        raise HTTPException(\n            status_code=status.HTTP_403_FORBIDDEN,\n            detail=\"Model configuration is managed by an administrator.\",\n        )\n\n\ndef _require_codex_oauth_actor() -> None:\n    \"\"\"Gate the Codex OAuth lifecycle: personal, not administrative.\n\n    Every one of these endpoints acts on the *caller's own* credentials —\n    ``get_codex_oauth_service()`` resolves the store, the model catalog, and\n    the callback route from owner scope — so requiring an administrator was\n    what left ordinary users unable to use Codex at all: an owner-bound\n    profile is (correctly) never grantable, and they could not sign in for\n    themselves either (#781).\n\n    A partner is refused: it is a synthetic user whose owner is a real\n    account, so letting one in would mean acting on that person's login —\n    including signing them out. Partners inherit the owner's login at call","sourceCodeStart":390,"sourceCodeEnd":426,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/api/routers/settings.py#L390-L426","documentation":"Error \"Model configuration is managed by an administrator.\" thrown in HKUDS/DeepTutor.","triggerScenarios":"Thrown at deeptutor/api/routers/settings.py:408 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}