Skip to content

性能与可靠性指标

Agent 项目经常不是“完全死掉”,而是 queue、stream、tool、browser 或 background worker 卡住,同时界面看起来还活着。QC 证据应记录足够的时序和可靠性数据,解释体感慢和 flaky 行为。

Agent QC 不强制统一阈值。每个项目应按 profile 和风险定义阈值。

Runtime 响应性

Metric含义适用
submit_to_accept_ms用户动作到 runtime 接受CLI、TUI、GUI、WebUI
first_status_ms第一个用户可见 runtime statusAgent UI/TUI/desktop
first_text_delta_ms第一个 model/user-facing text deltastreams 和 chat UIs
first_tool_event_ms第一个 tool start/progress eventtool/runtime gates
interrupt_ack_msinterrupt/cancel 到 runtime ackCLI/TUI/GUI
resume_ready_msold session 或 task resume 到可用sessions、schedulers

这些指标来自 Agent UI 对 listener binding、runtime acceptance、first status、first text 和 paint timing 的分离。

Stream 与 projection 健康

Metric含义证据
event_sequence_gap_count缺失或乱序 runtime eventsprotocol transcript
delta_backlog_depth未渲染 text/tool deltas 队列UI diagnostics
oldest_unrendered_delta_ms最老 pending delta 年龄UI diagnostics
final_reconciliation_duplicatesstreamed/final text 重复次数transcript + surface artifact
stale_success_countUI 在 runtime 确认前宣称成功runtime/UI comparison
missing_fact_fallback_countunknownunavailablestaleblocked 投影次数UI snapshot/report

Tool 与权限可靠性

Metric含义证据
tool_start_to_result_ms每个 tool id 的耗时tool transcript
tool_error_recovery_counttool 失败后的 retry/recovery 次数runtime transcript
approval_pending_mshuman-in-the-loop 状态耗时action transcript
approval_correlation_failuresrequest/response id 不匹配protocol test
denied_side_effect_count被拒动作仍产生副作用sandbox/process evidence
orphan_process_count遗留 subprocess/browser workerscleanup evidence

Browser、WebUI、TUI 与桌面可靠性

SurfaceMetrics
webuipage load、first status paint、console error count、failed network count、trace size
desktop-guishell start、bridge health time、workspace readiness、native command timeout、mock fallback count
tuifirst frame、redraw latency、viewport reflow failures、key handling failures、Unicode/ANSI rendering failures
browser-automationnavigation time、DOM ready、console/network errors、screenshot/trace success、cleanup/orphan count
channel-uiwebhook verification time、dedup count、media processing time、retry count、delivery ack time

Playwright 风格项目应在失败时保留 trace/screenshot/video,并在相关时记录 browser project/device。Vitest browser-mode 或 component tests 可以证明组件行为,但 browser-only APIs 需要浏览器证据。

Scheduler 与后台可靠性

Metric含义
lease_reclaim_msowner 中断后 reclaim work 的时间
checkpoint_age_ms最近 durable checkpoint 的年龄
duplicate_job_count同一 job id 被重复执行的次数
lost_job_count截止时间前未执行的 scheduled jobs
retry_attempt_count每个 task 到 success/failure/exhaustion 前的尝试次数
worker_shutdown_msworker 优雅退出时间
queue_depth按 queue 或 priority 统计的 pending work

Hermes 风格项目应在普通测试中固定 deterministic clock/env,并把 live provider/channel 检查放到显式 opt-in lane。

Release 与 distribution 可靠性

Metric含义
clean_install_msfresh install 耗时
package_size_bytespackage 或 image 大小
manifest_missing_countpackage 中缺失的 expected files
version_mismatch_countpackage/app/Cargo/Tauri/version drift
docker_smoke_msDocker smoke 耗时
platform_failure_countOS matrix 失败数
lock_drift_countlockfile 或 generated artifact drift

Codex 风格项目可能使用 Bazel/nextest/release binaries。OpenClaw 风格项目可能使用 Docker/install smoke 和 plugin release checks。Agent QC 只要求证据形状。

建议阈值策略

QC 计划应定义:

ThresholdExample
Local defaultdeterministic gates 必须不带 live credentials 通过
Surface smokefirst status 或 bridge health 必须在产品阈值内出现
Flake budget已知 flaky lane 的 retry count 和 rerun policy
Live budgetprovider/channel cost、credential scope、timeout
Release budgetinstall time、package size、OS matrix、Docker smoke timeout
Waiver expiry缺失 metric 必须重新检查的 date/version

证据建议

性能或可靠性 gate 失败时,保留:

  • 启动 run 的 command 或 interaction;
  • timestamps 和 environment;
  • 慢或 flaky 片段周围的 trace/screenshot/transcript;
  • retry 和 cleanup 结果;
  • 该失败是阻塞 release、needs review 还是可 waiver。

Draft standard for evidence-driven quality control of Agent projects.