{"record":{"id":"37ace24cd3c93091","repo":"OpenBMB/ChatDev","slug":"write-must-be-boolean","errorCode":null,"errorMessage":"write must be boolean","messagePattern":"write must be boolean","errorType":"validation","errorClass":"ConfigError","httpStatus":null,"severity":"error","filePath":"entity/configs/node/memory.py","lineNumber":468,"sourceCode":"                        extend_path(path, f\"retrieve_stage[{idx}]\"),\n                    ) from exc\n            stages = parsed\n\n        top_k_value = mapping.get(\"top_k\", 3)\n        if not isinstance(top_k_value, int) or top_k_value <= 0:\n            raise ConfigError(\"top_k must be a positive integer\", extend_path(path, \"top_k\"))\n\n        threshold_value = mapping.get(\"similarity_threshold\", -1.0)\n        if not isinstance(threshold_value, (int, float)):\n            raise ConfigError(\"similarity_threshold must be numeric\", extend_path(path, \"similarity_threshold\"))\n\n        read_value = mapping.get(\"read\", True)\n        if not isinstance(read_value, bool):\n            raise ConfigError(\"read must be boolean\", extend_path(path, \"read\"))\n\n        write_value = mapping.get(\"write\", True)\n        if not isinstance(write_value, bool):\n            raise ConfigError(\"write must be boolean\", extend_path(path, \"write\"))\n\n        return cls(\n            name=name,\n            retrieve_stage=stages,\n            top_k=top_k_value,\n            similarity_threshold=float(threshold_value),\n            read=read_value,\n            write=write_value,\n            path=path,\n        )\n\n    FIELD_SPECS = {\n        \"name\": ConfigFieldSpec(\n            name=\"name\",\n            display_name=\"Memory Name\",\n            type_hint=\"str\",\n            required=True,\n            description=\"Name of the referenced memory store\",","sourceCodeStart":450,"sourceCodeEnd":486,"githubUrl":"https://github.com/OpenBMB/ChatDev/blob/4fb2db0ea90375ce1059f44fe03ffbd191a7a169/entity/configs/node/memory.py#L450-L486","documentation":"MemoryRetrieveConfig.from_dict requires 'write' (default True) to be a Python bool, mirroring the 'read' check. Non-bool values raise this ConfigError with path pointing at 'write'.","triggerScenarios":"Setting write: 'true', write: 0, or any non-bool value in the retrieve config mapping.","commonSituations":"Same as 'read': stringified booleans from env vars, quoted YAML/JSON values, template-rendered configs.","solutions":["Use an unquoted boolean literal for write","Convert string values to bool explicitly before parsing","Omit the key to default to true"],"exampleFix":"# before\nwrite: 'true'\n# after\nwrite: true","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"def is_bool(v) -> bool:\n    return isinstance(v, bool)","tryCatchPattern":"try:\n    MemoryRetrieveConfig.from_dict(d, path='retrieve')\nexcept ConfigError as e:\n    if 'write must be boolean' in str(e):\n        d['write'] = str(d['write']).lower() in ('true', '1')\n        MemoryRetrieveConfig.from_dict(d, path='retrieve')","preventionTips":["Never quote booleans in configs","Normalize string flags before parsing"],"tags":["config","validation","boolean","memory"],"backgroundTag":"invalid-config-value-type","analyzedSha":"4fb2db0ea90375ce1059f44fe03ffbd191a7a169","analyzedAt":"2026-08-27T14:35:29.622Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}