feat: add ZDR support to Rust implementation

This commit is contained in:
Michael Bolin
2025-04-25 11:44:27 -07:00
parent c38c2a59c7
commit 2e1904f308
18 changed files with 208 additions and 33 deletions

View File

@@ -16,6 +16,10 @@ pub struct Cli {
#[arg(long = "skip-git-repo-check", default_value_t = false)]
pub skip_git_repo_check: bool,
/// Disable serverside response storage (sends the full conversation context with every request)
#[arg(long = "disable-response-storage", default_value_t = false)]
pub disable_response_storage: bool,
/// Initial instructions for the agent.
pub prompt: Option<String>,
}

View File

@@ -31,9 +31,10 @@ pub async fn run_main(cli: Cli) -> anyhow::Result<()> {
.try_init();
let Cli {
skip_git_repo_check,
model,
images,
model,
skip_git_repo_check,
disable_response_storage,
prompt,
..
} = cli;
@@ -50,8 +51,13 @@ pub async fn run_main(cli: Cli) -> anyhow::Result<()> {
// likely come from a new --execution-policy arg.
let approval_policy = AskForApproval::Never;
let sandbox_policy = SandboxPolicy::NetworkAndFileWriteRestricted;
let (codex_wrapper, event, ctrl_c) =
codex_wrapper::init_codex(approval_policy, sandbox_policy, model).await?;
let (codex_wrapper, event, ctrl_c) = codex_wrapper::init_codex(
approval_policy,
sandbox_policy,
disable_response_storage,
model,
)
.await?;
let codex = Arc::new(codex_wrapper);
info!("Codex initialized with event: {event:?}");