Raise Guardian's action review limit to 200,000 bytes (#44060)

## What changed

Increase `GUARDIAN_MAX_ACTION_BYTES` from 8,000 to 200,000 bytes to allow larger actions to be reviewed. Keep unified exec stdin approvals capped at 8,000 bytes with a separate `MAX_STDIN_APPROVAL_BYTES` constant.

## Testing

Update aggregate payload rejection coverage for the new limit and exercise MCP elicitation reviews with tool descriptions exceeding the previous 8,000-byte limit.

GitOrigin-RevId: fd4b97980803a7a687449043931e6f1e57e260d3
This commit is contained in:
Won Park authored and copyberry committed 2026-09-09 05:07:22 +00:00
1 parent 1bfd383890
commit 3d3df0a0ca
4 files changed
+7 -6

No files matched your search

+1 -1
View File
@@ -67,7 +67,7 @@ const GUARDIAN_MAX_TOOL_ENTRY_TOKENS: usize = codex_guardian_context::ContextPro
.tool_tokens;
pub(crate) const GUARDIAN_MAX_ROOT_MESSAGE_TOKENS: usize = 900;
pub(crate) const GUARDIAN_MAX_NODE_REPL_TOOL_RESULT_TOKENS: usize = 6_000;
pub(crate) const GUARDIAN_MAX_ACTION_BYTES: usize = 8_000;
pub(crate) const GUARDIAN_MAX_ACTION_BYTES: usize = 50_000 * 4;
const GUARDIAN_MAX_ACTION_STRING_TOKENS: usize = 16_000;
/// Captures review inputs from the issuing step without retaining its MCP bindings or tool router.
+2 -2
View File
@@ -1238,7 +1238,7 @@ fn guardian_action_formatters_reject_large_aggregate_payloads() {
let action = GuardianApprovalRequest::ApplyPatch {
id: "patch-1".to_string(),
cwd: test_path_buf("/tmp").abs().into(),
files: vec![file; 1_000],
files: vec![file; 20_000],
patch: String::new(),
};
@@ -1250,7 +1250,7 @@ fn guardian_action_formatters_reject_large_aggregate_payloads() {
error
.expect_err("aggregate action should exceed the review limit")
.to_string(),
"Guardian action exceeds the 8000-byte review limit"
"Guardian action exceeds the 200000-byte review limit"
);
}
}