{"record":{"id":"36b9619d9afa936c","repo":"HKUDS/nanobot","slug":"the-top-level-of-config-json-must-be-a-json-object","errorCode":null,"errorMessage":"The top level of config.json must be a JSON object.","messagePattern":"The top level of config\\.json must be a JSON object\\.","errorType":"exception","errorClass":"ConfigLoadError","httpStatus":null,"severity":"error","filePath":"nanobot/config/loader.py","lineNumber":110,"sourceCode":"            ),\n        ) from exc\n    except UnicodeDecodeError as exc:\n        raise ConfigLoadError(\n            path,\n            kind=\"io_error\",\n            summary=\"The file is not valid UTF-8.\",\n        ) from exc\n    except OSError as exc:\n        detail = exc.strerror or type(exc).__name__\n        raise ConfigLoadError(\n            path,\n            kind=\"io_error\",\n            summary=f\"Unable to read the file: {_sentence(detail)}\",\n        ) from exc\n\n    if not isinstance(data, dict):\n        root_type = type(data).__name__\n        raise ConfigLoadError(\n            path,\n            kind=\"invalid_root\",\n            summary=\"The top level of config.json must be a JSON object.\",\n            issues=(\n                ConfigIssue(\n                    path=(),\n                    message=f\"Expected an object, but found {root_type}.\",\n                ),\n            ),\n        )\n\n    data = _migrate_config(cast(dict[str, Any], data))\n    try:\n        config = Config.model_validate(data)\n    except ValidationError as exc:\n        issues = validation_issues(exc)\n        raise ConfigLoadError(\n            path,","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/HKUDS/nanobot/blob/42f37dc4c0e409eac7818a82d165c5f2757bc075/nanobot/config/loader.py#L92-L128","documentation":"Error \"The top level of config.json must be a JSON object.\" thrown in HKUDS/nanobot.","triggerScenarios":"Thrown at nanobot/config/loader.py:110 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":"42f37dc4c0e409eac7818a82d165c5f2757bc075","analyzedAt":"2026-08-26T00:18:52.276Z","schemaVersion":2},"datasetVersion":"2026-08-26T04:18:47.238Z"}