Skip to content

MCP rate limiter RPS and burst env values should have upper caps #2900

Description

@Widthdom

Problem

RateLimiterOptions.FromEnvironment accepts any finite positive CDIDX_MCP_RATE_LIMIT_RPS and CDIDX_MCP_RATE_LIMIT_BURST values. Extremely large values effectively disable throttling and can also make retry timing and token arithmetic unstable under load.

Suggested fix

Add documented upper bounds for both environment overrides, clamp or reject out-of-range values, and expose the effective values in diagnostics where useful.

Evidence

  • src/CodeIndex/Mcp/RateLimiter.cs: RateLimiterOptions.FromEnvironment
  • TryParsePositiveDouble
  • TokenBucket.TryAcquire

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions