## 问题 用户看到原始 DioException 堆栈(如 "DioException [unknown]: null Error: HttpException: Connection reset by peer"),且无重试机制,网络抖动即报错。 ## 变更 ### 1. RetryInterceptor(指数退避自动重试) - 新增 `core/network/retry_interceptor.dart` - 自动重试:连接超时、发送超时、Connection reset、502/503/504/429 - 指数退避(800ms → 1.6s → 3.2s)+ 随机抖动防雪崩 - 最多 3 次重试,非瞬态错误(401/403/404)不重试 - 集成到 dio_client,优化超时:connect 8s、send 15s、receive 20s ### 2. ErrorHandler 全面升级(友好中文错误提示) - 重写 `core/errors/error_handler.dart`,新增 `friendlyMessage()` 静态方法 - 所有 DioExceptionType 映射为具体中文: - Connection reset → "连接被服务器重置,请稍后重试" - Connection refused → "服务器拒绝连接,请确认服务是否启动" - Timeout → "连接超时,服务器无响应" - 401 → "登录已过期,请重新登录" - 403/404/429/500/502/503 各有独立提示 - 新增 TimeoutFailure 类型 - 所有 Failure.message 默认中文 ### 3. 网络连接监测 + 离线 Banner - 新增 `core/network/connectivity_provider.dart` — 每30秒探测服务器可达性 - 新增 `core/widgets/offline_banner.dart` — 黄色警告横幅 "网络连接不可用" - 集成到 ScaffoldWithNav,所有页面顶部自动显示离线状态 ### 4. 统一错误展示(杜绝 e.toString()) - 新增 `core/widgets/error_view.dart` — 统一错误 UI(图标 + 友好文案 + 重试按钮) - 替换 6 个页面的内联错误 Column 为 ErrorView: tasks_page / servers_page / alerts_page / approvals_page / standing_orders_page - 替换 dashboard 的 3 处 _SummaryCardError(message: e.toString()) - 替换 4 个 provider 的 e.toString(): chat / auth / settings / approvals - 全项目零 e.toString() 残留(仅剩 time.minute.toString() 时间格式化) ### 5. WebSocket 重连增强 - 指数退避(1s → 2s → 4s → ... → 60s 上限)+ 随机抖动 - 最多 10 次自动重连,超限后停止 - disconnect() 阻止自动重连 - 新增 reconnect() 手动重连方法 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| deploy | ||
| docs | ||
| it0-web-admin | ||
| it0_app | ||
| packages | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| Dockerfile.service | ||
| README.md | ||
| logo.svg | ||
| package.json | ||
| pnpm-lock.yaml | ||
| pnpm-workspace.yaml | ||
| tsconfig.base.json | ||
| turbo.json | ||
README.md
IT0 — AI-Powered Server Cluster Operations Platform
Intelligent operations platform that combines AI agents with human oversight for managing server clusters.
Architecture
- Backend: NestJS microservices (TypeScript) with DDD + Clean Architecture
- Mobile: Flutter app with Riverpod state management
- Web Admin: Next.js dashboard with Zustand + React Query
- Voice: Python service for voice-based interaction (STT/TTS/VAD)
Services
| Service | Description |
|---|---|
| auth-service | Authentication, RBAC, API key management |
| agent-service | AI agent orchestration (Claude CLI + API) |
| inventory-service | Server, cluster, credential management |
| monitor-service | Metrics collection, alerting, health checks |
| ops-service | Task execution, approvals, standing orders |
| comm-service | Multi-channel notifications, escalation |
| audit-service | Audit logging, compliance trail |
| voice-service | Voice pipeline (Python) |
Quick Start
# Backend
pnpm install
pnpm dev
# Flutter
cd it0_app && flutter pub get && flutter run
# Web Admin
cd it0-web-admin && pnpm install && pnpm dev
Tech Stack
- Runtime: Node.js 20+, Dart 3.x, Python 3.11+
- Database: PostgreSQL (schema-per-tenant)
- Cache/Events: Redis Streams
- AI: Anthropic Claude (CLI + API)
- Build: pnpm workspaces + Turborepo