HKUDS/Vibe-Trading · error · ValueError

pass either flows or flows_path, not both

Error message

pass either flows or flows_path, not both

What it means

_resolve_flows rejects a call that supplies both inline 'flows' and 'flows_path' at once — the tool would not know which source defines the series. Pass exactly one of the two.

Source

Thrown at agent/src/tools/cashflow_analytics_tool.py:354

def _resolve_flows(kwargs: dict[str, Any]) -> CashFlowSeries | None:
    """Build the cash-flow series from inline records or from a file.

    Args:
        kwargs: The tool's raw inputs.

    Returns:
        A ``CashFlowSeries``, or ``None`` when no flows were supplied.

    Raises:
        ValueError: If both sources were given, an inline record is malformed,
            or a currency is missing. File problems surface as
            ``CashFlowIngestError``, which is a ``ValueError``.
    """
    inline = kwargs.get("flows")
    path = kwargs.get("flows_path")
    if inline and path:
        raise ValueError("pass either flows or flows_path, not both")
    currency = kwargs.get("currency")

    if path:
        columns = kwargs.get("flows_columns")
        if columns is not None and not isinstance(columns, dict):
            raise ValueError("flows_columns must be an object mapping field to column name")
        return load_cashflows(
            str(path),
            columns=columns,
            currency=currency,
            default_kind=kwargs.get("flows_default_kind"),
            date_format=kwargs.get("flows_date_format"),
            invert_sign=bool(kwargs.get("flows_invert_sign", False)),
        )

    if not inline:
        return None
    if not isinstance(inline, list):

View on GitHub (pinned to 80ffdda44c)

Solutions

  1. Delete one of the two parameters: keep flows for small in-memory data, flows_path for CSV files
  2. If the framework auto-injects defaults, configure it to send only one

Example fix

# before
tool.execute(flows=flows_list, flows_path="cf.csv")
# after
tool.execute(flows=flows_list)
Defensive patterns

Strategy: validation

Validate before calling

assert not (kwargs.get("flows") and kwargs.get("flows_path")), "pass only one of flows / flows_path"

Prevention

When it happens

Trigger: execute(flows=[...], flows_path="cashflows.csv") — both keys truthy in the kwargs dict.

Common situations: Agent frameworks merging default arguments with user-supplied ones; prompt templates that pre-fill both parameters; iterative editing where a path is added while forgetting to delete the inline list.

Related errors


AI-assisted analysis of HKUDS/Vibe-Trading@80ffdda44c (2026-08-28). Data as JSON: /api/errors/520792f8dbf4a8ef. Report an issue: GitHub.