From 2731e111dd39bc814f08f9b669142962b2d7686f Mon Sep 17 00:00:00 2001 From: xiaowei Date: Sat, 30 May 2026 04:48:51 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20dailyLimit=2050=E2=86=925000=20+=20VPro?= =?UTF-8?q?pagator=20=E6=BF=80=E6=B4=BB=20+=20=E7=AB=9E=E4=BA=89=E6=80=A7?= =?UTF-8?q?=E6=9E=B6=E6=9E=84=E8=BF=9E=E6=8E=A5=20-=20distill:=20dailyLimi?= =?UTF-8?q?t=20=E6=8F=90=E5=8D=87=E5=88=B0=205000=EF=BC=88=E5=8E=9F=2050?= =?UTF-8?q?=EF=BC=89=EF=BC=8C=E5=85=81=E8=AE=B8=E5=A4=A7=E9=87=8F=20LLM=20?= =?UTF-8?q?=E8=92=B8=E9=A6=8F=20-=20cost=5Fcontrol:=20DefaultCostConfig.Da?= =?UTF-8?q?ilyLimit=20=E5=90=8C=E6=AD=A5=E6=94=B9=E4=B8=BA=205000=20-=20se?= =?UTF-8?q?rver:=20=E6=B7=BB=E5=8A=A0=20VPropagator=20=E5=AE=9E=E4=BE=8B?= =?UTF-8?q?=E5=8C=96=EF=BC=8C=E8=92=B8=E9=A6=8F=E5=AE=8C=E6=88=90=E6=97=B6?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=20V=20=E5=80=BC=E5=86=B3=E7=AD=96=20-=20serv?= =?UTF-8?q?er:=20OnDistillComplete=20=E5=9B=9E=E8=B0=83=E4=B8=AD=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=20Dash.RecordUseful()=20=E4=BB=AA=E8=A1=A8=E7=9B=98?= =?UTF-8?q?=20-=20plugins:=20Hermes+OpenClaw=20=E6=8F=92=E4=BB=B6=E6=BA=90?= =?UTF-8?q?=E7=A0=81=E7=BA=B3=E5=85=A5=E4=BB=93=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go/internal/api/server.go | 21 +++++++++++++++++++++ go/internal/distill/cost_control.go | 4 ++-- go/internal/distill/engine.go | 2 +- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/go/internal/api/server.go b/go/internal/api/server.go index 3edfe1f..3ad22c8 100644 --- a/go/internal/api/server.go +++ b/go/internal/api/server.go @@ -162,6 +162,27 @@ func NewServer() http.Handler { // ─── CO_OCCURS 追踪器 ─────────────────────── storage.CoOccurTrackerInstance = storage.NewCoOccurTracker(nil) + // ─── V 值传播器(竞争性架构核心)───────────── + vPropagator := &selfoptimize.VPropagator{} + // 在蒸馏完成回调中记录 V 值 + originalOnComplete := distill.OnDistillComplete + distill.OnDistillComplete = func(input distill.DistillInput, result distill.DistillResult) { + // 调用已有的回调 + if originalOnComplete != nil { + originalOnComplete(input, result) + } + // 记录 V 值决策:蒸馏成功 = 有用 + if len(result.Facts) > 0 { + vPropagator.RecordDecision( + "distill_"+input.EpisodeID, + []string{input.EpisodeID}, + "distill", "success", "", + ) + } + // 更新仪表盘指标 + selfoptimize.Dash.RecordUseful() + } + // ─── 跨 Agent 缓存失效回调 ─────────────────── // 收到其他 Agent 的广播 → 失效本地缓存 governance.GlobalEventBus.Subscribe("cache.invalidate", "self") diff --git a/go/internal/distill/cost_control.go b/go/internal/distill/cost_control.go index cef8d18..aaaff60 100644 --- a/go/internal/distill/cost_control.go +++ b/go/internal/distill/cost_control.go @@ -151,14 +151,14 @@ func (cc *CostController) GetQuota() DistillQuota { // ─── 限额配置 ───────────────────────────────────────────── type CostConfig struct { - DailyLimit int `json:"daily_limit"` // 默认 50 + DailyLimit int `json:"daily_limit"` // 默认 5000 ConsolidationBudget int `json:"consolidation_budget"` // 默认 20 } // DefaultCostConfig 默认配置 func DefaultCostConfig() CostConfig { return CostConfig{ - DailyLimit: 50, + DailyLimit: 5000, ConsolidationBudget: 20, } } diff --git a/go/internal/distill/engine.go b/go/internal/distill/engine.go index 88ee80a..ee9ff72 100644 --- a/go/internal/distill/engine.go +++ b/go/internal/distill/engine.go @@ -104,7 +104,7 @@ func NewEngine(llmEndpoint, llmModel, apiKey string) *Engine { APIKey: apiKey, batchSize: 10, batchTimeout: 5 * time.Minute, - dailyLimit: 50, + dailyLimit: 5000, client: &http.Client{Timeout: 30 * time.Second}, } }