{"record":{"id":"29fc028aeed45f85","repo":"HKUDS/nanobot","slug":"invalid-feishu-instance-at-index-index-exc","errorCode":null,"errorMessage":"Invalid Feishu instance at index {index}: {exc}","messagePattern":"Invalid Feishu instance at index (.+?): (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"nanobot/channels/feishu/instances.py","lineNumber":189,"sourceCode":"def canonical_feishu_section(section: Any, defaults: dict[str, Any]) -> dict[str, Any]:\n    \"\"\"Return a canonical section, rejecting input that cannot be preserved safely.\"\"\"\n    raw_specs, inherited = _feishu_instance_inputs(section, defaults)\n    instances: list[dict[str, Any]] = []\n    instance_ids: set[str] = set()\n\n    for index, raw in enumerate(raw_specs):\n        if not isinstance(raw, dict):\n            raise ValueError(f\"Feishu instance at index {index} must be an object\")\n        fallback_id = DEFAULT_INSTANCE_ID if index == 0 else f\"assistant-{index + 1}\"\n        try:\n            config = _normalize_feishu_instance(\n                cast(dict[str, Any], raw),\n                defaults,\n                inherited=inherited,\n                fallback_id=fallback_id,\n            )\n        except ValueError as exc:\n            raise ValueError(f\"Invalid Feishu instance at index {index}: {exc}\") from exc\n\n        instance_id = str(config[\"instanceId\"])\n        if instance_id in instance_ids:\n            raise ValueError(f\"duplicate Feishu instance id '{instance_id}'\")\n        instance_ids.add(instance_id)\n        instances.append(config)\n\n    return {\"instances\": instances}\n\n\ndef upsert_feishu_instance(\n    section: Any,\n    defaults: dict[str, Any],\n    instance_id: str,\n    values: dict[str, Any],\n) -> dict[str, Any]:\n    \"\"\"Return canonical Feishu section with one instance created or updated.\"\"\"\n    instance_id = validate_instance_id(instance_id)","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/HKUDS/nanobot/blob/42f37dc4c0e409eac7818a82d165c5f2757bc075/nanobot/channels/feishu/instances.py#L171-L207","documentation":"Error \"Invalid Feishu instance at index {index}: {exc}\" thrown in HKUDS/nanobot.","triggerScenarios":"Thrown at nanobot/channels/feishu/instances.py:189 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"}