Repository navigation
feat(usage): 用量页说清失败集中在哪天、各功能失败占比(#239) - #243
Merged
Merged
Conversation
#239 的教训:报告者看到「聊完记一下 1107 次失败 1005」就以为当下代码坏了, 实际 836 次集中在一天(2026-11-01 全局模型故障)。用量页本身有 7/30 天切换, 但失败数只是个裸数字,看不出时间分布。 - usage() 的 daily 补 failed 字段(原来只记 calls/tokens/cost) - 页面上「失败」行写明:这 N 天累计 X 次、分布在几天、最多的一天是哪天 (全部集中在一日时直接提示「别按这个数字判断现在的代码」) - 每个功能 / 模型的失败数后面加占比(「(失败 3 · 75%)」) 测试:smoke-v07 加 daily[].failed 断言(去掉字段即红); llm-budget 的「(失败 N)」正则放宽为可带占比 —— 断言对象随契约变,强度不变。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
#239 暴露的不只是「失败没留痕」,还有「失败数看不出时间分布」。报告者看到「聊完记一下 1107 次失败 1005」就以为当下的代码坏了,实际 836 次集中在 2026-11-01 一天(那天全局模型故障,宿主默认模型兜底 293 次也全挂)。
用量页本来就有 7 天 / 30 天切换,但失败数只是个裸数字,落在哪一天完全看不出来。
What
usage()的daily补failed字段(原来只记 calls / tokens / cost)Verification
smoke-v07加daily[].failed断言;去掉该字段 → 红,恢复 → 绿llm-budget-and-social-backoff的渲染断言/(失败 \d+)/放宽为/(失败 \d+( · \d+%)?)/—— 断言对象随契约变,强度不变(仍然要求渲染出失败次数)Refs #239