Repository navigation
fix(status): surface model-pricing health degradation - #80277
Conversation
|
@clawsweeper autofix |
|
🦞🔧
This is fix-only; I will not merge this PR. |
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: no. live runtime reproduction was run in this read-only review. Source inspection shows the current-main path: pricing fetch/bootstrap failures are warning-only, while health/status have no model-pricing field to emit. Real behavior proof Next step before merge Security Review detailsBest possible solution: Land one canonical implementation that records pricing source failures in gateway-owned state, keeps gateway liveness healthy, and surfaces degraded model-pricing warnings consistently across health/status outputs. Do we have a high-confidence way to reproduce the issue? No live runtime reproduction was run in this read-only review. Source inspection shows the current-main path: pricing fetch/bootstrap failures are warning-only, while health/status have no model-pricing field to emit. Is this the best way to solve the issue? Yes, the proposed direction is the narrow maintainable fix: store structured pricing failure state, keep liveness semantics unchanged, and render it through existing operator health/status surfaces. The remaining decision is which overlapping PR should become canonical. Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against dc112f833f93. |
|
🦞✅ Source: I added |
|
ClawSweeper 🐠 automerge status This pass ended as a no-op: no narrow repair surfaced, so ClawSweeper left the branch untouched. Executor outcome: source PR #80277 is paused by clawsweeper:human-review; refusing to mutate the PR branch. Worker actions:
This pass stayed observational only. No branch push, replacement, merge, or re-review was started. fish notes: model gpt-5.5, reasoning high. Automerge progress:
|
|
🦞✅ Source: I added |
08cbc04 to
18ab43c
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 18ab43c8ac
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ...(params.eventLoop ? { eventLoop: params.eventLoop } : {}), | ||
| modelPricing: getGatewayModelPricingHealth({ | ||
| enabled: params.cached.modelPricing?.state !== "disabled", | ||
| }), |
There was a problem hiding this comment.
Clear stale event-loop health when no live sample exists
When serving cached health, mergeCachedHealthRuntimeState only overwrites eventLoop if the new sample is truthy. If getEventLoopHealth() returns undefined (for example when the monitor is unavailable/stopped), the previous cached eventLoop object is kept and returned, so clients can see stale WARN/OK event-loop diagnostics for up to the cache window instead of the field disappearing as before. This is a behavior regression introduced by the conditional spread and can mislead status/health consumers.
Useful? React with 👍 / 👎.
|
Landed via rebase onto
Thanks @bzelones! Re-review progress:
|
Summary
openclaw health,openclaw status,openclaw status --json, andopenclaw gateway statuswarnings without changing liveness semantics.Fixes #79599.
Real behavior proof
Behavior addressed: Gateway model-pricing catalog/bootstrap failures should be visible in health/status as degraded model-pricing state while Gateway liveness remains healthy.
Real setup tested: Local foreground OpenClaw Gateway on macOS using temporary profile
pricing-proof-80277on port19077. Pricing catalog fetches were forced to fail before Gateway startup to simulate the reported upstream/bootstrap failure mode.Exact steps or command run after the patch:
Evidence after fix: Copied live Gateway log and CLI output from that run:
Observed result after fix: The Gateway stayed live with
ok: true, and the health payload exposedmodelPricing.state: "degraded"plus per-sourceopenrouterandlitellmfailure details instead of silently reporting healthy pricing.What was not tested: No additional gaps for this scoped status/health fix; the scheduled-refresh rejection path is covered by the added regression test.
Verification
pnpm test src/gateway/model-pricing-cache.test.ts src/commands/health.test.ts src/gateway/server-methods/server-methods.test.ts src/commands/gateway-status.test.ts src/commands/status.command-report-data.test.ts src/commands/status-json-payload.test.ts src/commands/status.command-sections.test.tspnpm exec oxfmt --check --threads=1 CHANGELOG.md src/gateway/model-pricing-cache-state.ts src/gateway/model-pricing-cache.ts src/commands/health.types.ts src/commands/health.ts src/gateway/server-methods/health.ts src/commands/gateway-status/output.ts src/commands/status-overview-rows.ts src/commands/status-overview-surface.ts src/commands/status-all/format.ts src/commands/status.command-sections.ts src/gateway/model-pricing-cache.test.ts src/commands/health.test.ts src/gateway/server-methods/server-methods.test.ts src/commands/gateway-status.test.ts src/commands/status.command-report-data.test.ts src/commands/status-json-payload.test.tspnpm tsgo:coregit diff --checkOPENCLAW_TESTBOX=0 pnpm check:changedpnpm install --frozen-lockfile --offline --ignore-scriptspnpm test src/plugins/contracts/extension-runtime-dependencies.contract.test.tsNotes
pnpm check:changedfirst attempted to delegate to Testbox becauseOPENCLAW_TESTBOX=1was present in the environment but noOPENCLAW_TESTBOX_IDwas set. The changed-lane planner selected only core/coreTests/docs, so I reran the same gate locally withOPENCLAW_TESTBOX=0; it passed.