mirror of
https://github.com/openai/codex.git
synced 2026-04-29 19:03:02 +03:00
fix(core) default RejectConfig.request_permissions (#14165)
## Summary Adds a default here so existing config deserializes ## Testing - [x] Added a unit test
This commit is contained in:
@@ -527,6 +527,7 @@ pub struct RejectConfig {
|
||||
/// Reject prompts triggered by execpolicy `prompt` rules.
|
||||
pub rules: bool,
|
||||
/// Reject approval prompts related to built-in permission requests.
|
||||
#[serde(default)]
|
||||
pub request_permissions: bool,
|
||||
/// Reject MCP elicitation prompts.
|
||||
pub mcp_elicitations: bool,
|
||||
@@ -3487,6 +3488,26 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn reject_config_defaults_missing_request_permissions_to_false() {
|
||||
let decoded = serde_json::from_value::<RejectConfig>(serde_json::json!({
|
||||
"sandbox_approval": true,
|
||||
"rules": false,
|
||||
"mcp_elicitations": true,
|
||||
}))
|
||||
.expect("legacy reject config should deserialize");
|
||||
|
||||
assert_eq!(
|
||||
decoded,
|
||||
RejectConfig {
|
||||
sandbox_approval: true,
|
||||
rules: false,
|
||||
request_permissions: false,
|
||||
mcp_elicitations: true,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn workspace_write_restricted_read_access_includes_effective_writable_roots() {
|
||||
let cwd = if cfg!(windows) {
|
||||
|
||||
Reference in New Issue
Block a user