Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

feat(core) Smart approvals on (#10286)

Dylan Hurda8c9e386e723
diff --git a/codex-rs/core/src/features.rs b/codex-rs/core/src/features.rs
index 934ab1c0ba..3d351172fe 100644
--- a/codex-rs/core/src/features.rs
+++ b/codex-rs/core/src/features.rs
@@ -464,12 +464,8 @@ pub const FEATURES: &[FeatureSpec] = &[
FeatureSpec {
id: Feature::RequestRule,
key: "request_rule",
- stage: Stage::Experimental {
- name: "Smart approvals",
- menu_description: "Get smarter \"Don't ask again\" rule requests.",
- announcement: "NEW: Try Smart approvals to get smarter \"Don't ask again\" requests. Enable in /experimental!",
- },
- default_enabled: false,
+ stage: Stage::Stable,
+ default_enabled: true,
},
FeatureSpec {
id: Feature::WindowsSandbox,
diff --git a/codex-rs/core/src/tools/spec.rs b/codex-rs/core/src/tools/spec.rs
index bf3b7b4b25..a51372b9b3 100644
--- a/codex-rs/core/src/tools/spec.rs
+++ b/codex-rs/core/src/tools/spec.rs
@@ -1576,7 +1576,7 @@ mod tests {
// Build expected from the same helpers used by the builder.
let mut expected: BTreeMap<String, ToolSpec> = BTreeMap::from([]);
for spec in [
- create_exec_command_tool(false),
+ create_exec_command_tool(true),
create_write_stdin_tool(),
create_list_mcp_resources_tool(),
create_list_mcp_resource_templates_tool(),
@@ -2410,7 +2410,7 @@ mod tests {
#[test]
fn test_shell_tool() {
- let tool = super::create_shell_tool(false);
+ let tool = super::create_shell_tool(true);
let ToolSpec::Function(ResponsesApiTool {
description, name, ..
}) = &tool
@@ -2440,7 +2440,7 @@ Examples of valid command strings:
#[test]
fn test_shell_command_tool() {
- let tool = super::create_shell_command_tool(false);
+ let tool = super::create_shell_command_tool(true);
let ToolSpec::Function(ResponsesApiTool {
description, name, ..
}) = &tool
diff --git a/codex-rs/core/tests/suite/client.rs b/codex-rs/core/tests/suite/client.rs
index 150513d000..439233d8af 100644
--- a/codex-rs/core/tests/suite/client.rs
+++ b/codex-rs/core/tests/suite/client.rs
@@ -320,7 +320,7 @@ async fn resume_includes_initial_messages_and_sends_prior_items() {
.expect("prior assistant message");
let pos_permissions = messages
.iter()
- .position(|(role, text)| role == "developer" && text.contains("`approval_policy`"))
+ .position(|(role, text)| role == "developer" && text.contains("<permissions instructions>"))
.expect("permissions message");
let pos_user_instructions = messages
.iter()
diff --git a/codex-rs/core/tests/suite/collaboration_instructions.rs b/codex-rs/core/tests/suite/collaboration_instructions.rs
index 0f492d78c9..7a311b4bf1 100644
--- a/codex-rs/core/tests/suite/collaboration_instructions.rs
+++ b/codex-rs/core/tests/suite/collaboration_instructions.rs
@@ -83,7 +83,7 @@ async fn no_collaboration_instructions_by_default() -> Result<()> {
let input = req.single_request().input();
let dev_texts = developer_texts(&input);
assert_eq!(dev_texts.len(), 1);
- assert!(dev_texts[0].contains("`approval_policy`"));
+ assert!(dev_texts[0].contains("<permissions instructions>"));
Ok(())
}
diff --git a/codex-rs/core/tests/suite/permissions_messages.rs b/codex-rs/core/tests/suite/permissions_messages.rs
index e4eded15ff..b500689ef6 100644
--- a/codex-rs/core/tests/suite/permissions_messages.rs
+++ b/codex-rs/core/tests/suite/permissions_messages.rs
@@ -34,7 +34,7 @@ fn permissions_texts(input: &[serde_json::Value]) -> Vec<String> {
.first()?
.get("text")?
.as_str()?;
- if text.contains("`approval_policy`") {
+ if text.contains("<permissions instructions>") {
Some(text.to_string())
} else {
None
@@ -439,7 +439,7 @@ async fn permissions_message_includes_writable_roots() -> Result<()> {
&sandbox_policy,
AskForApproval::OnRequest,
&Policy::empty(),
- false,
+ true,
test.config.cwd.as_path(),
)
.into_text();