HKUDS/Vibe-Trading · error · ValueError
{field_name} entries must be non-empty strings
Error message
{field_name} entries must be non-empty strings What it means
Each entry inside an include_kinds/exclude_kinds list must be a non-empty string. The coercion rejects non-string items (ints, None, nested lists) and strings that are empty or whitespace-only, since kind labels are matched against flow records verbatim.
Source
Thrown at agent/src/tools/cashflow_analytics_tool.py:447
Args:
raw: Value supplied for ``external_kinds`` or ``internal_kinds``.
field_name: Name used in the error message.
Returns:
The list of labels, or ``None`` to keep the module default.
Raises:
ValueError: If the value is not an array of non-empty strings.
"""
if raw is None:
return None
if not isinstance(raw, list) or not raw:
raise ValueError(f"{field_name} must be a non-empty array of kind labels")
labels: list[str] = []
for item in raw:
if not isinstance(item, str) or not item.strip():
raise ValueError(f"{field_name} entries must be non-empty strings")
labels.append(item)
return labels
def _rounded(value: float) -> float:
"""Round a finite scalar for stable, compact JSON.
Args:
value: Number to round.
Returns:
The value rounded to :data:`_ROUNDING` decimal places.
"""
return round(float(value), _ROUNDING)
def _rounded_or_none(value: float | None) -> float | None:
"""Round a scalar that may be deliberately absent.View on GitHub (pinned to 80ffdda44c)
Solutions
- Strip and drop falsy/non-string items from the list before calling
- Fix the data source so kind labels are always non-empty strings
Example fix
# before execute(flows=flows, include_kinds=["coupon", "", None]) # after kinds = [k for k in raw_kinds if isinstance(k, str) and k.strip()] execute(flows=flows, include_kinds=kinds or None)
Defensive patterns
Strategy: validation
Validate before calling
def clean_kinds(raw):
if raw is None:
return None
cleaned = [k.strip() for k in raw if isinstance(k, str) and k.strip()]
return cleaned or None Type guard
def all_nonempty_strings(seq) -> bool:
return isinstance(seq, list) and all(isinstance(k, str) and k.strip() for k in seq) Try / catch
try:
execute(flows=flows, include_kinds=kinds)
except ValueError as exc:
if "entries must be non-empty strings" in str(exc):
kinds = [k for k in kinds if isinstance(k, str) and k.strip()]
execute(flows=flows, include_kinds=kinds or None)
else:
raise Prevention
- Sanitize user/CSV-derived labels: strip whitespace and drop blanks before building the filter
- Reject null items when deserializing JSON configs
- Keep kind labels canonicalized to a fixed vocabulary
When it happens
Trigger: Passing include_kinds=["dividend", ""] or ["dividend", 0] or [None]; a whitespace-only label like " " also triggers it.
Common situations: Parsing labels from CSV/JSON where blank cells become empty strings; mixing codes and labels; LLM-generated filter arrays containing nulls.
Related errors
- amount must be a finite number, got {self.amount!r}; a missi
- kind={self.kind!r} must have a {direction} amount under the
- pre_translated=True asserts the flows were already converted
- start {lower} is after end {upper}
- flows[{index}]: {exc}
AI-assisted analysis of HKUDS/Vibe-Trading@80ffdda44c (2026-08-28).
Data as JSON: /api/errors/ec4610fdade27f84.
Report an issue: GitHub.