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

推荐订阅源

B
Blog RSS Feed
Jina AI
Jina AI
雷峰网
雷峰网
Blog — PlanetScale
Blog — PlanetScale
Hugging Face - Blog
Hugging Face - Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Last Week in AI
Last Week in AI
博客园 - 司徒正美
罗磊的独立博客
J
Java Code Geeks
Engineering at Meta
Engineering at Meta
WordPress大学
WordPress大学
Vercel News
Vercel News
A
About on SuperTechFans
I
InfoQ
D
DataBreaches.Net
爱范儿
爱范儿
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
U
Unit 42
aimingoo的专栏
aimingoo的专栏
宝玉的分享
宝玉的分享
P
Proofpoint News Feed
Microsoft Azure Blog
Microsoft Azure Blog
美团技术团队

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
fix: surface model pricing health degradation · openclaw/...
steipete · 2026-05-10 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -40,6 +40,7 @@ Docs: https://docs.openclaw.ai

4040

- Gateway/agents: keep structured reasons when active-run queueing fails and deprecate the legacy boolean queue helper, so steering and subagent wake diagnostics distinguish completed, non-streaming, and compacting runs. Fixes #80156. Thanks @markus-lassfolk.

4141

- Agents/UI: compact exec and tool progress rows by hiding redundant shell tool names, replacing known workspace paths with short context markers, and preserving Discord trace scrubbing for compact command lines.

4242

- ACPX: run and await the embedded ACP backend startup probe by default so the gateway `ready` signal no longer fires before the acpx runtime has either become usable or reported a probe failure; set `OPENCLAW_ACPX_RUNTIME_STARTUP_PROBE=0` to restore lazy startup. Fixes #79596. Thanks @bzelones.

43+

- Gateway/status: surface model-pricing bootstrap and refresh failures as degraded health/status warnings while keeping Gateway liveness healthy. Fixes #79599. Thanks @bzelones.

4344

- OpenAI-compatible models: strip prior assistant reasoning fields from replayed Chat Completions history by default, preventing oMLX/vLLM Qwen follow-up turns from rejecting or stalling on stale `reasoning` payloads. Fixes #46637. Thanks @zipzagster and @lexhoefsloot.

4445

- CLI/onboarding: give non-Azure custom providers a safe generated context window and heal legacy 4k wizard entries without overwriting explicit valid small model limits, preventing first-turn compaction loops. Fixes #79428. (#79911) Thanks @Jefsky.

4546

- OpenAI-compatible models: add `compat.strictMessageKeys` to strip Chat Completions replay messages to `role` and `content` for strict providers that reject OpenAI-style tool and metadata keys. Fixes #50374. Thanks @choutos.

Original file line numberDiff line numberDiff line change

@@ -360,6 +360,58 @@ describe("gateway-status command", () => {

360360

requireRecord(firstTarget.summary, "first target summary");

361361

});

362362
363+

it("surfaces degraded model-pricing health as a warning", async () => {

364+

const { runtime, runtimeLogs, runtimeErrors } = createRuntimeCapture();

365+

const defaultProbeGateway = probeGateway.getMockImplementation();

366+

try {

367+

probeGateway.mockImplementation(async (opts: { url: string }) => {

368+

const result = defaultProbeGateway

369+

? await defaultProbeGateway(opts)

370+

: await mocks.probeGateway(opts);

371+

return {

372+

...result,

373+

health: {

374+

ok: true,

375+

modelPricing: {

376+

state: "degraded",

377+

detail: "OpenRouter pricing fetch failed: TypeError: fetch failed",

378+

sources: [

379+

{

380+

source: "openrouter",

381+

state: "degraded",

382+

detail: "OpenRouter pricing fetch failed: TypeError: fetch failed",

383+

},

384+

],

385+

},

386+

},

387+

};

388+

});

389+
390+

await runGatewayStatus(runtime, { timeout: "1000", json: true });

391+

} finally {

392+

probeGateway.mockReset();

393+

if (defaultProbeGateway) {

394+

probeGateway.mockImplementation(defaultProbeGateway);

395+

}

396+

}

397+
398+

expect(runtimeErrors).toHaveLength(0);

399+

const parsed = JSON.parse(runtimeLogs.join("\n")) as {

400+

degraded?: boolean;

401+

warnings?: Array<{ code?: string; message?: string }>;

402+

};

403+

expect(parsed.degraded).toBe(true);

404+

expect(parsed.warnings).toEqual(

405+

expect.arrayContaining([

406+

expect.objectContaining({

407+

code: "model_pricing_degraded",

408+

message:

409+

"Model pricing degraded: OpenRouter pricing fetch failed: TypeError: fetch failed",

410+

}),

411+

]),

412+

);

413+

});

414+
363415

it("includes diagnostic next steps when no gateway is reachable or discoverable", async () => {

364416

const { runtime, runtimeLogs, runtimeErrors } = createRuntimeCapture();

365417

const defaultProbeGateway = probeGateway.getMockImplementation();

Original file line numberDiff line numberDiff line change

@@ -21,6 +21,23 @@ export type GatewayStatusWarning = {

2121

const noReachableGatewayDiagnostic =

2222

"No gateway answered any probe and Bonjour discovery returned no local gateways. Run `openclaw gateway status --deep --require-rpc` to inspect service state, config paths, listener owners, and logs; include `ss -ltnp` or `lsof -nP -iTCP:<port> -sTCP:LISTEN` for the configured port when filing a report.";

2323
24+

function readModelPricingDegradedDetail(health: unknown): string | null {

25+

if (!health || typeof health !== "object") {

26+

return null;

27+

}

28+

const modelPricing = (health as { modelPricing?: unknown }).modelPricing;

29+

if (!modelPricing || typeof modelPricing !== "object") {

30+

return null;

31+

}

32+

const record = modelPricing as { state?: unknown; detail?: unknown };

33+

if (record.state !== "degraded") {

34+

return null;

35+

}

36+

return typeof record.detail === "string" && record.detail.trim()

37+

? record.detail.trim()

38+

: "pricing bootstrap or refresh failed";

39+

}

40+
2441

export function pickPrimaryProbedTarget(probed: GatewayStatusProbedTarget[]) {

2542

const reachable = probed.filter((entry) => isProbeReachable(entry.probe));

2643

return (

@@ -106,6 +123,17 @@ export function buildGatewayStatusWarnings(params: {

106123

targetIds: [result.target.id],

107124

});

108125

}

126+

for (const result of reachable) {

127+

const detail = readModelPricingDegradedDetail(result.probe.health);

128+

if (!detail) {

129+

continue;

130+

}

131+

warnings.push({

132+

code: "model_pricing_degraded",

133+

message: `Model pricing degraded: ${detail}`,

134+

targetIds: [result.target.id],

135+

});

136+

}

109137

return warnings;

110138

}

111139

@@ -121,7 +149,9 @@ export function writeGatewayStatusJson(params: {

121149

primaryTargetId: string | null;

122150

}) {

123151

const reachable = params.probed.filter((entry) => isProbeReachable(entry.probe));

124-

const degraded = params.probed.some((entry) => isPostConnectProbeFailure(entry.probe));

152+

const degraded =

153+

params.probed.some((entry) => isPostConnectProbeFailure(entry.probe)) ||

154+

reachable.some((entry) => readModelPricingDegradedDetail(entry.probe.health));

125155

const capability = summarizeGatewayProbeCapability(reachable.map((entry) => entry.probe));

126156

writeRuntimeJson(params.runtime, {

127157

ok: reachable.length > 0,

Original file line numberDiff line numberDiff line change

@@ -130,6 +130,35 @@ describe("healthCommand", () => {

130130

expect(gatewayRequest?.password).toBe("setup-password");

131131

});

132132
133+

it("prints degraded model-pricing health without failing the command", async () => {

134+

const snapshot = createHealthSummary({

135+

channels: {},

136+

channelOrder: [],

137+

channelLabels: {},

138+

});

139+

snapshot.modelPricing = {

140+

state: "degraded",

141+

sources: [

142+

{

143+

source: "openrouter",

144+

state: "degraded",

145+

lastFailureAt: Date.now(),

146+

detail: "OpenRouter pricing fetch failed: TypeError: fetch failed",

147+

},

148+

],

149+

detail: "OpenRouter pricing fetch failed: TypeError: fetch failed",

150+

lastFailureAt: Date.now(),

151+

};

152+

callGatewayMock.mockResolvedValueOnce(snapshot);

153+
154+

await healthCommand({ json: false, timeoutMs: 5000, config: {} }, runtime as never);

155+
156+

expect(runtime.exit).not.toHaveBeenCalled();

157+

expect(stripAnsi(runtime.log.mock.calls.flat().join("\n"))).toContain(

158+

"Model pricing: degraded (OpenRouter pricing fetch failed: TypeError: fetch failed)",

159+

);

160+

});

161+
133162

it("formats per-account probe timings", () => {

134163

const summary = createHealthSummary({

135164

channels: {

Original file line numberDiff line numberDiff line change

@@ -19,6 +19,8 @@ import {

1919

DEFAULT_CHANNEL_STALE_EVENT_THRESHOLD_MS,

2020

evaluateChannelHealth,

2121

} from "../gateway/channel-health-policy.js";

22+

import { getGatewayModelPricingHealth } from "../gateway/model-pricing-cache-state.js";

23+

import { isGatewayModelPricingEnabled } from "../gateway/model-pricing-config.js";

2224

import type { ChannelRuntimeSnapshot } from "../gateway/server-channel-runtime.types.js";

2325

import { info } from "../globals.js";

2426

import { isTruthyEnvValue } from "../infra/env.js";

@@ -111,6 +113,18 @@ function formatEventLoopHealthLine(summary: HealthSummary): string | null {

111113

}`;

112114

}

113115
116+

function formatModelPricingHealthLine(summary: HealthSummary): string | null {

117+

const modelPricing = summary.modelPricing;

118+

if (!modelPricing || modelPricing.state === "disabled") {

119+

return null;

120+

}

121+

if (modelPricing.state === "ok") {

122+

return null;

123+

}

124+

const detail = modelPricing.detail ? ` (${modelPricing.detail})` : "";

125+

return `Model pricing: degraded${detail}`;

126+

}

127+
114128

const resolveHeartbeatSummary = (cfg: OpenClawConfig, agentId: string) =>

115129

resolveHeartbeatSummaryForAgent(cfg, agentId);

116130

@@ -514,6 +528,7 @@ export async function getHealthSnapshot(params?: {

514528

durationMs: Date.now() - start,

515529

...(params?.eventLoop ? { eventLoop: params.eventLoop } : {}),

516530

...(pluginHealth ? { plugins: pluginHealth } : {}),

531+

modelPricing: getGatewayModelPricingHealth({ enabled: isGatewayModelPricingEnabled(cfg) }),

517532

channels,

518533

channelOrder,

519534

channelLabels,

@@ -701,6 +716,10 @@ export async function healthCommand(

701716

if (eventLoopLine) {

702717

runtime.log(styleHealthChannelLine(eventLoopLine, rich));

703718

}

719+

const modelPricingLine = formatModelPricingHealthLine(summary);

720+

if (modelPricingLine) {

721+

runtime.log(styleHealthChannelLine(modelPricingLine, rich));

722+

}

704723

for (const plugin of displayPlugins) {

705724

const channelSummary = summary.channels?.[plugin.id];

706725

if (!channelSummary || channelSummary.linked !== true) {

Original file line numberDiff line numberDiff line change

@@ -35,12 +35,16 @@ export type PluginHealthSummary = {

3535

errors: PluginHealthErrorSummary[];

3636

};

3737
38+

export type ModelPricingHealthSummary =

39+

import("../gateway/model-pricing-cache-state.js").GatewayModelPricingHealth;

40+
3841

export type HealthSummary = {

3942

ok: true;

4043

ts: number;

4144

durationMs: number;

4245

eventLoop?: import("../gateway/server/event-loop-health.js").GatewayEventLoopHealth;

4346

plugins?: PluginHealthSummary;

47+

modelPricing?: ModelPricingHealthSummary;

4448

channels: Record<string, ChannelHealthSummary>;

4549

channelOrder: string[];

4650

channelLabels: Record<string, string>;

Original file line numberDiff line numberDiff line change

@@ -464,6 +464,7 @@ export function buildGatewayStatusJsonPayload(params: {

464464

| {

465465

connectLatencyMs?: number | null;

466466

error?: string | null;

467+

health?: unknown;

467468

}

468469

| null

469470

| undefined;

@@ -488,6 +489,13 @@ export function buildGatewayStatusJsonPayload(params: {

488489

self: params.gatewaySelf ?? null,

489490

error: params.gatewayProbe?.error ?? null,

490491

authWarning: params.gatewayProbeAuthWarning ?? null,

492+

...(params.gatewayProbe?.health &&

493+

typeof params.gatewayProbe.health === "object" &&

494+

"modelPricing" in params.gatewayProbe.health

495+

? {

496+

modelPricing: (params.gatewayProbe.health as { modelPricing?: unknown }).modelPricing,

497+

}

498+

: {}),

491499

};

492500

}

493501
Original file line numberDiff line numberDiff line change

@@ -168,4 +168,52 @@ describe("status-json-payload", () => {

168168

}),

169169

).not.toHaveProperty("securityAudit");

170170

});

171+
172+

it("includes model-pricing health from the gateway probe", () => {

173+

const payload = buildStatusJsonPayload({

174+

summary: { ok: true },

175+

surface: {

176+

cfg: { gateway: {} },

177+

update: {

178+

root: "/tmp/openclaw",

179+

installKind: "package",

180+

packageManager: "npm",

181+

} as never,

182+

tailscaleMode: "off",

183+

gatewayMode: "local",

184+

remoteUrlMissing: false,

185+

gatewayConnection: { url: "ws://127.0.0.1:18789" },

186+

gatewayReachable: true,

187+

gatewayProbe: {

188+

connectLatencyMs: 42,

189+

error: null,

190+

health: {

191+

ok: true,

192+

modelPricing: {

193+

state: "degraded",

194+

detail: "OpenRouter pricing fetch failed: TypeError: fetch failed",

195+

sources: [{ source: "openrouter", state: "degraded" }],

196+

},

197+

},

198+

},

199+

gatewayProbeAuth: null,

200+

gatewaySelf: null,

201+

gatewayProbeAuthWarning: null,

202+

gatewayService: { label: "LaunchAgent", installed: false, loadedText: "not installed" },

203+

nodeService: { label: "node", installed: false, loadedText: "not installed" },

204+

},

205+

osSummary: { platform: "linux" },

206+

memory: null,

207+

memoryPlugin: null,

208+

agents: [],

209+

secretDiagnostics: [],

210+

});

211+
212+

expect(payload.gateway).toMatchObject({

213+

modelPricing: {

214+

state: "degraded",

215+

detail: "OpenRouter pricing fetch failed: TypeError: fetch failed",

216+

},

217+

});

218+

});

171219

});

Original file line numberDiff line numberDiff line change

@@ -27,6 +27,45 @@ import {

2727

import type { MemoryPluginStatus, MemoryStatusSnapshot } from "./status.scan.shared.js";

2828

import type { StatusSummary } from "./status.types.js";

2929
30+

function readModelPricingHealth(params: {

31+

health?: HealthSummary;

32+

surface: StatusOverviewSurface;

33+

}): HealthSummary["modelPricing"] | undefined {

34+

if (params.health?.modelPricing) {

35+

return params.health.modelPricing;

36+

}

37+

const probeHealth = params.surface.gatewayProbe?.health;

38+

if (!probeHealth || typeof probeHealth !== "object") {

39+

return undefined;

40+

}

41+

const modelPricing = (probeHealth as { modelPricing?: unknown }).modelPricing;

42+

if (!modelPricing || typeof modelPricing !== "object") {

43+

return undefined;

44+

}

45+

const state = (modelPricing as { state?: unknown }).state;

46+

if (state !== "ok" && state !== "degraded" && state !== "disabled") {

47+

return undefined;

48+

}

49+

return modelPricing as HealthSummary["modelPricing"];

50+

}

51+
52+

function buildModelPricingOverviewValue(params: {

53+

health?: HealthSummary["modelPricing"];

54+

ok: (value: string) => string;

55+

warn: (value: string) => string;

56+

muted: (value: string) => string;

57+

}): string | null {

58+

const health = params.health;

59+

if (!health) {

60+

return null;

61+

}

62+

if (health.state !== "degraded") {

63+

return null;

64+

}

65+

const detail = health.detail ? ` · ${health.detail}` : "";

66+

return params.warn(`degraded${detail}`);

67+

}

68+
3069

export function buildStatusCommandOverviewRows(

3170

params: {

3271

opts: {

@@ -96,6 +135,15 @@ export function buildStatusCommandOverviewRows(

96135

ok: params.ok,

97136

warn: params.warn,

98137

});

138+

const modelPricingValue = buildModelPricingOverviewValue({

139+

health: readModelPricingHealth({

140+

health: params.health,

141+

surface: params.surface,

142+

}),

143+

ok: params.ok,

144+

warn: params.warn,

145+

muted: params.muted,

146+

});

99147
100148

return buildStatusOverviewRowsFromSurface({

101149

surface: params.surface,

@@ -107,6 +155,7 @@ export function buildStatusCommandOverviewRows(

107155

updateValue: params.updateValue,

108156

agentsValue,

109157

suffixRows: [

158+

...(modelPricingValue ? [{ Item: "Model pricing", Value: modelPricingValue }] : []),

110159

{ Item: "Memory", Value: memoryValue },

111160

{ Item: "Plugin compatibility", Value: pluginCompatibilityValue },

112161

{ Item: "Probes", Value: probesValue },

Original file line numberDiff line numberDiff line change

@@ -17,6 +17,7 @@ type StatusGatewayConnection = {

1717

type StatusGatewayProbe = {

1818

connectLatencyMs?: number | null;

1919

error?: string | null;

20+

health?: unknown;

2021

} | null;

2122
2223

type StatusGatewayAuth = {