{"record":{"id":"6e51784e845df75f","repo":"OpenBMB/ChatDev","slug":"expected-string","errorCode":null,"errorMessage":"expected string","messagePattern":"expected string","errorType":"validation","errorClass":"ConfigError","httpStatus":null,"severity":"error","filePath":"entity/configs/base.py","lineNumber":227,"sourceCode":"        return {}\n    if isinstance(value, MutableMapping):\n        return dict(value)\n    if isinstance(value, Mapping):\n        return dict(value)\n    raise ConfigError(\"expected mapping\", path=str(value))\n\n\ndef require_mapping(data: Any, path: str) -> Mapping[str, Any]:\n    if not isinstance(data, Mapping):\n        raise ConfigError(\"expected mapping\", path)\n    return data\n\n\ndef require_str(data: Mapping[str, Any], key: str, path: str, *, allow_empty: bool = False) -> str:\n    value = data.get(key)\n    key_path = f\"{path}.{key}\" if path else key\n    if not isinstance(value, str):\n        raise ConfigError(\"expected string\", key_path)\n    if not allow_empty and not value.strip():\n        raise ConfigError(\"expected non-empty string\", key_path)\n    return value\n\n\ndef optional_str(data: Mapping[str, Any], key: str, path: str) -> str | None:\n    value = data.get(key)\n    if value is None or value == \"\":\n        return None\n    key_path = f\"{path}.{key}\" if path else key\n    if not isinstance(value, str):\n        raise ConfigError(\"expected string\", key_path)\n    return value\n\n\ndef require_bool(data: Mapping[str, Any], key: str, path: str) -> bool:\n    value = data.get(key)\n    key_path = f\"{path}.{key}\" if path else key","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/OpenBMB/ChatDev/blob/4fb2db0ea90375ce1059f44fe03ffbd191a7a169/entity/configs/base.py#L209-L245","documentation":"ValidationError raised when the filename contains characters outside [a-zA-Z0-9._-]; spaces, slashes and unicode are rejected. Note a plain 'Invalid filename format' SecurityError exists separately for traversal patterns.","triggerScenarios":"Filenames like 'my flow.yaml', 'flow(1).yaml', '流程.yaml', or any character not in the allowed set passed to workflow endpoints.","commonSituations":"Natural-language titles used as filenames; files copied from Windows/other locales; renamed downloads with parentheses or spaces.","solutions":["Rename to only letters, digits, dots, underscores, hyphens.","Sanitize with a client-side regex before the request.","Avoid unicode/space characters in workflow names by design."],"exampleFix":"# before\nfilename = 'my flow (final).yaml'\n# after\nimport re\nfilename = re.sub(r'[^a-zA-Z0-9._-]', '_', 'my flow (final)') + '.yaml'  # my_flow__final_.yaml","handlingStrategy":"validation","validationCode":"if (!/^[a-zA-Z0-9._-]+$/.test(name)) name = name.replace(/[^a-zA-Z0-9._-]/g, '_');","typeGuard":"const isValidWorkflowName = (n: string) => /^[a-zA-Z0-9._-]+$/.test(n);","tryCatchPattern":null,"preventionTips":["Adopt an ASCII naming convention for workflows","Sanitize user-supplied titles before file operations"],"tags":["workflow","validation","filename"],"backgroundTag":"invalid-filename-characters","analyzedSha":"4fb2db0ea90375ce1059f44fe03ffbd191a7a169","analyzedAt":"2026-08-27T14:35:29.622Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}