fix: limit control prompt request body#2122
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
jolestar
commented
Jul 6, 2026
jolestar
left a comment
Collaborator
Author
There was a problem hiding this comment.
Review: PR #2122 — fix: limit control prompt request body
✅ LGTM — 简洁有效的安全加固。
审查要点
- Body limit 设置 — 32MB 对 control prompt 合理(远大于 callback 的 256KB,但仍有上限防护)。
- 错误处理 — 返回 413 Payload Too Large,语义准确。
- 代码组织 — 常量和检查位置合理,与现有 callback body limit 保持一致的模式。
✅ 可以合并。
Contributor
There was a problem hiding this comment.
Review: PR #2122 — fix: limit control prompt request body
✅ LGTM — Clean, focused security hardening that follows the established CALLBACK_BODY_LIMIT_BYTES pattern.
Assessment
- Correctness —
DefaultBodyLimit::max()at the route level rejects oversized bodies before theJsonextractor. Correct placement, matches the callback route pattern. - Limit choice — 32 MB is reasonable for prompts with attachments, and explicitly documented as a constant.
- Test — Regression test correctly validates the 413 response path.
Follow-up suggestion
/control/agents/{agent_id}/debug-prompt (line 468) accepts POST bodies without an explicit DefaultBodyLimit — the same gap this PR closes for control_prompt. Not a blocker, but worth addressing in a follow-up to close the surface on all body-accepting control routes.
💡 The test allocates ~33 MB in a single String. Acceptable; if CI memory is a concern, 32 * 1024 * 1024 + 1 bytes would suffice.
Contributor
Holon Run Report
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Verification