mirror of
https://github.com/openai/codex.git
synced 2026-04-30 19:32:04 +03:00
feat(core) Smart approvals on (#10286)
## Summary Turn on Smart Approvals by default ## Testing - [x] Updated unit tests
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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(())
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user