




















@@ -10,6 +10,8 @@ export type RttProviderMode = "mock-openai" | "live-frontier";
1010export type RttCliOptions = {
1111providerMode: RttProviderMode;
1212runs: number;
13+samples: number;
14+sampleTimeoutMs: number;
1315harnessRoot: string;
1416output: string;
1517scenarios: string[];
@@ -35,6 +37,12 @@ export type RttResult = {
3537rtt: {
3638canaryMs?: number;
3739mentionReplyMs?: number;
40+warmSamples?: number[];
41+avgMs?: number;
42+p50Ms?: number;
43+p95Ms?: number;
44+maxMs?: number;
45+failedSamples?: number;
3846};
3947artifacts: {
4048rawSummaryPath: string;
@@ -49,6 +57,20 @@ export type TelegramQaSummary = {
4957id?: string;
5058rttMs?: number;
5159status?: string;
60+samples?: Array<{
61+index?: number;
62+status?: string;
63+rttMs?: number;
64+}>;
65+stats?: {
66+total?: number;
67+passed?: number;
68+failed?: number;
69+avgMs?: number;
70+p50Ms?: number;
71+p95Ms?: number;
72+maxMs?: number;
73+};
5274}>;
5375};
5476@@ -82,11 +104,26 @@ export function buildRunId(params: { now: Date; spec: string; index?: number })
8210483105export function extractRtt(summary: TelegramQaSummary) {
84106const scenarios = summary.scenarios ?? [];
85-return {
107+const mention = scenarios.find((scenario) => scenario.id === "telegram-mentioned-message-reply");
108+const warmSamples = mention?.samples
109+?.filter((sample) => sample.status === "pass" && sample.rttMs !== undefined)
110+.sort((left, right) => (left.index ?? 0) - (right.index ?? 0))
111+.flatMap((sample) => (sample.rttMs === undefined ? [] : [sample.rttMs]));
112+const rtt: RttResult["rtt"] = {
86113canaryMs: scenarios.find((scenario) => scenario.id === "telegram-canary")?.rttMs,
87-mentionReplyMs: scenarios.find((scenario) => scenario.id === "telegram-mentioned-message-reply")
88-?.rttMs,
114+mentionReplyMs: mention?.stats?.p50Ms ?? mention?.rttMs,
89115};
116+if (warmSamples?.length) {
117+rtt.warmSamples = warmSamples;
118+}
119+if (mention?.stats) {
120+rtt.avgMs = mention.stats.avgMs;
121+rtt.p50Ms = mention.stats.p50Ms;
122+rtt.p95Ms = mention.stats.p95Ms;
123+rtt.maxMs = mention.stats.maxMs;
124+rtt.failedSamples = mention.stats.failed;
125+}
126+return rtt;
90127}
9112892129export function createHarnessEnv(params: {
@@ -96,6 +133,8 @@ export function createHarnessEnv(params: {
96133spec: string;
97134version: string;
98135rawOutputDir: string;
136+samples: number;
137+sampleTimeoutMs: number;
99138timeoutMs: number;
100139}) {
101140return {
@@ -106,6 +145,8 @@ export function createHarnessEnv(params: {
106145OPENCLAW_NPM_TELEGRAM_SCENARIOS: params.scenarios.join(","),
107146OPENCLAW_NPM_TELEGRAM_OUTPUT_DIR: params.rawOutputDir,
108147OPENCLAW_NPM_TELEGRAM_FAST: params.baseEnv.OPENCLAW_NPM_TELEGRAM_FAST ?? "1",
148+OPENCLAW_NPM_TELEGRAM_WARM_SAMPLES: String(params.samples),
149+OPENCLAW_NPM_TELEGRAM_SAMPLE_TIMEOUT_MS: String(params.sampleTimeoutMs),
109150OPENCLAW_QA_TELEGRAM_CANARY_TIMEOUT_MS: String(params.timeoutMs),
110151OPENCLAW_QA_TELEGRAM_SCENARIO_TIMEOUT_MS: String(params.timeoutMs),
111152};
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。