fix(gateway): defer pricing refresh until ready

This commit is contained in:
Peter Steinberger
2026-05-02 11:07:44 +01:00
parent f3fd0eedff
commit 0e8bd8e75c
6 changed files with 87 additions and 58 deletions

View File

@@ -74,10 +74,10 @@ The `models` root also owns global model-catalog behavior.
- `models.mode`: provider catalog behavior (`merge` or `replace`).
- `models.providers`: custom provider map keyed by provider id.
- `models.pricing.enabled`: controls the background pricing bootstrap. When
`false`, Gateway startup skips OpenRouter and LiteLLM pricing-catalog fetches;
configured `models.providers.*.models[].cost` values still work for local cost
estimates.
- `models.pricing.enabled`: controls the background pricing bootstrap that
starts after sidecars and channels reach the Gateway ready path. When `false`,
the Gateway skips OpenRouter and LiteLLM pricing-catalog fetches; configured
`models.providers.*.models[].cost` values still work for local cost estimates.
## MCP

View File

@@ -120,12 +120,13 @@ These are **USD per 1M tokens** for `input`, `output`, `cacheRead`, and
`cacheWrite`. If pricing is missing, OpenClaw shows tokens only. OAuth tokens
never show dollar cost.
Gateway startup also performs an optional background pricing bootstrap for
configured model refs that do not already have local pricing. That bootstrap
fetches remote OpenRouter and LiteLLM pricing catalogs. Set
`models.pricing.enabled: false` to skip those startup catalog fetches on offline
or restricted networks; explicit `models.providers.*.models[].cost` entries
continue to drive local cost estimates.
After sidecars and channels reach the Gateway ready path, OpenClaw starts an
optional background pricing bootstrap for configured model refs that do not
already have local pricing. That bootstrap fetches remote OpenRouter and LiteLLM
pricing catalogs. Set `models.pricing.enabled: false` to skip those catalog
fetches on offline or restricted networks; explicit
`models.providers.*.models[].cost` entries continue to drive local cost
estimates.
## Cache TTL and pruning impact