{"record":{"id":"afd747e8278be72c","repo":"HKUDS/Vibe-Trading","slug":"live-trading-or-execution-goals-are-not-supported-afd747","errorCode":null,"errorMessage":"live trading or execution goals are not supported","messagePattern":"live trading or execution goals are not supported","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agent/src/goal/store.py","lineNumber":299,"sourceCode":"            ui_summary: Optional compact summary.\n            source: Source of goal creation.\n            protocol: Finance research protocol name.\n            risk_tier: Risk classification.\n            token_budget: Optional token budget.\n            turn_budget: Optional turn budget.\n            time_budget_seconds: Optional wall-clock budget.\n\n        Returns:\n            The newly active goal.\n\n        Raises:\n            ValueError: If objective or criteria are empty.\n        \"\"\"\n        session_id = normalize_required_text(session_id, \"session_id\")\n        objective = normalize_required_text(objective, \"goal objective\")\n        reject_live_execution_objective(objective)\n        if risk_tier is RiskTier.LIVE_TRADING_OR_EXECUTION:\n            raise ValueError(\"live trading or execution goals are not supported\")\n        cleaned_criteria = [item.strip() for item in criteria if item.strip()]\n        if not cleaned_criteria:\n            raise ValueError(\"at least one goal criterion is required\")\n        for criterion in cleaned_criteria:\n            reject_live_execution_objective(criterion)\n        budgets = {\n            \"token_budget\": token_budget,\n            \"turn_budget\": turn_budget,\n            \"time_budget_seconds\": time_budget_seconds,\n        }\n        for name, value in budgets.items():\n            if value is not None and value <= 0:\n                raise ValueError(f\"{name} must be positive\")\n\n        now = _now_iso()\n        goal_id = _id(\"goal\")\n        summary = ui_summary.strip() or objective[:80]\n        current_values = [status.value for status in _CURRENT_STATUSES]","sourceCodeStart":281,"sourceCodeEnd":317,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/goal/store.py#L281-L317","documentation":"replace_goal in agent/src/goal/store.py re-raises the same 'live trading or execution goals are not supported' ValueError in two cases: the objective/criteria text matches the execution patterns (delegated to reject_live_execution_objective), or risk_tier is explicitly RiskTier.LIVE_TRADING_OR_EXECUTION. It is the store-level enforcement of the research-only policy.","triggerScenarios":"Calling replace_goal with risk_tier=RiskTier.LIVE_TRADING_OR_EXECUTION, or with an objective/criterion containing execution-style wording ('place order', 'execute trades', 'live trading').","commonSituations":"Wiring an agent CLI (cmd_start) or research pipeline that forwards raw user intent; enum-driven UI exposing the LIVE_TRADING tier; criteria lists copied from trading checklists that include order language.","solutions":["Use a research-appropriate risk_tier (e.g. the default/research tier) instead of LIVE_TRADING_OR_EXECUTION","Rewrite objective and every criterion to describe analysis/backtesting, not order execution","Add a UI-level check that greps objective text for buy/sell/execute words before calling the store","If execution is the real requirement, route it to a system built for it — this store will keep rejecting it"],"exampleFix":"# before\nstore.replace_goal(session_id=\"s1\", objective=\"Run live momentum strategy\", criteria=[\"Execute trades daily\"], risk_tier=RiskTier.LIVE_TRADING_OR_EXECUTION)\n# after\nstore.replace_goal(session_id=\"s1\", objective=\"Backtest momentum strategy on SP500\", criteria=[\"Sharpe > 1 over 5y\"], risk_tier=RiskTier.RESEARCH)","handlingStrategy":"validation","validationCode":"from agent.src.goal.policy import reject_live_execution_objective\n\nif risk_tier is RiskTier.LIVE_TRADING_OR_EXECUTION:\n    raise ValueError('this app only supports research goals')\nfor text in [objective, *criteria]:\n    reject_live_execution_objective(text)  # fail fast with context\nstore.replace_goal(session_id=sid, objective=objective, criteria=criteria, risk_tier=risk_tier)","typeGuard":"def is_supported_goal(objective: str, criteria: list[str], risk_tier) -> bool:\n    from agent.src.goal.policy import _EXECUTION_PATTERNS\n    import re\n    texts_ok = not any(p.search(t) for t in [objective, *criteria] for p in _EXECUTION_PATTERNS)\n    return texts_ok and risk_tier is not RiskTier.LIVE_TRADING_OR_EXECUTION","tryCatchPattern":"try:\n    store.replace_goal(session_id=sid, objective=obj, criteria=cs, risk_tier=tier)\nexcept ValueError as e:\n    if 'not supported' in str(e):\n        raise UnsupportedGoalError('Rephrase as a research goal and use a research risk tier') from e\n    raise","preventionTips":["Never expose LIVE_TRADING_OR_EXECUTION in research UIs","Sanitize both objective and every criterion for execution wording","Pre-validate with reject_live_execution_objective to get errors at the right layer"],"tags":["policy","goal-store","risk-tier","live-trading"],"backgroundTag":"unsupported-operation-rejected","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}