Repository navigation
feat(playground): basic in-memory rate limiting to prevent runaway loops (#181) - #229
Conversation
|
🎉 Thanks for your first pull request to |
PR Summary by QodoAdd per-client rate limiting to Playground execution endpoints
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
|
Hi! I've pushed the follow-up fix for PR #229 (\3aa4e9e) addressing the Ruff E402 errors. The repository-wide lint and formatting checks pass locally with the pinned Ruff 0.15.10, and the relevant test suites pass. GitHub Actions run 40067553312 is currently marked \�ction_required. Could you please approve and run the workflow when convenient? Thanks! |
What does this PR do?
Implements configurable, in-memory sliding-window rate limiting for the CrewAI Playground to prevent runaway execution loops (#181).
Changes
playground/rate_limiter.py./run,/run/stream, and/run/wsinplayground/main.py.PLAYGROUND_RATE_LIMIT, defaulting to30/5min; setting it to0disables rate limiting.Retry-Afterheader and a descriptive JSON error for rejected HTTP requests.1008)./recipes) and static asset routes unaffected.Related issue
Closes #181
Type of change
Checklist
ruff checkandruff format --checkpass locallyREADME.md(inputs, outputs, sample run).env.examplelists all required variables with placeholder values (no real keys)Verification & Sample output
Test Results
pytest -v test_rate_limiter.py)pytest -v)pytest tests/test_recipe_contract.py -v)recipes/,playground/,tools/,tests/(ruff==0.15.10)ruff==0.15.10)Note: Verified with repository-pinned
ruff==0.15.10matching CI (.github/workflows/ci.yml:43andrequirements-dev.txt:2). All repository files pass cleanly.Sample Test Output