 Songhaoz666andClaude Opus 4.8
|
e4a120b715
|
/metrics 暴露 run 级 cost_by_phase{initial,review_retry}(Refs #16 #37)
回应 @Mem0ried 在 PR #37 的对接问题:除逐条 budget.alert 事件的 cost_phase 外,详情
聚合也需能拆 initial/review_retry。build_runtime_metrics 新增 cost_by_phase 滚动汇总
(按 swarm_id,从各任务 usage.model_cost_usd/model_tokens 按 rework_attributions 归类),
GET …/{id}/metrics 返回 {initial,review_retry}:{cost_usd,model_tokens}。HM 详情聚合 /
客户端 08 用量抽屉可直接展示拆分,无需从事件推导。
测试 test-usage-cost-phase.py 增 /metrics 断言(reworked→review_retry、非 reworked→initial);
usage-billing §5 记录该字段。
Refs #16
Refs #37
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-11 14:36:07 +08:00 |
|
 Songhaoz666andClaude Opus 4.8
|
56e080bfa1
|
用量按 review-retry 成本归属:usage 事件标 cost_phase(Refs #16)
emit_usage_event 给每条 budget.alert 用量事件加 cost_phase:任务进入
run.metadata["rework_attributions"](cross-review 已 reopen)后的再执行标 review_retry,
否则 initial;并带 attempt(retry_count)。初次执行先于任何 attribution → initial,redo 在
run_cross_review 记录 attribution 之后 → review_retry,时序天然正确。计费/采集侧按 swarm_id
聚合时可用 cost_phase 拆分 initial vs review_retry 成本,满足「review retry 成本可归属」。
usage-billing-schema §4.2/§5/§6 同步:payload 加 cost_phase/attempt,§5 改为已打标,§6 缺口表
review_retry 标 ✅。测试 scripts/test-usage-cost-phase.py 接入 CI。
影响范围:仅 agent_swarm(usage 事件加字段 + 文档 + 测试);向后兼容;不改鉴权/契约/审批链/密钥。
Refs #16
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-11 09:44:36 +08:00 |
|
 Songhaoz666andClaude Opus 4.8
|
54cb327348
|
Agent Swarm v6:基准 v2.1、主控 Agent、实质性对等回复、客户端指南
- 基准标准 v2.1:SwarmMetrics(15 字段)、τ/η/P_decision/reward 公式、对称 G_E,c(修正 C_base=1.0 退化)、Σλ=1.0 校验;新增基线对比与运行记录 schema;指标覆盖缺口分析;参考系数暂留为元数据(待量化)。
- 主控 Agent 实体(分解 / 评审决策 / 汇总);事件契约修正(timeline.title、budget.threshold_pct、handoff 角色、task.released)+ 契约校验脚本。
- 实质性 LLM 对等回复(含降级回退);集成契约(runtime / event / usage / audit / frontend / capability / security);CLIENT_GUIDE 客户端指南;CI 工作流;治理与交付文档。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-09 16:21:18 +08:00 |
|