{"record":{"id":"e2c4c6fd6e1a9440","repo":"HKUDS/Vibe-Trading","slug":"flows-may-contain-at-most-max-inline-flows-entr","errorCode":null,"errorMessage":"flows may contain at most {_MAX_INLINE_FLOWS} entries","messagePattern":"flows may contain at most (.+?) entries","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agent/src/tools/cashflow_analytics_tool.py","lineNumber":375,"sourceCode":"    if path:\n        columns = kwargs.get(\"flows_columns\")\n        if columns is not None and not isinstance(columns, dict):\n            raise ValueError(\"flows_columns must be an object mapping field to column name\")\n        return load_cashflows(\n            str(path),\n            columns=columns,\n            currency=currency,\n            default_kind=kwargs.get(\"flows_default_kind\"),\n            date_format=kwargs.get(\"flows_date_format\"),\n            invert_sign=bool(kwargs.get(\"flows_invert_sign\", False)),\n        )\n\n    if not inline:\n        return None\n    if not isinstance(inline, list):\n        raise ValueError(\"flows must be an array of {date, amount, kind} objects\")\n    if len(inline) > _MAX_INLINE_FLOWS:\n        raise ValueError(f\"flows may contain at most {_MAX_INLINE_FLOWS} entries\")\n\n    records: list[CashFlow] = []\n    for index, item in enumerate(inline):\n        if not isinstance(item, dict):\n            raise ValueError(f\"flows[{index}] must be an object\")\n        row_currency = item.get(\"currency\") or currency\n        if not row_currency:\n            raise ValueError(\n                f\"flows[{index}] has no currency and no top-level currency was \"\n                \"given; currency is never defaulted\"\n            )\n        try:\n            records.append(\n                CashFlow(\n                    date=item[\"date\"],\n                    amount=item[\"amount\"],\n                    kind=item[\"kind\"],\n                    currency=row_currency,","sourceCodeStart":357,"sourceCodeEnd":393,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/tools/cashflow_analytics_tool.py#L357-L393","documentation":"The inline flows array exceeds _MAX_INLINE_FLOWS entries. The cap exists to bound tool-call payload size and compute time; large datasets must go through flows_path (CSV file) instead.","triggerScenarios":"execute(flows=[...5000 records...]) where len(inline) > _MAX_INLINE_FLOWS.","commonSituations":"Trying to pass a full transaction history inline; agents stuffing exported ledgers into the tool call; migrating a batch job onto the tool without offloading to a file.","solutions":["Write the flows to a CSV and pass flows_path instead of (or here, in place of) the inline list","Batch or downsample the data if only aggregates are needed","Check the _MAX_INLINE_FLOWS constant in the module for the exact limit"],"exampleFix":"# before\nexecute(flows=records)  # too many\n# after\nimport csv\nwith open(\"cf.csv\", \"w\", newline=\"\") as f:\n    w = csv.DictWriter(f, fieldnames=[\"date\", \"amount\", \"kind\"])\n    w.writeheader(); w.writerows(records)\nexecute(flows_path=\"cf.csv\")","handlingStrategy":"validation","validationCode":"from agent.src.tools.cashflow_analytics_tool import _MAX_INLINE_FLOWS\nif len(flows) > _MAX_INLINE_FLOWS:\n    # export to CSV and use flows_path instead\n    ...","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check the module's _MAX_INLINE_FLOWS constant before large calls","Move big datasets to a CSV + flows_path"],"tags":["cashflow-analytics","flows","payload-limit","python"],"backgroundTag":"input-size-limit-exceeded","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}