{"record":{"id":"d8b72e60a149bdb7","repo":"HKUDS/Vibe-Trading","slug":"live-trading-or-execution-goals-are-not-supported-d8b72e","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/policy.py","lineNumber":48,"sourceCode":"    text = value.strip()\n    if not text:\n        raise ValueError(f\"{field_name} cannot be empty\")\n    return text\n\n\ndef reject_live_execution_objective(objective: str) -> None:\n    \"\"\"Reject direct live-trading or order-execution goal text.\n\n    Args:\n        objective: Research goal objective.\n\n    Raises:\n        ValueError: If the objective looks like an execution request.\n    \"\"\"\n    text = objective.strip()\n    for pattern in _EXECUTION_PATTERNS:\n        if pattern.search(text):\n            raise ValueError(\"live trading or execution goals are not supported\")\n","sourceCodeStart":30,"sourceCodeEnd":49,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/goal/policy.py#L30-L49","documentation":"reject_live_execution_objective in agent/src/goal/policy.py scans objective text against _EXECUTION_PATTERNS and raises ValueError('live trading or execution goals are not supported') on a match. The system is research-only by design: goals that ask to place orders, execute trades, or run live strategies are refused before being stored.","triggerScenarios":"replace_goal or update_goal with an objective (or later, a criterion) containing phrases matched by the execution regexes — e.g. 'buy 100 AAPL', 'place orders', 'execute trades', 'live trading strategy'.","commonSituations":"Users pasting trading instructions into a research goal; agent prompts auto-generated from chat that include order language; wording like 'trade this strategy daily' in an otherwise analytical objective; tests with realistic trading text.","solutions":["Rephrase the goal as research/analysis, e.g. 'backtest and evaluate a momentum strategy' instead of 'buy/sell' or 'execute'","Remove any order-execution verbs (buy, sell, place order, execute trade) from objective and criteria","If you genuinely need execution, this library intentionally does not support it — use a dedicated execution system","Review _EXECUTION_PATTERNS in policy.py to know exactly which phrases trip the filter"],"exampleFix":"# before\nstore.replace_goal(session_id=\"s1\", objective=\"Buy AAPL whenever momentum is positive\", criteria=[...])\n# after\nstore.replace_goal(session_id=\"s1\", objective=\"Evaluate a momentum signal for AAPL via backtest\", criteria=[...])","handlingStrategy":"validation","validationCode":"from agent.src.goal.policy import reject_live_execution_objective\n\ntry:\n    reject_live_execution_objective(objective)\nexcept ValueError:\n    objective = rephrase_as_research(objective)  # e.g. 'backtest X' phrasing\n\nstore.replace_goal(session_id=sid, objective=objective, criteria=cs)","typeGuard":"def is_research_objective(text: str) -> bool:\n    from agent.src.goal.policy import _EXECUTION_PATTERNS\n    return isinstance(text, str) and not any(p.search(text) for p in _EXECUTION_PATTERNS)","tryCatchPattern":"try:\n    store.replace_goal(session_id=sid, objective=obj, criteria=cs)\nexcept ValueError as e:\n    if 'live trading or execution goals' in str(e):\n        # rewrite goal as research/backtest wording and retry once\n        obj = to_backtest_phrasing(obj)\n        store.replace_goal(session_id=sid, objective=obj, criteria=cs)\n    else:\n        raise","preventionTips":["Phrase goals as analysis/backtesting, never order placement","Screen user prompts for buy/sell/execute words before storing","Remember criteria text is scanned too, not just the objective"],"tags":["policy","goal-store","live-trading","input-validation"],"backgroundTag":"unsupported-operation-rejected","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}