wso2 / wso2/api-platform

Token Based Rate limit policy failing when all optional parameters are not configured

Open
#1,230 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area/AIPolicies Area/Policies Aspect/API Severity/Major Type/Bug
Dominant language
Go
Stars
71
Forks
111
Avg merge
1d 14h
Merged PRs (30d)
110

Description

Please select the area the issue is related to

Area/Policies (Policies, Policy Hub, Policy Engine etc)

Please select the aspect the issue is related to

Aspect/API (API backends, definitions, contracts, interfaces, OpenAPI)

Description

When the token based rate limit policy is configured with only one of the following optional parameters

Image

The policy initialises successfully but fails at runtime when trying to delegate to advanced-ratelimit

Steps to Reproduce
  1. Deploy a selfhosted ai-gateway with debug logs enabled for router, controller and polcy-engine
  2. Deploy an OpenAI LLM provider
  3. Add Token Based Ratelimit policy to the provider with only promptTokenLimits set
  4. Save and redeploy the LLM provider
  5. Notice the logs in the gateway, the policy chain would have successfully been updated
  6. Make an api call to the provider
  7. Notice the error logs in console
Image
Severity Level of the Issue

Severity/Major (Important functionality is broken. Should be prioritized. Doesn't need immediate attention)

Environment Details (with versions)

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with the Token Based Ratelimit policy configured with only promptTokenLimits, using the described self-hosted AI gateway setup and debug logs. Inspect the policy's delegation to advanced-ratelimit; done means the policy runs successfully at request time when optional parameters are omitted.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.