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

推荐订阅源

S
Securelist
Engineering at Meta
Engineering at Meta
MongoDB | Blog
MongoDB | Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
A
About on SuperTechFans
S
Security @ Cisco Blogs
L
LangChain Blog
Cloudbric
Cloudbric
B
Blog
Google Online Security Blog
Google Online Security Blog
I
InfoQ
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
GbyAI
GbyAI
WordPress大学
WordPress大学
月光博客
月光博客
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
小众软件
小众软件
Cyberwarzone
Cyberwarzone
Martin Fowler
Martin Fowler
AWS News Blog
AWS News Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
PCI Perspectives
PCI Perspectives
T
The Exploit Database - CXSecurity.com
Hugging Face - Blog
Hugging Face - Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
CERT Recently Published Vulnerability Notes
博客园 - 司徒正美
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
F
Full Disclosure
P
Palo Alto Networks Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
V2EX - 技术
V2EX - 技术
G
GRAHAM CLULEY
T
Threat Research - Cisco Blogs
P
Privacy International News Feed
S
Schneier on Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Attack and Defense Labs
Attack and Defense Labs
V
Visual Studio Blog
N
News and Events Feed by Topic
C
Cybersecurity and Infrastructure Security Agency CISA
S
Security Affairs
Spread Privacy
Spread Privacy
Vercel News
Vercel News
量子位
Apple Machine Learning Research
Apple Machine Learning Research
Security Latest
Security Latest
T
The Blog of Author Tim Ferriss
IT之家
IT之家
Stack Overflow Blog
Stack Overflow 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 test: trim doctor command hotspots · openclaw/openclaw@c66f16a test: isolate agent auth and spawn hotspots · openclaw/openclaw@9285935 test: stabilize MCP startup disposal race · openclaw/openclaw@dd9d2eb test: merge browser contract server suites · openclaw/openclaw@5817a76 test: narrow ollama provider discovery setup · openclaw/openclaw@a0d9598 build: declare qa-lab aimock runtime dependency · openclaw/openclaw@24431e5 test: speed up safe-bins exec harness · openclaw/openclaw@ee856ab test: preserve tool helpers in embedded runner mocks · openclaw/openclaw@acd86a0 refactor: move memory embeddings into provider plugins · openclaw/openclaw@77e6e4c test: reuse system-run temp fixtures · openclaw/openclaw@7e9ff0f test: trim hotspot wait overhead · openclaw/openclaw@12a59b0 Check: avoid duplicate boundary prep · openclaw/openclaw@baf11b8 test: reduce hotspot fixture overhead · openclaw/openclaw@3a59edd feat(ui): overhaul settings and slash command UX (#67819) thanks @Bun… · openclaw/openclaw@2cfb660 QA Matrix: exit cleanly on failure · openclaw/openclaw@42805d2 QA Matrix: isolate scenario coverage · openclaw/openclaw@7e659e1 Matrix: refresh crypto bootstrap state · openclaw/openclaw@94081d8 QA Lab: add provider registry · openclaw/openclaw@bb7e982 Matrix: add plugin changelog · openclaw/openclaw@4acab55 test: trim more hotspot overhead · openclaw/openclaw@f485311 test: trim remaining hotspot tests · openclaw/openclaw@6ba8626 test: narrow hotspot mocks · openclaw/openclaw@dbc8179 test: isolate gemini embedding request helpers · openclaw/openclaw@cd330f5 test: trim memory and mcp hotspots · openclaw/openclaw@fd48dfa test: slim provider registry mocks · openclaw/openclaw@2e08c77 test: harden Parallels update smoke · openclaw/openclaw@1a98090 feat: default Anthropic to Opus 4.7 · openclaw/openclaw@628b454 fix: harden node-host shell payload mutability checks · openclaw/openclaw@75c551e fix: land node-host approval binding for native binaries (#66731) (th… · openclaw/openclaw@29919bb CI: add daily schedule to CodeQL workflow (#67645) · openclaw/openclaw@69d25f5 fix(gateway): capture config hash after plugin auto-enable to prevent… · openclaw/openclaw@8c11210 fix: repair sanitized replay tool results before send (#67620) (thank… · openclaw/openclaw@c3c7a99 fix: restrict HTML timeout short-circuit to transient statuses · openclaw/openclaw@de129a6 fix: keep TUI watchdog bound to active run (#67401) (thanks @xantorres) · openclaw/openclaw@3525273 Gateway/skills: dedupe skills prefix-match + drop dead fallback on log · openclaw/openclaw@d7f489f Extensions/lmstudio: back off inference preload after consecutive fai… · openclaw/openclaw@b555214 TUI/streaming: add watchdog that resets the activity indicator after … · openclaw/openclaw@f44ab20 Agents/tool-loop: enable unknown-tool stream guard by default · openclaw/openclaw@36ed367 Gateway/skills: invalidate session skills snapshot on config write · openclaw/openclaw@b23d59a fix: classify HTML provider error pages correctly (#67642) (thanks @s… · openclaw/openclaw@e588e90 fix(skills): remove unused model-usage import (#67641) · openclaw/openclaw@55f05df docs(changelog): credit codex fix superseded PRs · openclaw/openclaw@e485f24 fix(openai-codex): normalize stale transport metadata in resolution a… · openclaw/openclaw@90801ba CI: pin Docker-related GitHub Actions (#67632) · openclaw/openclaw@f697b01 Android: modernize WebView and discovery API usage (#67627) · openclaw/openclaw@44a6e50 fix(deps): bump hono to 4.12.14 and @hono/node-server to 1.19.14 (GHS… · openclaw/openclaw@fbccc18 fix(deps): bump dompurify to 3.4.0 (#67614) · openclaw/openclaw@2c2dc00 CI: add explicit permissions to all workflow jobs (fixes code-scannin… · openclaw/openclaw@01b7516 fix: register bundled TTS providers and route overrides correctly (#6… · openclaw/openclaw@6ea3cdd fix: align host tilde paths with OS home (#62804) (thanks @stainlu) · openclaw/openclaw@ecfaf64 fix: flush creds queue before reconnect socket open (#67464) (thanks … · openclaw/openclaw@405c63f fix: strip standalone <function> tool call tags from visible text (#6… · openclaw/openclaw@78df859 fix(agents): preserve cli session metadata before transcript persist … · openclaw/openclaw@898fd04 docs(changelog): move cli transcript entry · openclaw/openclaw@c1817c6 fix(agents): normalize cli transcript api field · openclaw/openclaw@3a3fae0 docs(changelog): note cli transcript persistence · openclaw/openclaw@6c343f1 fix(agents): persist cli transcript turns · openclaw/openclaw@b8ef507 fix(msteams): harden security-sensitive flows (#65841) · openclaw/openclaw@c56b56e [Dashboard] Fix exec approval modal overflow for long command content… · openclaw/openclaw@053c5b0 Docs: remove QA changelog entry · openclaw/openclaw@7fd5771 QA: fix private runtime source loading (#67428) · openclaw/openclaw@d5933af docs(gateway): correct protocol.md schema path, hello-ok example, aut… · openclaw/openclaw@489404d CI: pin Node 22 runners to 22.18.0 · openclaw/openclaw@4ffa621 models.authStatus: normalize provider ids + tighten env-backed escape… · openclaw/openclaw@f2fdb9d Update CHANGELOG.md · openclaw/openclaw@7694a92 test(parallels): clean up npm update guard jobs · openclaw/openclaw@045ea7b Plugins: prefer scanDir override paths · openclaw/openclaw@b2974da fix(dreaming): default storage.mode to "separate" so phase blocks sto… · openclaw/openclaw@8c392f0 fix(memory-core): skip dreaming transcript ingestion via session stor… · openclaw/openclaw@a1b01f0 fix: dedupe replayed exec.finished node events (#67281) · openclaw/openclaw@5dcf526
fix: surface model pricing health degradation · openclaw/openclaw@02d3fe3
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 = {