ADR-006 v2.0: Sidecar V2 architecture revision based on review feedback
Incorporated feedback from 4 reviewers: - 徐聪: AES key management, emergency channel, concurrency control, DDL indexes - 陆怀瑾: P0 phase, schedule buffer, deployment topology, V1 compat checklist - 严维序: SQLite backup, monitoring, cooldown persistence, port plan, rollback - 沈路明: queue design, health check, per-model RPM decision, key validation, dashboard panels Key additions: + Queue flow control design (FIFO + priority, capacity 500, REJECT overflow) + Provider health check (active probe + passive stats hybrid) + Per-model RPM decision (Provider-level V2, Model-level V3) + Key validation on add (test call with error feedback) + AES key management (SIDECAR_ENCRYPTION_KEY env var, backup SOP) + Emergency channel (10% RPM during full cooldown) + SQLite backup strategy (cron .backup, 7-day retention) + SQLite monitoring Prometheus metrics (db_size, wal_size, integrity) + Full DDL with indexes (ON CONFLICT, BEGIN IMMEDIATE patterns) + Dashboard panel list (5 panels: status, trends, history) + V1 compatibility checklist (13 items) + V1->V2 migration SOP with rollback plan + Deployment topology (systemd + Docker, port plan, firewall) + Log aggregation policy (logrotate: 10MB/30days) + Schedule revised: 71h/12days (added P0 + buffer) Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
flowchart TB
|
||||
subgraph OC["OpenClaw Gateway"]
|
||||
OC_SCHED["OpenClaw 调度器"]
|
||||
OC_FB["OpenClaw Fallback<br/>传统配置链路"]
|
||||
end
|
||||
|
||||
subgraph SIDECAR["Sidecar V2 systemd/Docker"]
|
||||
direction TB
|
||||
|
||||
subgraph ENTRY["入口层"]
|
||||
GW["API Gateway :9190<br/>FastAPI + 路由匹配"]
|
||||
end
|
||||
|
||||
subgraph CORE["核心调度层"]
|
||||
LB["负载均衡器<br/>Weighted RR 5-10s刷新"]
|
||||
QM["队列管理器<br/>FIFO + 优先级<br/>容量500 + 溢出策略"]
|
||||
end
|
||||
|
||||
subgraph POOLS["Provider 池层"]
|
||||
MP["主池 Main Pool"]
|
||||
FP["Fallback 池"]
|
||||
CP["冷却池<br/>Cooldown Pool"]
|
||||
end
|
||||
|
||||
subgraph FLOW["流控层"]
|
||||
RL["Rate Limiter<br/>Per-Provider Token Bucket"]
|
||||
CD["Cooldown Detector<br/>429检测+指数退避<br/>+紧急通道10%RPM"]
|
||||
end
|
||||
|
||||
subgraph STATS["存储与统计层"]
|
||||
MT["Metrics :9191<br/>Prometheus"]
|
||||
ST["统计引擎<br/>Token/费用/调用量"]
|
||||
DB[("SQLite WAL<br/>sidecar_v2.db<br/>+ cron备份")]
|
||||
end
|
||||
|
||||
subgraph WEBUI["WebUI 层 :9190"]
|
||||
UI["Dashboard<br/>SSE 实时推送"]
|
||||
AP["Admin API<br/>Provider CRUD<br/>Bearer Token 鉴权"]
|
||||
end
|
||||
end
|
||||
|
||||
OC_SCHED --> GW
|
||||
GW --> LB
|
||||
LB --> QM
|
||||
QM --> RL
|
||||
RL --> MP
|
||||
RL --> FP
|
||||
MP -.->|"429 触发冷却"| CP
|
||||
MP -->|"全部冷却"| FP
|
||||
FP -->|"全部冷却"| OC_FB
|
||||
CP -.->|"冷却结束恢复"| MP
|
||||
RL --> CD
|
||||
CD -.->|"紧急通道 10% RPM"| MP
|
||||
LB --> MT
|
||||
MT --> ST
|
||||
ST --> DB
|
||||
DB --> UI
|
||||
AP --> DB
|
||||
Reference in New Issue
Block a user