OpenBMB/ChatDev · error · ConfigError

expected non-empty string

Error message

expected non-empty string

What it means

ValidationError raised when require_yaml_extension is true (the default for most endpoints) and the filename does not end with .yaml or .yml.

Source

Thrown at entity/configs/base.py:229

        return dict(value)
    if isinstance(value, Mapping):
        return dict(value)
    raise ConfigError("expected mapping", path=str(value))


def require_mapping(data: Any, path: str) -> Mapping[str, Any]:
    if not isinstance(data, Mapping):
        raise ConfigError("expected mapping", path)
    return data


def require_str(data: Mapping[str, Any], key: str, path: str, *, allow_empty: bool = False) -> str:
    value = data.get(key)
    key_path = f"{path}.{key}" if path else key
    if not isinstance(value, str):
        raise ConfigError("expected string", key_path)
    if not allow_empty and not value.strip():
        raise ConfigError("expected non-empty string", key_path)
    return value


def optional_str(data: Mapping[str, Any], key: str, path: str) -> str | None:
    value = data.get(key)
    if value is None or value == "":
        return None
    key_path = f"{path}.{key}" if path else key
    if not isinstance(value, str):
        raise ConfigError("expected string", key_path)
    return value


def require_bool(data: Mapping[str, Any], key: str, path: str) -> bool:
    value = data.get(key)
    key_path = f"{path}.{key}" if path else key
    if not isinstance(value, bool):
        raise ConfigError("expected boolean", key_path)

View on GitHub (pinned to 4fb2db0ea9)

Solutions

  1. Append .yaml or .yml to the filename in the request.
  2. Centralize filename construction so the extension is always added once.
  3. If listing names from another API, map name -> name + '.yaml' before file operations.

Example fix

# before
client.get('/api/workflows/myflow/args')
# after
client.get('/api/workflows/myflow.yaml/args')
Defensive patterns

Strategy: validation

Validate before calling

if (!/\.(yaml|yml)$/.test(name)) name += '.yaml';

Type guard

const hasYamlExt = (n: string) => /\.(yaml|yml)$/.test(n);

Prevention

When it happens

Trigger: Calling get args/desc/raw/delete/rename/copy with 'myworkflow' or 'myworkflow.txt'; forgetting the extension when building the request.

Common situations: Clients treating the bare workflow name as the identifier; templates that append the wrong extension; API consumers assuming extension is implicit.

Related errors


AI-assisted analysis of OpenBMB/ChatDev@4fb2db0ea9 (2026-08-27). Data as JSON: /api/errors/a40cb848133cb2d1. Report an issue: GitHub.