{"record":{"id":"520792f8dbf4a8ef","repo":"HKUDS/Vibe-Trading","slug":"pass-either-flows-or-flows-path-not-both","errorCode":null,"errorMessage":"pass either flows or flows_path, not both","messagePattern":"pass either flows or flows_path, not both","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agent/src/tools/cashflow_analytics_tool.py","lineNumber":354,"sourceCode":"\ndef _resolve_flows(kwargs: dict[str, Any]) -> CashFlowSeries | None:\n    \"\"\"Build the cash-flow series from inline records or from a file.\n\n    Args:\n        kwargs: The tool's raw inputs.\n\n    Returns:\n        A ``CashFlowSeries``, or ``None`` when no flows were supplied.\n\n    Raises:\n        ValueError: If both sources were given, an inline record is malformed,\n            or a currency is missing. File problems surface as\n            ``CashFlowIngestError``, which is a ``ValueError``.\n    \"\"\"\n    inline = kwargs.get(\"flows\")\n    path = kwargs.get(\"flows_path\")\n    if inline and path:\n        raise ValueError(\"pass either flows or flows_path, not both\")\n    currency = kwargs.get(\"currency\")\n\n    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):","sourceCodeStart":336,"sourceCodeEnd":372,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/tools/cashflow_analytics_tool.py#L336-L372","documentation":"_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.","triggerScenarios":"execute(flows=[...], flows_path=\"cashflows.csv\") — both keys truthy in the kwargs dict.","commonSituations":"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.","solutions":["Delete one of the two parameters: keep flows for small in-memory data, flows_path for CSV files","If the framework auto-injects defaults, configure it to send only one"],"exampleFix":"# before\ntool.execute(flows=flows_list, flows_path=\"cf.csv\")\n# after\ntool.execute(flows=flows_list)","handlingStrategy":"validation","validationCode":"assert not (kwargs.get(\"flows\") and kwargs.get(\"flows_path\")), \"pass only one of flows / flows_path\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Decide on one input mode per integration and document it","Audit framework default-merging so both keys never get set"],"tags":["cashflow-analytics","mutually-exclusive-params","input-validation","python"],"backgroundTag":"conflicting-parameters","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}