mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-06 04:20:59 +08:00
The lightning button on the symbol panel was the single biggest "agent does nothing" complaint: it created a trader and a strategy via direct REST calls, then handed the user a hardcoded reply that read "我没有自动启动实盘交易。请到 Traders 面板确认风控后手动 Start" — i.e. the chat bot openly admitted it bypassed the agent and refused to do the work the user had clearly asked for. - web/src/lib/hyperliquidQuickTrade.ts: after createStrategy + createTrader (or finding an existing trader), call POST /api/traders/:id/start immediately. Report `started`, `reusedTrader`, and an optional `startError` so the chat reply can be honest about what happened — created vs reused, running vs failed, and why. - web/src/pages/AgentChatPage.tsx: replace the canned "please start manually" reply with one that reflects reality. Success path shows the symbol, strategy, 5-min scan interval, and how to halt it via chat. Failure path surfaces the actual start error and tells the user the trader exists but is not running. - web/src/lib/hyperliquidQuickTrade.ts: per-symbol prompt now routes on category. Stocks (category="stock") get a long-only, momentum- seeking prompt — break of high, volume spike, support reclaim, sector catalyst — because shorting individual US equities through the agent is rarely what the user wants. Crypto stays bidirectional but disciplined. The trader-level custom_prompt is rewritten in the same style and explicitly forbids rotating to other symbols.