Repository navigation
fix(agent): reject webhook body read failures - #20618
Conversation
Signed-off-by: T1mn <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughWebhook request parsing now returns form parsing and body read errors. Tests cover oversized and interrupted reads, confirm failed requests do not start the Agent, and verify that bodies at the 1000-byte limit are accepted. ChangesWebhook Request Read Errors
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to Interrupted JSON requests are rejected without starting the Agent. No issue requiring a fix before merge was identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit checks the webhook stream, Comment |
Signed-off-by: T1mn <[email protected]>
Summary
Follow-up to #18758 and #19089: those changes handle webhook execution failures and interrupted traces; this change rejects incomplete requests before the Agent starts, in the current Go backend.
parseWebhookRequestignores body read and form parsing errors. For an unknown-length request,MaxBytesReadercan report an exceeded limit while the handler still proceeds with a partial or empty payload. A valid JSON prefix followed by a read failure can also be accepted.Validation
gofmtandgit diff --checkpass.bash build.sh --test ./internal/handler/... -run 'TestWebhook|TestParseWebhookRequest' -count=1is blocked by native dependency setup on macOS. The isolated parser check does not cover the handler dispatch tests or replace Linux CI.Thank you for reviewing.