From 410fba624459201c6416c65728c0d5efaab62847 Mon Sep 17 00:00:00 2001 From: Yinghao Fan Date: Fri, 31 Oct 2025 02:06:20 +0800 Subject: [PATCH 1/6] fix: Correct error handling in decision parsing Changes: - Updated error handling in `GetFullDecision` and `parseFullDecisionResponse` functions to return the decision object even when an error occurs, improving the clarity of error messages. This ensures that the decision object is consistently returned, allowing for better debugging and handling of errors in the decision-making process. --- decision/engine.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/decision/engine.go b/decision/engine.go index 76bcffca..97181572 100644 --- a/decision/engine.go +++ b/decision/engine.go @@ -109,7 +109,7 @@ func GetFullDecision(ctx *Context, mcpClient *mcp.Client) (*FullDecision, error) // 4. 解析AI响应 decision, err := parseFullDecisionResponse(aiResponse, ctx.Account.TotalEquity, ctx.BTCETHLeverage, ctx.AltcoinLeverage) if err != nil { - return nil, fmt.Errorf("解析AI响应失败: %w", err) + return decision, fmt.Errorf("解析AI响应失败: %w", err) } decision.Timestamp = time.Now() @@ -427,7 +427,7 @@ func parseFullDecisionResponse(aiResponse string, accountEquity float64, btcEthL return &FullDecision{ CoTTrace: cotTrace, Decisions: []Decision{}, - }, fmt.Errorf("提取决策失败: %w\n\n=== AI思维链分析 ===\n%s", err, cotTrace) + }, fmt.Errorf("提取决策失败: %w", err) } // 3. 验证决策 @@ -435,7 +435,7 @@ func parseFullDecisionResponse(aiResponse string, accountEquity float64, btcEthL return &FullDecision{ CoTTrace: cotTrace, Decisions: decisions, - }, fmt.Errorf("决策验证失败: %w\n\n=== AI思维链分析 ===\n%s", err, cotTrace) + }, fmt.Errorf("决策验证失败: %w", err) } return &FullDecision{ From 8d172d0993d1b9b46f9fec7eabfbe61b56680deb Mon Sep 17 00:00:00 2001 From: zbhan Date: Sat, 1 Nov 2025 22:25:32 -0400 Subject: [PATCH 2/6] fix: github workflow permission --- .github/workflows/pr-checks-advisory.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr-checks-advisory.yml b/.github/workflows/pr-checks-advisory.yml index 1c352233..9cab882d 100644 --- a/.github/workflows/pr-checks-advisory.yml +++ b/.github/workflows/pr-checks-advisory.yml @@ -8,12 +8,16 @@ on: # These checks are advisory only - they won't block PR merging # Results will be posted as comments to help contributors improve their PRs +permissions: + contents: read + pull-requests: write + checks: write + issues: write + jobs: pr-info: name: PR Information runs-on: ubuntu-latest - permissions: - pull-requests: write steps: - name: Check PR title format id: check-title @@ -98,8 +102,6 @@ jobs: backend-checks: name: Backend Checks (Advisory) runs-on: ubuntu-latest - permissions: - pull-requests: write continue-on-error: true steps: - uses: actions/checkout@v4 @@ -208,8 +210,6 @@ jobs: frontend-checks: name: Frontend Checks (Advisory) runs-on: ubuntu-latest - permissions: - pull-requests: write continue-on-error: true steps: - uses: actions/checkout@v4 From 4210656856542b7ab92c81781250df012651c59d Mon Sep 17 00:00:00 2001 From: Xeron Date: Sun, 2 Nov 2025 10:56:24 +0800 Subject: [PATCH 3/6] Fix broken DashScope link in README files (fixes #128) --- README.md | 4 ++-- docs/i18n/ru/README.md | 4 ++-- docs/i18n/uk/README.md | 2 +- docs/i18n/zh-CN/README.md | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0fa6210e..4c706a85 100644 --- a/README.md +++ b/README.md @@ -406,7 +406,7 @@ Before configuring the system, you need to obtain AI API keys. Choose one of the **How to get Qwen API Key:** -1. **Visit**: [https://dashscope.aliyuncs.com](https://dashscope.aliyuncs.com) +1. **Visit**: [https://dashscope.console.aliyun.com](https://dashscope.console.aliyun.com) 2. **Register**: Sign up with Alibaba Cloud account 3. **Enable Service**: Activate DashScope service 4. **Create API Key**: @@ -1271,7 +1271,7 @@ We welcome contributions from the community! See our comprehensive guides: - [Binance API](https://binance-docs.github.io/apidocs/futures/en/) - Binance Futures API - [DeepSeek](https://platform.deepseek.com/) - DeepSeek AI API -- [Qwen](https://dashscope.aliyuncs.com/) - Alibaba Cloud Qwen +- [Qwen](https://dashscope.console.aliyun.com/) - Alibaba Cloud Qwen - [TA-Lib](https://ta-lib.org/) - Technical indicator library - [Recharts](https://recharts.org/) - React chart library diff --git a/docs/i18n/ru/README.md b/docs/i18n/ru/README.md index 2feaa824..fa2153ab 100644 --- a/docs/i18n/ru/README.md +++ b/docs/i18n/ru/README.md @@ -399,7 +399,7 @@ cd .. **Как получить Qwen API ключ:** -1. **Посетите**: [https://dashscope.aliyuncs.com](https://dashscope.aliyuncs.com) +1. **Посетите**: [https://dashscope.console.aliyun.com](https://dashscope.console.aliyun.com) 2. **Зарегистрируйтесь**: Используя аккаунт Alibaba Cloud 3. **Активируйте сервис**: Активируйте DashScope сервис 4. **Создайте API ключ**: @@ -1094,7 +1094,7 @@ sudo apt-get install libta-lib0-dev - [Binance API](https://binance-docs.github.io/apidocs/futures/en/) - Binance Futures API - [DeepSeek](https://platform.deepseek.com/) - DeepSeek AI API -- [Qwen](https://dashscope.aliyuncs.com/) - Alibaba Cloud Qwen +- [Qwen](https://dashscope.console.aliyun.com/) - Alibaba Cloud Qwen - [TA-Lib](https://ta-lib.org/) - Библиотека технических индикаторов - [Recharts](https://recharts.org/) - Библиотека графиков React diff --git a/docs/i18n/uk/README.md b/docs/i18n/uk/README.md index 19d506ef..4d3622e2 100644 --- a/docs/i18n/uk/README.md +++ b/docs/i18n/uk/README.md @@ -402,7 +402,7 @@ cd .. **Як отримати Qwen API ключ:** -1. **Відвідайте**: [https://dashscope.aliyuncs.com](https://dashscope.aliyuncs.com) +1. **Відвідайте**: [https://dashscope.console.aliyun.com](https://dashscope.console.aliyun.com) 2. **Зареєструйтеся**: Використовуючи акаунт Alibaba Cloud 3. **Активуйте сервіс**: Активуйте DashScope сервіс 4. **Створіть API ключ**: diff --git a/docs/i18n/zh-CN/README.md b/docs/i18n/zh-CN/README.md index 29d69c8e..8e3aedcf 100644 --- a/docs/i18n/zh-CN/README.md +++ b/docs/i18n/zh-CN/README.md @@ -398,7 +398,7 @@ cd .. **如何获取Qwen API密钥:** -1. **访问**:[https://dashscope.aliyuncs.com](https://dashscope.aliyuncs.com) +1. **访问**:[https://dashscope.console.aliyun.com](https://dashscope.console.aliyun.com) 2. **注册**:使用阿里云账户注册 3. **开通服务**:激活DashScope服务 4. **创建API密钥**: @@ -1290,7 +1290,7 @@ MIT License - 详见 [LICENSE](LICENSE) 文件 - [Binance API](https://binance-docs.github.io/apidocs/futures/cn/) - 币安合约API - [DeepSeek](https://platform.deepseek.com/) - DeepSeek AI API -- [Qwen](https://dashscope.aliyuncs.com/) - 阿里云通义千问 +- [Qwen](https://dashscope.console.aliyun.com/) - 阿里云通义千问 - [TA-Lib](https://ta-lib.org/) - 技术指标库 - [Recharts](https://recharts.org/) - React图表库 From 90f40055d09a0a6ade57c3d6e660102bb7ab07d6 Mon Sep 17 00:00:00 2001 From: tinkle-community Date: Sun, 2 Nov 2025 12:15:40 +0800 Subject: [PATCH 4/6] update aster exchange guide --- README.md | 22 ++++++++++++---------- README.ru.md | 22 ++++++++++++---------- README.uk.md | 22 ++++++++++++---------- README.zh-CN.md | 22 ++++++++++++---------- 4 files changed, 48 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index 05b209e4..783a1495 100644 --- a/README.md +++ b/README.md @@ -98,11 +98,12 @@ A Binance-compatible decentralized perpetual futures exchange! - 🌐 **Multi-chain support** - trade on your preferred EVM chain **Quick Start:** -1. Visit [Aster API Wallet](https://www.asterdex.com/en/api-wallet) -2. Connect your main wallet and create an API wallet -3. Copy the API Signer address and Private Key -4. Set `"exchange": "aster"` in config.json -5. Add `"aster_user"`, `"aster_signer"`, and `"aster_private_key"` +1. Register via [Aster Referral Link](https://www.asterdex.com/en/referral/fdfc0e) (get fee discounts!) +2. Visit [Aster API Wallet](https://www.asterdex.com/en/api-wallet) +3. Connect your main wallet and create an API wallet +4. Copy the API Signer address and Private Key +5. Set `"exchange": "aster"` in config.json +6. Add `"aster_user"`, `"aster_signer"`, and `"aster_private_key"` --- @@ -535,12 +536,13 @@ cp config.json.example config.json - 🌐 Multi-chain support (ETH, BSC, Polygon) - 🌍 No KYC required -**Step 1**: Create Aster API Wallet +**Step 1**: Register and Create Aster API Wallet -1. Visit [Aster API Wallet](https://www.asterdex.com/en/api-wallet) -2. Connect your main wallet (MetaMask, WalletConnect, etc.) -3. Click "Create API Wallet" -4. **Save these 3 items immediately:** +1. Register via [Aster Referral Link](https://www.asterdex.com/en/referral/fdfc0e) (get fee discounts!) +2. Visit [Aster API Wallet](https://www.asterdex.com/en/api-wallet) +3. Connect your main wallet (MetaMask, WalletConnect, etc.) +4. Click "Create API Wallet" +5. **Save these 3 items immediately:** - Main Wallet address (User) - API Wallet address (Signer) - API Wallet Private Key (⚠️ shown only once!) diff --git a/README.ru.md b/README.ru.md index 7a06c10a..b3dc8e63 100644 --- a/README.ru.md +++ b/README.ru.md @@ -98,11 +98,12 @@ NOFX теперь поддерживает **три основные биржи* - 🌐 **Поддержка нескольких цепей** - торгуйте на вашей любимой EVM цепи **Быстрый старт:** -1. Посетите [Aster API Wallet](https://www.asterdex.com/en/api-wallet) -2. Подключите основной кошелек и создайте API кошелек -3. Скопируйте адрес API Signer и приватный ключ -4. Установите `"exchange": "aster"` в config.json -5. Добавьте `"aster_user"`, `"aster_signer"` и `"aster_private_key"` +1. Зарегистрируйтесь по [реферальной ссылке Aster](https://www.asterdex.com/en/referral/fdfc0e) (получите скидку на комиссии!) +2. Посетите [Aster API Wallet](https://www.asterdex.com/en/api-wallet) +3. Подключите основной кошелек и создайте API кошелек +4. Скопируйте адрес API Signer и приватный ключ +5. Установите `"exchange": "aster"` в config.json +6. Добавьте `"aster_user"`, `"aster_signer"` и `"aster_private_key"` --- @@ -462,12 +463,13 @@ cp config.json.example config.json - 🌐 Поддержка нескольких цепей (ETH, BSC, Polygon) - 🌍 Не нужна KYC -**Шаг 1**: Создайте Aster API кошелек +**Шаг 1**: Зарегистрируйтесь и создайте Aster API кошелек -1. Посетите [Aster API Wallet](https://www.asterdex.com/en/api-wallet) -2. Подключите основной кошелек (MetaMask, WalletConnect и т.д.) -3. Нажмите "Создать API кошелек" -4. **Сохраните эти 3 элемента немедленно:** +1. Зарегистрируйтесь по [реферальной ссылке Aster](https://www.asterdex.com/en/referral/fdfc0e) (получите скидку на комиссии!) +2. Посетите [Aster API Wallet](https://www.asterdex.com/en/api-wallet) +3. Подключите основной кошелек (MetaMask, WalletConnect и т.д.) +4. Нажмите "Создать API кошелек" +5. **Сохраните эти 3 элемента немедленно:** - Адрес основного кошелька (User) - Адрес API кошелька (Signer) - Приватный ключ API кошелька (⚠️ показывается только один раз!) diff --git a/README.uk.md b/README.uk.md index a54eef1f..3a667f7e 100644 --- a/README.uk.md +++ b/README.uk.md @@ -98,11 +98,12 @@ NOFX тепер підтримує **три основні біржі**: Binance - 🌐 **Підтримка кількох ланцюгів** - торгуйте на вашому улюбленому EVM ланцюзі **Швидкий старт:** -1. Відвідайте [Aster API Wallet](https://www.asterdex.com/en/api-wallet) -2. Підключіть основний гаманець і створіть API гаманець -3. Скопіюйте адресу API Signer та приватний ключ -4. Встановіть `"exchange": "aster"` в config.json -5. Додайте `"aster_user"`, `"aster_signer"` та `"aster_private_key"` +1. Зареєструйтеся за [реферальним посиланням Aster](https://www.asterdex.com/en/referral/fdfc0e) (отримайте знижку на комісії!) +2. Відвідайте [Aster API Wallet](https://www.asterdex.com/en/api-wallet) +3. Підключіть основний гаманець і створіть API гаманець +4. Скопіюйте адресу API Signer та приватний ключ +5. Встановіть `"exchange": "aster"` в config.json +6. Додайте `"aster_user"`, `"aster_signer"` та `"aster_private_key"` --- @@ -462,12 +463,13 @@ cp config.json.example config.json - 🌐 Підтримка кількох ланцюгів (ETH, BSC, Polygon) - 🌍 Не потрібна KYC -**Крок 1**: Створіть Aster API гаманець +**Крок 1**: Зареєструйтеся та створіть Aster API гаманець -1. Відвідайте [Aster API Wallet](https://www.asterdex.com/en/api-wallet) -2. Підключіть основний гаманець (MetaMask, WalletConnect тощо) -3. Натисніть "Створити API гаманець" -4. **Збережіть ці 3 елементи негайно:** +1. Зареєструйтеся за [реферальним посиланням Aster](https://www.asterdex.com/en/referral/fdfc0e) (отримайте знижку на комісії!) +2. Відвідайте [Aster API Wallet](https://www.asterdex.com/en/api-wallet) +3. Підключіть основний гаманець (MetaMask, WalletConnect тощо) +4. Натисніть "Створити API гаманець" +5. **Збережіть ці 3 елементи негайно:** - Адреса основного гаманця (User) - Адреса API гаманця (Signer) - Приватний ключ API гаманця (⚠️ показується лише один раз!) diff --git a/README.zh-CN.md b/README.zh-CN.md index 1a28811d..412632b8 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -98,11 +98,12 @@ NOFX现已支持**三大交易所**:Binance、Hyperliquid和Aster DEX! - 🌐 **多链支持** - 在你喜欢的EVM链上交易 **快速开始:** -1. 访问[Aster API钱包](https://www.asterdex.com/en/api-wallet) -2. 连接你的主钱包并创建API钱包 -3. 复制API Signer地址和私钥 -4. 在config.json中设置`"exchange": "aster"` -5. 添加`"aster_user"`、`"aster_signer"`和`"aster_private_key"` +1. 通过[推荐链接注册Aster](https://www.asterdex.com/en/referral/fdfc0e)(享手续费优惠) +2. 访问[Aster API钱包](https://www.asterdex.com/en/api-wallet) +3. 连接你的主钱包并创建API钱包 +4. 复制API Signer地址和私钥 +5. 在config.json中设置`"exchange": "aster"` +6. 添加`"aster_user"`、`"aster_signer"`和`"aster_private_key"` --- @@ -531,12 +532,13 @@ cp config.json.example config.json - 🌐 多链支持(ETH、BSC、Polygon) - 🌍 无需KYC -**步骤1**:创建Aster API钱包 +**步骤1**:注册并创建Aster API钱包 -1. 访问[Aster API钱包](https://www.asterdex.com/en/api-wallet) -2. 连接你的主钱包(MetaMask、WalletConnect等) -3. 点击"创建API钱包" -4. **立即保存这3项:** +1. 通过[推荐链接注册Aster](https://www.asterdex.com/en/referral/fdfc0e)(享手续费优惠) +2. 访问[Aster API钱包](https://www.asterdex.com/en/api-wallet) +3. 连接你的主钱包(MetaMask、WalletConnect等) +4. 点击"创建API钱包" +5. **立即保存这3项:** - 主钱包地址(User) - API钱包地址(Signer) - API钱包私钥(⚠️ 仅显示一次!) From 7e07285706b52b83a2ca580ff164f99f226f4c78 Mon Sep 17 00:00:00 2001 From: Liu Xiang Qian Date: Sun, 2 Nov 2025 18:08:25 +0800 Subject: [PATCH 5/6] fix: Update model validation in handleSaveModelConfig to support both configured and supported models MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Change validation to check allModels first, then supportedModels - This allows saving new model configurations without "model does not exist" error - Fixes issue where users couldn't save AI model config after selecting from dropdown Fixes #245 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: tinkle-community --- web/src/components/AITradersPage.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/web/src/components/AITradersPage.tsx b/web/src/components/AITradersPage.tsx index 3a947df3..9361fc80 100644 --- a/web/src/components/AITradersPage.tsx +++ b/web/src/components/AITradersPage.tsx @@ -277,17 +277,17 @@ export function AITradersPage({ onTraderSelect }: AITradersPageProps) { const handleSaveModelConfig = async (modelId: string, apiKey: string, customApiUrl?: string, customModelName?: string) => { try { - // 找到要配置的模型(从supportedModels中) - const modelToUpdate = supportedModels?.find(m => m.id === modelId); + // 创建或更新用户的模型配置 + const existingModel = allModels?.find(m => m.id === modelId); + let updatedModels; + + // 找到要配置的模型(优先从已配置列表,其次从支持列表) + const modelToUpdate = existingModel || supportedModels?.find(m => m.id === modelId); if (!modelToUpdate) { alert(t('modelNotExist', language)); return; } - // 创建或更新用户的模型配置 - const existingModel = allModels?.find(m => m.id === modelId); - let updatedModels; - if (existingModel) { // 更新现有配置 updatedModels = allModels?.map(m => From d2ce83c2396c89aaea1d6f05578915af038a6b0d Mon Sep 17 00:00:00 2001 From: SkywalkerJi Date: Sun, 2 Nov 2025 21:44:53 +0800 Subject: [PATCH 6/6] Google Tag Manager --- web/index.html | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/web/index.html b/web/index.html index badfe608..574bc83a 100644 --- a/web/index.html +++ b/web/index.html @@ -2,11 +2,22 @@ + + + NOFX - AI Auto Trading Dashboard + + +