shinchan-zhai
|
acc52f2cf7
|
fix: prevent panics from unsafe type assertions in trading code + add request body limit
Security & Reliability:
- Add requestBodyLimitMiddleware (1MB) to prevent OOM from oversized API payloads
- Fix defer resp.Body.Close() inside loop in getPublicIPFromAPI (connection leak)
- Add posFloat64/posString safe helpers for position map access
Panic Prevention (critical for trading):
- Convert 30+ unsafe type assertions (pos["key"].(type)) to safe comma-ok
pattern across all exchange traders: OKX, Hyperliquid, Aster, Bybit,
KuCoin, Gate, Bitget, Binance
- Fix auto_trader_risk.go: drawdown monitor could panic and silently stop
monitoring, leaving positions unprotected
- Fix auto_trader_decision.go & auto_trader_loop.go: core trading loop
position parsing now crash-proof
- All trader/ code now has zero unsafe type assertions
Frontend:
- Fix config.ts: rejected promise cached forever on network error (never retries)
|
2026-03-23 12:01:44 +08:00 |
|
tinkle-community
|
cb31782be4
|
refactor: split large files and clean up project structure
- Rename experience/ to telemetry/ for clarity
- Split 15+ large Go files (800-2200 lines) into focused modules:
kernel/engine.go, backtest/runner.go, market/data.go, store/position.go,
api/handler_trader.go, trader/auto_trader_grid.go, and 9 exchange traders
- Split frontend monoliths: types.ts, api.ts, AITradersPage.tsx, BacktestPage.tsx
into domain-specific modules with barrel re-exports
- Remove stale files: screenshots, .yml.old, pyproject.toml
- Remove unused scripts/ and cmd/ directories
- Remove broken/outdated test files (network-dependent, stale expectations)
|
2026-03-12 12:53:57 +08:00 |
|
tinkle-community
|
8e294a5eed
|
refactor: restructure project directories for better modularity
- Delete llm/ dead code (3 files, zero references)
- Split mcp/ into sub-packages: mcp/provider/ (8 providers) and
mcp/payment/ (4 payment clients) with registry pattern
- Export Client internal fields and ClientHooks interface for
sub-package access
- Split api/server.go (3892 lines) into 8 domain-specific handler files
- Split trader/auto_trader.go (2296 lines) into 5 focused files
- Reorganize web/src/components/ flat files into auth/, charts/,
trader/, common/, modals/, backtest/ subdirectories
- Update all consumer imports to use registry-based provider creation
|
2026-03-11 23:58:13 +08:00 |
|