0xYYBB | ZYY | Bobo
724366a894
fix(prompts): correct confidence scale from 0-1 to 0-100 to match backend schema ( #564 )
...
## Problem
The prompts specified confidence range as 0-1 (float), but the backend code
expects 0-100 (integer). This causes JSON parsing errors when AI outputs
values like 0.85:
```
Error: json: cannot unmarshal number 0.85 into Go struct field Decision.confidence of type int
Result: confidence defaults to 0
```
## Root Cause
**Backend Definition** (decision/engine.go:103):
```go
Confidence int `json:"confidence,omitempty"` // 信心度 (0-100)
```
**Prompts (before fix)**:
- adaptive.txt: "confidence (信心度 0-1)"
- nof1.txt: "confidence (float, 0-1)"
**buildHardSystemPrompt** (decision/engine.go:336):
```go
sb.WriteString("- `confidence`: 0-100(开仓建议≥75)\n")
```
The dynamic system prompt was correct, but the base prompts contradicted it.
## Solution
Update prompt files to use consistent 0-100 integer scale:
### adaptive.txt
- `confidence (信心度 0-1)` → `confidence (信心度 0-100)`
- `<0.85` → `<85`
- `0.85-0.90` → `85-90`
- etc.
### nof1.txt
- `confidence (float, 0-1)` → `confidence (int, 0-100)`
- `0.0-0.3` → `0-30`
- `0.3-0.6` → `30-60`
- etc.
## Impact
- ✅ Fixes JSON parsing errors when AI outputs float values
- ✅ Aligns prompts with backend schema
- ✅ Consistent with buildHardSystemPrompt() output format
- ✅ No breaking changes (backend already expects 0-100)
## Testing
```bash
# Verify backend expects 0-100
grep "Confidence int" decision/engine.go
# Output: Confidence int `json:"confidence,omitempty"` // 信心度 (0-100)
# Verify buildHardSystemPrompt uses 0-100
grep "confidence.*0-100" decision/engine.go
# Output: sb.WriteString("- `confidence`: 0-100(开仓建议≥75)\n")
# Build test
go build ./decision/... # ✅ PASS
```
## Related
- Addresses schema mismatch mentioned in Issue #557
- Note: confidence field is currently not validated by backend (validateDecision
does not check confidence value), but correct schema prevents parsing errors
---
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-authored-by: Claude <noreply@anthropic.com >
2025-11-06 00:35:53 +08:00
SkywalkerJi
1542374b73
fix: Fix README link ( #563 )
...
* Resolved front-end linting issues.
* Streamlining Docker Build Scripts
* Leveraging Native ARM64 Runners on GitHub.
* Use lowercase framework names.
* Streamlining dependencies within the README.
2025-11-06 00:31:05 +08:00
0xYYBB | ZYY | Bobo
ca2c428357
fix(decision): add safe fallback when AI outputs only reasoning without JSON ( #561 )
...
## 问题 (Problem)
当 AI 只输出思维链分析没有 JSON 决策时,系统会崩溃并报错:
"无法找到JSON数组起始",导致整个交易周期失败,前端显示红色错误。
## 解决方案 (Solution)
1. 添加安全回退机制 (Safe Fallback)
- 当检测不到 JSON 数组时,自动生成保底决策
- Symbol: "ALL", Action: "wait"
- Reasoning 包含思维链摘要(最多 240 字符)
2. 统一注释为简体中文 + 英文对照
- 关键修复 (Critical Fix)
- 安全回退 (Safe Fallback)
- 退而求其次 (Fallback)
## 效果 (Impact)
- 修复前:系统崩溃,前端显示红色错误 "获取AI决策失败"
- 修复后:系统稳定,自动进入 wait 状态,前端显示绿色成功
- 日志记录:[SafeFallback] 标记方便监控和调试
## 设计考量 (Design Considerations)
- 仅在完全找不到 JSON 时触发(区分于格式错误)
- 有 JSON 但格式错误仍然报错(提示需要改进 prompt)
- 保留完整思维链摘要供后续分析
- 避免隐藏真正的问题(格式错误应该暴露)
## 测试 (Testing)
- ✅ 正常 JSON 输出:解析成功
- ✅ 纯思维链输出:安全回退到 wait
- ✅ JSON 格式错误:继续报错(预期行为)
- ✅ 编译通过
## 监控建议 (Monitoring)
可通过日志统计 fallback 频率:
```bash
grep "[SafeFallback]" logs/nofx.log | wc -l
```
如果频率 > 5% 的交易周期,建议检查并改进 prompt 质量。
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-authored-by: Claude <noreply@anthropic.com >
2025-11-06 00:08:23 +08:00
Ember
b2e4be9152
Feature/faq ( #546 )
...
* feat(web): add FAQ page with search, sidebar, and i18n integration; update navigation and routes; include user feedback analysis docs (faq.md)
* docs: add filled frontend PR template for FAQ feature (PR_FRONTEND_FAQ.md)
* docs(web): add Contributing & Tasks FAQ category near top with guidance on using GitHub Projects and PR contribution standards
* feat(web,api): dynamically embed GitHub Projects roadmap in FAQ via /api/roadmap and RoadmapWidget; add env vars for GitHub token/org/project
* chore(docker): pass GitHub roadmap env vars into backend container
* docs(web): update FAQ with fork-based PR workflow, yellow links to roadmap/task dashboard, and contribution incentives; remove dynamic roadmap embed\n\nchore(api,docker): remove /api/roadmap endpoint and related env wiring
* chore: revert unintended changes (.env.example, api/server.go, docker-compose.yml); remove local-only files (PR_FRONTEND_FAQ.md, web/faq.md) from PR
* feat: 添加对重置密码页面的路由支持
2025-11-05 22:39:42 +08:00
SkywalkerJi
e0f1950fe0
fix: Increase Docker build speed by 98%. ( #545 )
...
* Resolved front-end linting issues.
* Streamlining Docker Build Scripts
* Leveraging Native ARM64 Runners on GitHub.
* Use lowercase framework names.
2025-11-05 22:24:56 +08:00
Burt
be768d91a3
Feat: Enable admin password in admin mode ( #540 )
...
* WIP: save local changes before merging
* Enable admin password in admin mode #374
2025-11-05 21:48:28 +08:00
Sue
db68689475
feat(auth): implement password reset with Google Authenticator verification ( #537 )
...
实现忘记密码功能,用户可以通过邮箱和Google Authenticator验证码重置密码。
**后端改动:**
- 添加 `/api/reset-password` 接口
- 实现 `UpdateUserPassword` 数据库方法
- 验证邮箱、OTP和新密码
**前端改动:**
- 新增 `ResetPasswordPage` 组件
- 在登录页面添加"忘记密码"链接
- 实现密码重置表单(新密码、确认密码、OTP验证)
- 添加密码可见性切换功能
- 支持中英文国际化
**安全特性:**
- 要求Google Authenticator验证
- 密码强度验证(最少6位)
- 密码确认匹配检查
- 密码哈希存储
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-authored-by: Claude <noreply@anthropic.com >
2025-11-05 21:01:18 +08:00
SkywalkerJi
eb515d74e9
Resolved front-end linting issues. ( #533 )
2025-11-05 20:41:41 +08:00
SkywalkerJi
696e9f6187
Add ja docs ( #530 )
...
* docs: add Japanese README
* docs: Update README.ja.md
* docs: add DOCKER_DEPLOY.ja.md
---------
Co-authored-by: Ikko Ashimine <ashimine_ikko_bp@tenso.com >
2025-11-05 20:14:26 +08:00
ERIC LEUNG
2755eb733a
fix: 删除多定义的方法 ( #528 )
2025-11-05 20:11:50 +08:00
CoderMageFox
86d2a07040
docs: clarify Aster only supports EVM wallets, not Solana wallets ( #524 )
2025-11-05 19:37:27 +08:00
Ember
a7385e5256
fix(web): remove undefined setHyperliquidWalletAddr call in ExchangeConfigModal ( #525 )
2025-11-05 19:35:57 +08:00
0xYYBB | ZYY | Bobo
0f98e06d9e
Revert "fix: hard system prompt ( #401 )" ( #522 )
...
This reverts commit 7dd669a907 .
2025-11-05 19:05:09 +08:00
GitBib
dab933faee
fix: update go.sum with missing modernc.org/sqlite dependencies ( #523 )
2025-11-05 19:03:32 +08:00
Theshyx11
df4af06bc7
docs: 添加 config.db Docker 启动失败 bug 修复文档 ( #210 )
...
## 问题描述
Docker Compose 首次启动时,config.db 被创建为目录而非文件,
导致 SQLite 数据库初始化失败,容器不断重启。
错误信息: "unable to open database file: is a directory"
## 发现时间
2025-11-02 00:14 (UTC+8)
## 根本原因
docker-compose.yml 中的卷挂载配置:
- ./config.db:/app/config.db
当本地 config.db 不存在时,Docker 会自动创建同名**目录**。
## 临时解决方案
1. docker-compose down
2. rm -rf config.db
3. touch config.db
4. docker-compose up -d
## 修复时间
2025-11-02 00:22 (UTC+8)
## 新增文件
- BUGFIX_CONFIG_DB_2025-11-02.md: 详细的 bug 修复报告
## 建议改进
- 在 DOCKER_DEPLOY.md 中添加预启动步骤说明
- 考虑在 Dockerfile 中添加自动初始化脚本
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-authored-by: shy <shy@nofx.local >
Co-authored-by: Claude <noreply@anthropic.com >
2025-11-05 18:21:05 +08:00
Sue
77c99499d7
feat(api): add server IP display for exchange whitelist configuration ( #520 )
...
Added functionality to display server public IP address for users to configure exchange API whitelists, specifically for Binance integration.
Backend changes (api/server.go):
- Add GET /api/server-ip endpoint requiring authentication
- Implement getPublicIPFromAPI() with fallback to multiple IP services
- Implement getPublicIPFromInterface() for local network interface detection
- Add isPrivateIP() helper to filter private IP addresses
- Import net package for IP address handling
Frontend changes (web/):
- Add getServerIP() API method in api.ts
- Display server IP in ExchangeConfigModal for Binance
- Add IP copy-to-clipboard functionality
- Load and display server IP when Binance exchange is selected
- Add i18n translations (en/zh) for whitelist IP messages:
- whitelistIP, whitelistIPDesc, serverIPAddresses
- copyIP, ipCopied, loadingServerIP
User benefits:
- Simplifies Binance API whitelist configuration
- Shows exact server IP to add to exchange whitelist
- One-click IP copy for convenience
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-authored-by: Claude <noreply@anthropic.com >
2025-11-05 18:15:33 +08:00
Jupiteriana
7dd669a907
fix: hard system prompt ( #401 )
2025-11-05 17:45:18 +08:00
CoderMageFox
f7391adff9
feat: add i18n support for candidate coins warnings ( #516 )
...
- Add 13 translation keys for candidate coins warnings in both English and Chinese
- Update App.tsx to use t() function for all warning text
- Update AITradersPage.tsx to use t() function for signal source warnings
- Ensure proper internationalization for all user-facing messages
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-authored-by: Claude <noreply@anthropic.com >
2025-11-05 17:35:38 +08:00
PoorThoth
0c371c834a
Change SQLite driver in database configuration ( #441 )
...
* Change SQLite driver in database configuration
Replace SQLite driver from 'github.com/mattn/go-sqlite3' to 'modernc.org/sqlite'.
* Update go.mod
---------
Co-authored-by: tinkle-community <tinklefund@gmail.com >
2025-11-05 17:34:29 +08:00
CoderMageFox
2299a0e34f
feat: 添加候选币种为0时的前端警告提示 ( #515 )
...
* feat: add frontend warnings for zero candidate coins
当候选币种数量为0时,在前端添加详细的错误提示和诊断信息
主要改动:
1. 决策日志中显示候选币种数量,为0时标红警告
2. 候选币种为0时显示详细警告卡片,包含可能原因和解决方案
3. 交易员列表页面添加信号源未配置的全局警告
4. 更新TraderInfo类型定义,添加use_coin_pool和use_oi_top字段
详细说明:
- 在App.tsx的账户状态摘要中添加候选币种显示
- 当候选币种为0时,显示详细的警告卡片,列出:
* 可能原因(API未配置、连接超时、数据为空等)
* 解决方案(配置自定义币种、配置API、禁用选项等)
- 在AITradersPage中添加信号源配置检查
* 当交易员启用了币种池但未配置API时显示全局警告
* 提供"立即配置信号源"快捷按钮
- 不改变任何后端逻辑,纯UI层面的用户提示改进
影响范围:
- web/src/App.tsx: 决策记录卡片中的警告显示
- web/src/components/AITradersPage.tsx: 交易员列表页警告
- web/src/types.ts: TraderInfo类型定义更新
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
* fix: import AlertTriangle from lucide-react in App.tsx
修复TypeScript编译错误:Cannot find name 'AlertTriangle'
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
---------
Co-authored-by: Claude <noreply@anthropic.com >
2025-11-05 17:11:04 +08:00
zcan
986886b291
Fix/binance server time ( #453 )
...
* Fix Binance futures server time sync
* Fix Binance server time sync; clean up logging and restore decision sorting
---------
Co-authored-by: tinkle-community <tinklefund@gmail.com >
2025-11-05 17:09:47 +08:00
vicnoah
e37f6c16f7
ci(docker): 添加Docker镜像构建和推送的GitHub Actions工作流 ( #124 )
...
* ci(docker): 添加Docker镜像构建和推送的GitHub Actions工作流
- 支持在main和develop分支及版本标签的push事件触发
- 支持Pull Request事件及手动触发工作流
- 配置了backend和frontend两个镜像的构建策略
- 使用QEMU和Docker Buildx实现多平台构建(amd64和arm64)
- 集成GitHub Container Registry和Docker Hub登录
- 自动生成镜像元数据和多标签支持
- 支持基于GitHub Actions缓存提升构建速度
- 实现根据事件类型自动决定是否推送镜像
- 输出构建完成的镜像摘要信息
* Update Docker Hub login condition in workflow
* Fix Docker Hub login condition in workflow
* Simplify Docker Hub login step
Removed conditional check for Docker Hub username.
* Change branch names in Docker build workflow
* Update docker-build.yml
2025-11-05 16:55:09 +08:00
ERIC LEUNG
341b70a640
refactor(AITradersPage): remove unused hyperliquidWalletAddr state ( #511 )
2025-11-05 16:42:56 +08:00
Icyoung
6790895ab1
Merge pull request #462 from zhouyongyou/fix/quantity-zero-min-notional
...
fix(trader+decision): prevent quantity=0 error with minimum notional validation
2025-11-05 16:29:24 +08:00
Icyoung
3b180e58f8
Merge pull request #467 from zhouyongyou/fix/binance-multi-assets-api-error
...
fix: 智能处理币安多资产模式和统一账户API错误
2025-11-05 16:23:32 +08:00
Icyoung
d940ef43fd
Merge branch 'dev' into fix/binance-multi-assets-api-error
2025-11-05 16:23:22 +08:00
Icyoung
5cdd0ab001
Merge pull request #468 from NoFearInMyHeart-G/dev
...
feat: 增加持仓最高收益缓存和自动止盈机制
2025-11-05 16:22:05 +08:00
Icyoung
093a3a4bec
Merge branch 'dev' into dev
2025-11-05 16:21:57 +08:00
Icyoung
f601e62e90
Merge pull request #437 from zhouyongyou/fix/margin-calculation
...
fix(margin): correct position sizing formula to prevent insufficient margin errors
2025-11-05 16:13:37 +08:00
Icyoung
c8b8e6192a
Merge pull request #436 from zhouyongyou/fix/partial-close-stats
...
fix(ui): prevent system_prompt_template overwrite when value is empty string
2025-11-05 16:12:12 +08:00
Icyoung
77beea9f9f
Merge branch 'dev' into fix/partial-close-stats
2025-11-05 16:11:53 +08:00
Icyoung
267fb10ee1
Merge pull request #433 from zhouyongyou/fix/dual-side-position-mode
...
fix(binance): initialize dual-side position mode to prevent code=-4061 errors
2025-11-05 16:09:37 +08:00
Icyoung
c859736c72
Merge pull request #435 from zhouyongyou/fix/trader-config-overwrite
...
fix(margin): correct position sizing formula to prevent insufficient margin errors
2025-11-05 16:08:18 +08:00
Icyoung
6c21ce8386
Merge branch 'dev' into fix/trader-config-overwrite
2025-11-05 16:05:40 +08:00
Icyoung
70fa0730e2
Merge pull request #434 from zhouyongyou/fix/stop-loss-take-profit-separation
...
fix(trader): separate stop-loss and take-profit order cancellation to prevent accidental deletions
2025-11-05 16:05:00 +08:00
Icyoung
c5d865f309
Merge pull request #429 from zhouyongyou/feat/auto-balance-sync
...
feat(trader): add automatic balance sync every 10 minutes
2025-11-05 16:02:21 +08:00
tinkle-community
8c105599f6
Merge pull request #493 from simonjiang99/fix/3-minutes-minimum
...
fix(api):enforce minimum scan interval of three minutes
2025-11-05 16:02:04 +08:00
Icyoung
6099db2105
Merge branch 'dev' into feat/auto-balance-sync
2025-11-05 16:01:57 +08:00
Icyoung
aadde2d0ac
Merge pull request #428 from zhouyongyou/fix/initial-balance-sync
...
fix(api): add balance sync endpoint with smart detection
2025-11-05 15:58:45 +08:00
Icyoung
f30f2ea695
Merge pull request #416 from zhouyongyou/fix/bug-fixes-collection-v2
...
fix: 修復 6 個 bug(替代 #271)
2025-11-05 15:57:36 +08:00
Icyoung
f3af7370e2
Merge branch 'dev' into fix/bug-fixes-collection-v2
2025-11-05 15:56:58 +08:00
Icyoung
f067003303
Merge pull request #471 from zhouyongyou/fix/hyperliquid-complete-balance-fix
...
fix(hyperliquid): complete balance detection with 4 critical fixes
2025-11-05 15:47:15 +08:00
Icyoung
feed4ef6a8
Merge pull request #446 from zhouyongyou/fix/json-fullwidth-characters
...
fix(decision): handle fullwidth JSON characters from AI responses
2025-11-05 15:46:56 +08:00
Icyoung
c7226bf04e
Merge pull request #386 from zhouyongyou/feat/configurable-oi-threshold
...
feat(decision): configurable OI threshold + relaxed trading template
2025-11-05 15:46:25 +08:00
Icyoung
6c78d9dc14
Merge pull request #385 from zhouyongyou/fix/market-price-staleness
...
fix(market): resolve price staleness causing trade failures
2025-11-05 15:45:52 +08:00
Icyoung
af6a2c5276
Merge pull request #414 from zhouyongyou/feat/query-actual-balance-v2
...
feat(api): query actual exchange balance when creating trader
2025-11-05 15:45:09 +08:00
Icyoung
ae7f3bc2be
Merge pull request #325 from zhouyongyou/refactor/enhance-partial-close-guidance
...
refactor(prompts): 增強部分平倉使用指導 [依賴 #415 ]
2025-11-05 15:43:08 +08:00
Icyoung
cb31330380
Merge pull request #273 from zhouyongyou/feat/logger-dynamic-tpsl
...
feat(logger): 添加動態 TP/SL 日誌支持 [依賴 #415 ]
2025-11-05 15:42:33 +08:00
Icyoung
31d7fcba8e
Merge pull request #415 from zhouyongyou/feat/partial-close-core-v2
...
feat: 部分平倉和動態止盈止損核心實現 / Partial Close & Dynamic TP/SL Core
2025-11-05 15:41:20 +08:00
tinkle-community
9f5fe361d2
Merge pull request #501 from Hansen1018/add-Hansen-prompt
...
增加 稳健和风险控制均衡基础策略提示词
2025-11-05 15:33:02 +08:00