Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

fix: when displaying execv, show file instead of arg0 (#6966)

Michael Bolin54e6e4ac325c
diff --git a/codex-rs/exec-server/src/posix/mcp_escalation_policy.rs b/codex-rs/exec-server/src/posix/mcp_escalation_policy.rs
index 39958bb4f9..069948ea06 100644
--- a/codex-rs/exec-server/src/posix/mcp_escalation_policy.rs
+++ b/codex-rs/exec-server/src/posix/mcp_escalation_policy.rs
@@ -43,12 +43,17 @@ impl McpEscalationPolicy {
async fn prompt(
&self,
- _file: &Path,
+ file: &Path,
argv: &[String],
workdir: &Path,
context: RequestContext<RoleServer>,
) -> Result<CreateElicitationResult, McpError> {
- let command = shlex::try_join(argv.iter().map(String::as_str)).unwrap_or_default();
+ let args = shlex::try_join(argv.iter().skip(1).map(String::as_str)).unwrap_or_default();
+ let command = if args.is_empty() {
+ file.display().to_string()
+ } else {
+ format!("{} {}", file.display(), args)
+ };
context
.peer
.create_elicitation(CreateElicitationRequestParam {