Repository navigation
Conversation
…settings schema (cheaper-inference#18390) The strict resilience schemas omitted two keys the normalizers read. requestQueueSettingsSchema had no globalConcurrentRequests, so every save of the Request Queue card (which always posts it) was rejected as an unrecognized key. waitForCooldownSettingsSchema had no budgetMs. cheaper-inference#11493 added the global gate to the legacy defaults schema instead of the requestQueue schema, and the legacy patch mapper never forwarded it. Add both keys with the normalizer bounds and map the legacy key. Closes cheaper-inference#18390
…per (cheaper-inference#18390) Mapping globalConcurrentRequests pushed normalizeLegacyPatch to 83 lines and complexity 16, so the complexity ratchet saw route.ts go from 2 to 4 violations. The four requestQueue ternaries now live in buildLegacyRequestQueuePatch, unchanged, and route.ts is back to the two pre-existing PATCH violations. No behavior change.
Contributor
Author
|
Pushed one small commit to bring |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Settings > Resilience > Request Queue could not be saved. The card always posts
requestQueue.globalConcurrentRequests, and the strictrequestQueueSettingsSchemadid not list that key, soPATCH /api/resilienceanswered every save with a validation error (Unrecognized key: globalConcurrentRequests) and nothing in the section persisted (requests per minute, min time between requests, concurrency, queue wait, execution timeout, queue depth).legacyResilienceDefaultsSchema(the legacydefaultsblock) instead ofrequestQueueSettingsSchema. The legacy patch mapper never forwarded that key either, so it was accepted there and silently dropped.requestQueueSettingsSchemanow acceptsglobalConcurrentRequestsas an integer from 0 to 100000, the same bounds asnormalizeRequestQueueSettings. 0 keeps meaning "global gate disabled".waitForCooldownSettingsSchemanow acceptsbudgetMsas an integer from 0 to 300000, the ceiling ofnormalizeWaitForCooldownSettings. Values belowmaxRetryWaitSec * 1000are still raised to that floor by the normalizer, as before.defaults.globalConcurrentRequestskey is now mapped torequestQueue.globalConcurrentRequestsinstead of being dropped.resilienceSettings), the defaults and the GET response shape are unchanged. A saved non-zeroglobalConcurrentRequestsnow reaches the global gate inexecuteProviderRequest, and a legacy client that sendsdefaults.globalConcurrentRequestsnow changes it too.Related Issues
Target Branch
release/v3.8.53branch (the highest openrelease/v*), notmainValidation
tests/unit/resilience-request-queue-schema-18390.test.ts(10 pass), plus every unit file that importsupdateResilienceSchemaor the resilience route (10 files, 78 pass)8a8c64ee33)Tests Added Or Updated
tests/unit/resilience-request-queue-schema-18390.test.ts(new):globalConcurrentRequestsat 0, 1, 64 and 100000, and the whole Request Queue card payload; rejects -1, 100001, 1.5, a string and a misspelled key.waitForCooldown.budgetMsat 0, 30000 and 300000; rejects -1, 300001 and 1000.5.GETandPATCHhandlers on an isolated data dir: the card payload built fromGETsaves with status 200 and reads back; the legacydefaults.globalConcurrentRequestskey is applied;budgetMsis stored and floored at the single wait cap; an out-of-range value gets a 400.Coverage Notes
src/app/api/resilience/route.tsare covered by the new test. Ten mutants were all killed: dropping either schema key, dropping the legacy mapping, removing the min, max or integer constraint onglobalConcurrentRequests, raising its minimum to 1, and removing the max or min ofbudgetMsor raising its minimum to 1.Reviewer Notes
waitForCooldown.budgetMs(the GET response and the card omit it), so that half of the fix only matters for API and CLI callers. It is accepted because the normalizer already reads and stores it, matchingcomboCooldownWait.budgetMs.globalConcurrentRequestshas no upper bound, so typing a value above 100000 now gets a 400 that names the field.