feat: add 50KB body size limit to /generate routes #153

Closed
pook wants to merge 2 commits from feat/body-size-limit-generate into main
Owner

Summary

  • Adds Hono bodyLimit middleware (50KB) scoped to /generate/* routes to prevent OOM
  • Returns 413 with JSON error response
  • Other routes unaffected

Closes #70

Changes

  • New: packages/api/src/middleware/body-limit.ts
  • Modified: packages/api/src/index.ts
  • Modified: packages/api/tests/e2e/generate.test.ts

Test plan

  • Run bun test packages/api/tests/e2e/generate.test.ts
  • Verify normal requests still work
## Summary - Adds Hono bodyLimit middleware (50KB) scoped to /generate/* routes to prevent OOM - Returns 413 with JSON error response - Other routes unaffected Closes #70 ## Changes - New: packages/api/src/middleware/body-limit.ts - Modified: packages/api/src/index.ts - Modified: packages/api/tests/e2e/generate.test.ts ## Test plan - Run bun test packages/api/tests/e2e/generate.test.ts - Verify normal requests still work
Prevents OOM attacks by enforcing a 50KB request body limit on all
/generate/* endpoints using Hono's built-in bodyLimit middleware.
Returns 413 with {error: 'payload_too_large', message: 'Request body
must be under 50KB'} when exceeded. Other routes are unaffected.

Closes #70

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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:14 -04:00

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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!153
No description provided.