fix: Multiple bug fixes and improvements

- Fix Invalid Date display in Dashboard notifications
- Fix timezone offset (8 hours) in Trading Records time display
- Fix position closing failures due to commission discrepancies (fetch actual exchange position size for reduce_only orders)
- Fix IBKR connection error 'no current event loop in thread' by ensuring asyncio event loop exists
- Fix duplicate orders on same candle by extending signal deduplication to close signals
- Add responsive design for Profile page (mobile-friendly)
- Remove unused strategy_code module and database table
- Fix LLM service to support multiple providers (OpenRouter, OpenAI, DeepSeek, Grok, Google)
- Add auto-detection of configured LLM provider based on API key availability
- Fix AI code generation to use unified LLMService with proper provider selection
- Fix crypto symbol format handling (ETH/USDT no longer becomes ETH/USDT/USDT)
- Fix Commission display showing '0E-8' in Trading Records
- Fix P&L display for signal-only trades (show '--' for unrealized P&L)
- Fix OAuth login not updating last_login_at for new users
- Add migration script for notification_settings column
- Update env.example with new LLM provider configurations
- Remove ESLint rule that was not defined in config
This commit is contained in:
TIANHE
2026-01-24 03:22:14 +08:00
parent 7de1570b3a
commit f4e5a9f8e0
22 changed files with 1358 additions and 464 deletions
+34 -1
View File
@@ -145,7 +145,13 @@ ENABLE_REFLECTION_WORKER=false
REFLECTION_WORKER_INTERVAL_SEC=86400
# =========================
# OpenRouter / LLM
# LLM Provider Selection
# =========================
# Choose your LLM provider: openrouter, openai, google, deepseek, grok
LLM_PROVIDER=openrouter
# =========================
# OpenRouter (Multi-model gateway, recommended)
# =========================
OPENROUTER_API_KEY=
OPENROUTER_API_URL=https://openrouter.ai/api/v1/chat/completions
@@ -155,6 +161,33 @@ OPENROUTER_MAX_TOKENS=4000
OPENROUTER_TIMEOUT=300
OPENROUTER_CONNECT_TIMEOUT=30
# =========================
# OpenAI Direct
# =========================
OPENAI_API_KEY=
OPENAI_BASE_URL=https://api.openai.com/v1
OPENAI_MODEL=gpt-4o
# =========================
# Google Gemini
# =========================
GOOGLE_API_KEY=
GOOGLE_MODEL=gemini-1.5-flash
# =========================
# DeepSeek
# =========================
DEEPSEEK_API_KEY=
DEEPSEEK_BASE_URL=https://api.deepseek.com/v1
DEEPSEEK_MODEL=deepseek-chat
# =========================
# xAI Grok
# =========================
GROK_API_KEY=
GROK_BASE_URL=https://api.x.ai/v1
GROK_MODEL=grok-beta
# Optional: override model list shown in UI (JSON object: {"model_id":"Display Name", ...})
AI_MODELS_JSON={}