[WRONG BRANCH] fix(server): bound Claude Desktop apply bodies - #48
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
Next review available in: 58 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
Comment |
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Its title has been prefixed with |
Motivation
POST /api/claude-desktop/applywithreq.text()-style parsing. This restores the management-plane 4 MiB guard and avoids resource-exhaustion risk.Description
req.text()+JSON.parsein thePOST /api/claude-desktop/applyhandler with a bounded reader that enforcesMANAGEMENT_JSON_BODY_MAX_BYTESand treats an empty body as{}for back-compat by callingreadOptionalManagementJsonBodyinsrc/server/management/agent-settings-routes.ts.readOptionalManagementJsonBodytosrc/server/management/body.tswhich delegates to the existingreadBoundedJsonRequestBodywith an empty-body fallback of{}.readBoundedJsonRequestBodyinsrc/server/request-decompress.tsto accept anoptions.emptyBodyFallbackhook and to return it for empty bodies after decompression and size checks.DecompressedBodyTooLargeErrorhandling so oversized or decompressed-oversize inputs map to the existing 413 management response path and preserved existing 400 behavior for malformed JSON.tests/claude-management-api.test.tscovering malformed JSON and a gzip-compressed request whose decompressed size exceeds the management limit.Testing
bun test tests/claude-management-api.test.ts, which passed (claude-management tests including new cases succeeded).bun run typecheck(bun x tsc --noEmit), which passed.bun run privacy:scan, which passed.bun run testduring iteration and observed a prior unrelatedtests/cli-help.test.tsexpectation failure in Docker-mode output; that failure is unrelated to the management-body change and did not affect the focused claude-management tests.Codex Task