HKUDS/Vibe-Trading · error · ValueError

live trading or execution goals are not supported

Error message

live trading or execution goals are not supported

What it means

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.

Source

Thrown at agent/src/goal/policy.py:48

    text = value.strip()
    if not text:
        raise ValueError(f"{field_name} cannot be empty")
    return text


def reject_live_execution_objective(objective: str) -> None:
    """Reject direct live-trading or order-execution goal text.

    Args:
        objective: Research goal objective.

    Raises:
        ValueError: If the objective looks like an execution request.
    """
    text = objective.strip()
    for pattern in _EXECUTION_PATTERNS:
        if pattern.search(text):
            raise ValueError("live trading or execution goals are not supported")

View on GitHub (pinned to 80ffdda44c)

Solutions

  1. Rephrase the goal as research/analysis, e.g. 'backtest and evaluate a momentum strategy' instead of 'buy/sell' or 'execute'
  2. Remove any order-execution verbs (buy, sell, place order, execute trade) from objective and criteria
  3. If you genuinely need execution, this library intentionally does not support it — use a dedicated execution system
  4. Review _EXECUTION_PATTERNS in policy.py to know exactly which phrases trip the filter

Example fix

# before
store.replace_goal(session_id="s1", objective="Buy AAPL whenever momentum is positive", criteria=[...])
# after
store.replace_goal(session_id="s1", objective="Evaluate a momentum signal for AAPL via backtest", criteria=[...])
Defensive patterns

Strategy: validation

Validate before calling

from agent.src.goal.policy import reject_live_execution_objective

try:
    reject_live_execution_objective(objective)
except ValueError:
    objective = rephrase_as_research(objective)  # e.g. 'backtest X' phrasing

store.replace_goal(session_id=sid, objective=objective, criteria=cs)

Type guard

def is_research_objective(text: str) -> bool:
    from agent.src.goal.policy import _EXECUTION_PATTERNS
    return isinstance(text, str) and not any(p.search(text) for p in _EXECUTION_PATTERNS)

Try / catch

try:
    store.replace_goal(session_id=sid, objective=obj, criteria=cs)
except ValueError as e:
    if 'live trading or execution goals' in str(e):
        # rewrite goal as research/backtest wording and retry once
        obj = to_backtest_phrasing(obj)
        store.replace_goal(session_id=sid, objective=obj, criteria=cs)
    else:
        raise

Prevention

When it happens

Trigger: 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'.

Common situations: 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.

Related errors


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