mirror of
https://github.com/openai/codex.git
synced 2026-05-03 10:56:37 +00:00
Split DeveloperInstructions into individual fragments. (#18813)
Split DeveloperInstructions into individual fragments.
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
use anyhow::Result;
|
||||
use codex_core::ForkSnapshot;
|
||||
use codex_core::config::Constrained;
|
||||
use codex_execpolicy::Policy;
|
||||
use codex_protocol::models::DeveloperInstructions;
|
||||
use codex_core::context::ContextualUserFragment;
|
||||
use codex_core::context::PermissionsInstructions;
|
||||
use codex_core::load_exec_policy;
|
||||
use codex_protocol::protocol::AskForApproval;
|
||||
use codex_protocol::protocol::EventMsg;
|
||||
use codex_protocol::protocol::Op;
|
||||
@@ -548,18 +549,18 @@ async fn permissions_message_includes_writable_roots() -> Result<()> {
|
||||
wait_for_event(&test.codex, |ev| matches!(ev, EventMsg::TurnComplete(_))).await;
|
||||
|
||||
let permissions = permissions_texts(&req.single_request());
|
||||
let expected = DeveloperInstructions::from_policy(
|
||||
let normalize_line_endings = |s: &str| s.replace("\r\n", "\n");
|
||||
let exec_policy = load_exec_policy(&test.config.config_layer_stack).await?;
|
||||
let expected = PermissionsInstructions::from_policy(
|
||||
&sandbox_policy,
|
||||
AskForApproval::OnRequest,
|
||||
test.config.approvals_reviewer,
|
||||
&Policy::empty(),
|
||||
&exec_policy,
|
||||
test.config.cwd.as_path(),
|
||||
/*exec_permission_approvals_enabled*/ false,
|
||||
/*request_permissions_tool_enabled*/ false,
|
||||
)
|
||||
.into_text();
|
||||
// Normalize line endings to handle Windows vs Unix differences
|
||||
let normalize_line_endings = |s: &str| s.replace("\r\n", "\n");
|
||||
.render();
|
||||
let expected_normalized = normalize_line_endings(&expected);
|
||||
let actual_normalized: Vec<String> = permissions
|
||||
.iter()
|
||||
|
||||
Reference in New Issue
Block a user