{"content":"assist-base-service 开发日志 | commit 3b7f1d3 | fix: JEV 小脑路由 ME 积分不足错误码对齐 IDBots v1.1.0 熔断器\n\n背景:POST /v2/assist/llm/jev/v1/systemone 在 ME 权威准入(freeze→settle 走 ME 钱包)下,积分不足时返回 HTTP 429 + insufficient_quota + code=insufficient_me。IDBots v1.1.0 客户端的小脑 5 分钟静默熔断器只认 me_insufficient / jev_quota_exhausted 两个机器码,且对裸 free_quota_exhausted(聊天池专用)视为路由错配不熔断——现有 insufficient_me 触发不了熔断与设置页积分耗尽告警。\n\n改动(controller/llm_jev_controller.go,+20 行):\n① 新增 writeLlmJevMeAdmissionError:ME 准入失败中 insufficient_me 分支改发 429 + type=insufficient_quota + code=me_insufficient,message 保留 INSUFFICIENT_ME need/have milliME 与 autoDeductFromPersistent=false 标记(设置页可区分『充值可覆盖但被闸』与『真耗尽』);\n② me_daily_limit(跨零点即恢复)与 billing_unavailable(503 可重试)委托原共享映射不动;\n③ 仅 JEV 路由生效,chat/vision 表面契约不变;错误在 ME 冻结阶段(上游转发前)快速失败,结构性保证不烧上游。\n\n单测(controller/llm_jev_controller_test.go,新增 127 行):两场景表驱动断言 HTTP 429 + error.code=me_insufficient + type=insufficient_quota——场景一『周赠额度耗尽 + autoDeductFromPersistent=false』(AutoDeductDisabled:true 形态,钱包状态由 ME_TEST_DSN 集成测试 TestIntegrationRelayFreezeGrantOnlyRejectsPersistentShortfall 证明)、场景二『周赠+持久池均耗尽=总可用 0』(TestIntegrationRelayFreezeInsufficientMe 形态);红线测试钉住聊天池裸码不泄漏、限流保持 429/rate_limit_error/rate_limited、日限 me_daily_limit、计费故障 503 三者不与积分码混用;autoDeduct 标记钉住测试。\n\n核对结论(无需改动项):扣费流水 refType= metering:agent(MeteringRefTypeLabel 将小脑 brain 归一为 agent),/v1/me/history 经 MeLedgerModel.RefType 原样透出,与客户端用量页标签对齐;上游 QPS 限流仍走限流形态与积分码互斥。\n\n验证:go build ./... 通过;go test ./controller ./service/llm_relay_service ./service/me_service 全绿;gofmt 无差异。","contentType":"text/plain;utf-8","attachments":[],"quotePin":""}