惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
爱范儿
爱范儿
WordPress大学
WordPress大学
博客园 - 三生石上(FineUI控件)
J
Java Code Geeks
Vercel News
Vercel News
aimingoo的专栏
aimingoo的专栏
T
Tailwind CSS Blog
罗磊的独立博客
B
Blog
博客园_首页
A
About on SuperTechFans
有赞技术团队
有赞技术团队
V
V2EX
U
Unit 42
I
InfoQ
IT之家
IT之家
博客园 - 司徒正美
阮一峰的网络日志
阮一峰的网络日志
博客园 - 叶小钗
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Stack Overflow Blog
Stack Overflow Blog
The Cloudflare Blog
H
Help Net Security

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
test: tighten diagnostics histogram assertions · openclaw...
steipete · 2026-05-10 · via Recent Commits to openclaw:main

@@ -216,6 +216,16 @@ function lastHistogramRecord(name: string) {

216216

| undefined;

217217

}

218218219+

function histogramCreateOptions(name: string) {

220+

const calls = telemetryState.meter.createHistogram.mock.calls as unknown as Array<

221+

[string, unknown?]

222+

>;

223+

const call = calls.find(([histogramName]) => histogramName === name);

224+

return call?.[1] as

225+

| { unit?: unknown; advice?: { explicitBucketBoundaries?: unknown[] } }

226+

| undefined;

227+

}

228+219229

async function emitAndCaptureLog(

220230

event: Omit<Extract<Parameters<typeof emitDiagnosticEvent>[0], { type: "log.record" }>, "type">,

221231

options: { trusted?: boolean } = {},

@@ -993,15 +1003,12 @@ describe("diagnostics-otel service", () => {

9931003

});

9941004

await flushDiagnosticEvents();

9951005996-

expect(telemetryState.meter.createHistogram).toHaveBeenCalledWith(

997-

"gen_ai.client.token.usage",

998-

expect.objectContaining({

999-

unit: "{token}",

1000-

advice: {

1001-

explicitBucketBoundaries: expect.arrayContaining([1, 4, 16, 1024, 67108864]),

1002-

},

1003-

}),

1004-

);

1006+

const tokenUsageOptions = histogramCreateOptions("gen_ai.client.token.usage");

1007+

expect(tokenUsageOptions?.unit).toBe("{token}");

1008+

const tokenUsageBoundaries = tokenUsageOptions?.advice?.explicitBucketBoundaries;

1009+

for (const boundary of [1, 4, 16, 1024, 67108864]) {

1010+

expect(tokenUsageBoundaries).toContain(boundary);

1011+

}

10051012

const genAiTokenUsage = telemetryState.histograms.get("gen_ai.client.token.usage");

10061013

const tokens = telemetryState.counters.get("openclaw.tokens");

10071014

expect(tokens?.add).toHaveBeenCalledWith(12, {

@@ -1158,15 +1165,12 @@ describe("diagnostics-otel service", () => {

11581165

});

11591166

await flushDiagnosticEvents();

116011671161-

expect(telemetryState.meter.createHistogram).toHaveBeenCalledWith(

1162-

"gen_ai.client.operation.duration",

1163-

expect.objectContaining({

1164-

unit: "s",

1165-

advice: {

1166-

explicitBucketBoundaries: expect.arrayContaining([0.01, 0.32, 2.56, 81.92]),

1167-

},

1168-

}),

1169-

);

1168+

const operationDurationOptions = histogramCreateOptions("gen_ai.client.operation.duration");

1169+

expect(operationDurationOptions?.unit).toBe("s");

1170+

const operationDurationBoundaries = operationDurationOptions?.advice?.explicitBucketBoundaries;

1171+

for (const boundary of [0.01, 0.32, 2.56, 81.92]) {

1172+

expect(operationDurationBoundaries).toContain(boundary);

1173+

}

11701174

const genAiOperationDuration = telemetryState.histograms.get(

11711175

"gen_ai.client.operation.duration",

11721176

);