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

推荐订阅源

Google DeepMind News
Google DeepMind News
博客园 - 司徒正美
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
V2EX
博客园_首页
量子位
博客园 - 三生石上(FineUI控件)
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
腾讯CDC
T
The Blog of Author Tim Ferriss
博客园 - 聂微东
V
Visual Studio Blog
J
Java Code Geeks
宝玉的分享
宝玉的分享
爱范儿
爱范儿
MongoDB | Blog
MongoDB | Blog
D
Docker
大猫的无限游戏
大猫的无限游戏
Y
Y Combinator Blog
H
Help Net Security
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Blog — PlanetScale
Blog — PlanetScale

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 liveness assertions · openclaw/...
steipete · 2026-05-10 · via Recent Commits to openclaw:main

@@ -210,6 +210,12 @@ function startedSpanOptions(name: string) {

210210

return call?.[1] as { attributes?: Record<string, unknown>; startTime?: unknown } | undefined;

211211

}

212212213+

function lastHistogramRecord(name: string) {

214+

return telemetryState.histograms.get(name)?.record.mock.calls.at(-1) as

215+

| [unknown, Record<string, unknown>?]

216+

| undefined;

217+

}

218+213219

async function emitAndCaptureLog(

214220

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

215221

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

@@ -453,11 +459,9 @@ describe("diagnostics-otel service", () => {

453459

});

454460

await flushDiagnosticEvents();

455461456-

const runDurationRecordCall = telemetryState.histograms

457-

.get("openclaw.run.duration_ms")

458-

?.record.mock.calls.at(-1);

462+

const runDurationRecordCall = lastHistogramRecord("openclaw.run.duration_ms");

459463

expect(runDurationRecordCall?.[0]).toBe(100);

460-

const runDurationAttributes = runDurationRecordCall?.[1] as Record<string, unknown> | undefined;

464+

const runDurationAttributes = runDurationRecordCall?.[1];

461465

expect(runDurationAttributes?.["openclaw.provider"]).toBe("openai");

462466

expect(runDurationAttributes?.["openclaw.model"]).toBe("gpt-5.4");

463467

const runSpanOptions = startedSpanOptions("openclaw.run");

@@ -537,16 +541,12 @@ describe("diagnostics-otel service", () => {

537541

).toHaveBeenCalledWith(1.4, {

538542

"openclaw.liveness.reason": "event_loop_delay:cpu",

539543

});

540-

const livenessSpan = telemetryState.tracer.startSpan.mock.calls.find(

541-

(call) => call[0] === "openclaw.liveness.warning",

544+

const livenessSpanOptions = startedSpanOptions("openclaw.liveness.warning");

545+

expect(livenessSpanOptions?.attributes?.["openclaw.liveness.reason"]).toBe(

546+

"event_loop_delay:cpu",

542547

);

543-

expect(livenessSpan?.[1]).toMatchObject({

544-

attributes: {

545-

"openclaw.liveness.reason": "event_loop_delay:cpu",

546-

"openclaw.liveness.active": 2,

547-

"openclaw.liveness.queued": 4,

548-

},

549-

});

548+

expect(livenessSpanOptions?.attributes?.["openclaw.liveness.active"]).toBe(2);

549+

expect(livenessSpanOptions?.attributes?.["openclaw.liveness.queued"]).toBe(4);

550550

const span = telemetryState.spans.find((item) => item.name === "openclaw.liveness.warning");

551551

expect(span?.setStatus).toHaveBeenCalledWith({

552552

code: 2,

@@ -577,18 +577,14 @@ describe("diagnostics-otel service", () => {

577577

});

578578

await flushDiagnosticEvents();

579579580-

expect(events).toEqual(

581-

expect.arrayContaining([

582-

expect.objectContaining({

583-

type: "telemetry.exporter",

584-

exporter: "diagnostics-otel",

585-

signal: "logs",

586-

status: "failure",

587-

reason: "emit_failed",

588-

errorCategory: "TypeError",

589-

}),

590-

]),

591-

);

580+

const exporterEvents = events.filter((event) => event.type === "telemetry.exporter");

581+

const failureEvent = exporterEvents.find((event) => event.status === "failure");

582+

expect(failureEvent?.type).toBe("telemetry.exporter");

583+

expect(failureEvent?.exporter).toBe("diagnostics-otel");

584+

expect(failureEvent?.signal).toBe("logs");

585+

expect(failureEvent?.status).toBe("failure");

586+

expect(failureEvent?.reason).toBe("emit_failed");

587+

expect(failureEvent?.errorCategory).toBe("TypeError");

592588

expect(

593589

telemetryState.counters.get("openclaw.telemetry.exporter.events")?.add,

594590

).toHaveBeenCalledWith(1, {

@@ -640,13 +636,10 @@ describe("diagnostics-otel service", () => {

640636

});

641637

await flushDiagnosticEvents();

642638643-

expect(telemetryState.histograms.get("openclaw.run.duration_ms")?.record).toHaveBeenCalledWith(

644-

100,

645-

expect.objectContaining({

646-

"openclaw.outcome": "blocked",

647-

"openclaw.blocked_by": "policy-plugin",

648-

}),

649-

);

639+

const runDurationRecordCall = lastHistogramRecord("openclaw.run.duration_ms");

640+

expect(runDurationRecordCall?.[0]).toBe(100);

641+

expect(runDurationRecordCall?.[1]?.["openclaw.outcome"]).toBe("blocked");

642+

expect(runDurationRecordCall?.[1]?.["openclaw.blocked_by"]).toBe("policy-plugin");

650643

expect(JSON.stringify(telemetryState)).not.toContain("matched secret prompt");

651644652645

await service.stop?.(ctx);

@@ -669,12 +662,9 @@ describe("diagnostics-otel service", () => {

669662

await flushDiagnosticEvents();

670663671664

expect(sdkStart).not.toHaveBeenCalled();

672-

expect(telemetryState.histograms.get("openclaw.run.duration_ms")?.record).toHaveBeenCalledWith(

673-

100,

674-

expect.objectContaining({

675-

"openclaw.provider": "openai",

676-

}),

677-

);

665+

const runDurationRecordCall = lastHistogramRecord("openclaw.run.duration_ms");

666+

expect(runDurationRecordCall?.[0]).toBe(100);

667+

expect(runDurationRecordCall?.[1]?.["openclaw.provider"]).toBe("openai");

678668

expect(telemetryState.tracer.startSpan).not.toHaveBeenCalled();

679669680670

await service.stop?.(ctx);