[Agent] Issue #170: issue 99 rate limiting on apigenerate ex #172

Closed
pook wants to merge 1 commit from agent-task/170 into main
Owner

Closes #170

Changes

feat: issue #170 issue-99-rate-limiting-on-apigenerate-ex (agent task agent-ta)

Acceptance Criteria

Issue #99 (rate limiting on /api/generate) exists but has no PR and the broader scope may be why. This is a minimal implementation.

Implement:

  1. Install express-rate-limit as a dependency
  2. Create src/middleware/rate-limit.ts with a limiter configured for: windowMs=60000, max=5, standardHeaders=true, legacyHeaders=false
  3. Apply ONLY to POST /api/generate route
  4. Return 429 with JSON body: {error: 'Too many requests', retryAfter: }
  5. Add integration test: send 6 rapid POST requests to /api/generate, assert first 5 return 200/401 (depending on auth), 6th returns 429

Acceptance criteria:

  • 6th request within 60s window gets 429
  • Response includes Retry-After header
  • Other routes are NOT rate-limited
  • Rate limit resets after window expires
  • Test file: tests/rate-limit.test.ts

Generated by CEO Planner (priority: 2)

Tokens: 25 in / 7457 out

Closes #170 ## Changes feat: issue #170 issue-99-rate-limiting-on-apigenerate-ex (agent task agent-ta) ## Acceptance Criteria Issue #99 (rate limiting on /api/generate) exists but has no PR and the broader scope may be why. This is a minimal implementation. Implement: 1. Install express-rate-limit as a dependency 2. Create src/middleware/rate-limit.ts with a limiter configured for: windowMs=60000, max=5, standardHeaders=true, legacyHeaders=false 3. Apply ONLY to POST /api/generate route 4. Return 429 with JSON body: {error: 'Too many requests', retryAfter: <seconds>} 5. Add integration test: send 6 rapid POST requests to /api/generate, assert first 5 return 200/401 (depending on auth), 6th returns 429 Acceptance criteria: - 6th request within 60s window gets 429 - Response includes Retry-After header - Other routes are NOT rate-limited - Rate limit resets after window expires - Test file: tests/rate-limit.test.ts --- *Generated by CEO Planner (priority: 2)* Tokens: 25 in / 7457 out
Author
Owner

Closed 2026-04-10 during pipeline triage.

Merge conflicts with current main were blocking the CEO agent's backlog view. The compliancebot repo had ~60 open PRs and 141 open agent-task issues. CEO couldn't see progress and kept duplicating work due to a git-push race in agent-worker (now fixed — runId threaded through dispatch pipeline for unique branch names).

Reopen / resubmit against current main if the work is still relevant. Shim /shim/ceo route now injects open issues + PRs into the CEO prompt and refuses dispatch when backlog exceeds 20.

Closed 2026-04-10 during pipeline triage. Merge conflicts with current main were blocking the CEO agent's backlog view. The compliancebot repo had ~60 open PRs and 141 open agent-task issues. CEO couldn't see progress and kept duplicating work due to a git-push race in agent-worker (now fixed — runId threaded through dispatch pipeline for unique branch names). Reopen / resubmit against current main if the work is still relevant. Shim `/shim/ceo` route now injects open issues + PRs into the CEO prompt and refuses dispatch when backlog exceeds 20.
pook closed this pull request 2026-04-10 15:08:11 -04:00

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pook/compliancebot!172
No description provided.