{"record":{"id":"abae6a7702c61d9d","repo":"router-for-me/CLIProxyAPI","slug":"credential-concurrency-busy-retry-max-must-not-be","errorCode":null,"errorMessage":"credential concurrency busy retry max must not be less than busy retry min","messagePattern":"credential concurrency busy retry max must not be less than busy retry min","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/config/credential_concurrency.go","lineNumber":162,"sourceCode":"\t\treturn fmt.Errorf(\"lifecycle configuration revision must be positive when present\")\n\t}\n\tif cfg.ObservationBarrierRevision < 0 {\n\t\treturn fmt.Errorf(\"observation barrier revision must not be negative\")\n\t}\n\tif cfg.CPAHeartbeatTimeout <= 0 || cfg.CPACancelBound <= 0 || cfg.ReclaimGrace <= 0 || cfg.CleanupInterval <= 0 {\n\t\treturn fmt.Errorf(\"credential concurrency lifecycle durations must be positive\")\n\t}\n\tif cfg.ReleaseFlushInterval <= 0 || cfg.ReleaseMaxBackoff <= 0 || cfg.BusyRetryMin <= 0 || cfg.BusyRetryMax <= 0 {\n\t\treturn fmt.Errorf(\"credential concurrency limiter durations must be positive\")\n\t}\n\tif cfg.ReleaseMaxBackoff < cfg.ReleaseFlushInterval {\n\t\treturn fmt.Errorf(\"credential concurrency release max backoff must not be less than release flush interval\")\n\t}\n\tif cfg.BusyRetryMin%time.Millisecond != 0 || cfg.BusyRetryMax%time.Millisecond != 0 {\n\t\treturn fmt.Errorf(\"credential concurrency busy retry durations must be whole milliseconds\")\n\t}\n\tif cfg.BusyRetryMax < cfg.BusyRetryMin {\n\t\treturn fmt.Errorf(\"credential concurrency busy retry max must not be less than busy retry min\")\n\t}\n\tif cfg.MaxLimit < 1 || cfg.MaxLimit > maxCredentialConcurrencyLimit {\n\t\treturn fmt.Errorf(\"credential concurrency max limit must be between 1 and %d\", maxCredentialConcurrencyLimit)\n\t}\n\treturn nil\n}\n\n// ValidateCredentialConcurrencyLifecycle verifies the Home lifecycle timing safety invariant.\nfunc ValidateCredentialConcurrencyLifecycle(nodeHeartbeatTimeout time.Duration, cfg CredentialConcurrencyConfig) error {\n\tif nodeHeartbeatTimeout <= 0 {\n\t\treturn fmt.Errorf(\"credential concurrency lifecycle durations must be positive\")\n\t}\n\tif errValidate := ValidateCredentialConcurrency(cfg); errValidate != nil {\n\t\treturn errValidate\n\t}\n\tleft, leftOverflow := addCredentialConcurrencyDuration(nodeHeartbeatTimeout, cfg.ReclaimGrace)\n\tright, rightOverflow := addCredentialConcurrencyDuration(cfg.CPAHeartbeatTimeout, cfg.CPACancelBound)\n\tif leftOverflow || rightOverflow {","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/config/credential_concurrency.go#L144-L180","documentation":"ValidateCredentialConcurrency requires busy-retry-max >= busy-retry-min. The busy-retry window is [min, max]; an inverted window would make the retry scheduler's interval empty or negative, so the configuration is rejected.","triggerScenarios":"config.yaml with 'credential-concurrency:\\n  busy-retry-min: 1s\\n  busy-retry-max: 250ms' — max numerically smaller than min.","commonSituations":"Copying the example and editing only one of the two values; assuming min/max naming was the other way around; scripted config generation sorting values incorrectly.","solutions":["Swap or re-edit so busy-retry-max >= busy-retry-min (e.g. min 250ms, max 1s).","If you intended a tight fixed window, set both to the same whole-millisecond value.","Re-validate the whole block; the sibling positivity and millisecond checks still apply."],"exampleFix":"# before (config.yaml)\ncredential-concurrency:\n  busy-retry-min: 1s\n  busy-retry-max: 250ms\n\n# after\ncredential-concurrency:\n  busy-retry-min: 250ms\n  busy-retry-max: 1s","handlingStrategy":"validation","validationCode":"// Go: retry window must be ordered.\nif cfg.BusyRetryMax < cfg.BusyRetryMin {\n    return errors.New(\"busy-retry-max must be >= busy-retry-min\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Edit min and max together; they form a window.","For a fixed window set both to the same value."],"tags":["config","validation","credential-concurrency","retry"],"backgroundTag":null,"analyzedSha":"78f0c4079e3e6273d65d03b5549cffc898703264","analyzedAt":"2026-08-15T12:26:37.444Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}