Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2865,6 +2865,14 @@
"null"
]
},
"hostId": {
"default": null,
"description": "The configured exec host, when the command ran outside the local host.",
"type": [
"string",
"null"
]
},
"id": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13127,6 +13127,14 @@
"null"
]
},
"hostId": {
"default": null,
"description": "The configured exec host, when the command ran outside the local host.",
"type": [
"string",
"null"
]
},
"id": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10982,6 +10982,14 @@
"null"
]
},
"hostId": {
"default": null,
"description": "The configured exec host, when the command ran outside the local host.",
"type": [
"string",
"null"
]
},
"id": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,14 @@
"null"
]
},
"hostId": {
"default": null,
"description": "The configured exec host, when the command ran outside the local host.",
"type": [
"string",
"null"
]
},
"id": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,14 @@
"null"
]
},
"hostId": {
"default": null,
"description": "The configured exec host, when the command ran outside the local host.",
"type": [
"string",
"null"
]
},
"id": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,14 @@
"null"
]
},
"hostId": {
"default": null,
"description": "The configured exec host, when the command ran outside the local host.",
"type": [
"string",
"null"
]
},
"id": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1341,6 +1341,14 @@
"null"
]
},
"hostId": {
"default": null,
"description": "The configured exec host, when the command ran outside the local host.",
"type": [
"string",
"null"
]
},
"id": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,14 @@
"null"
]
},
"hostId": {
"default": null,
"description": "The configured exec host, when the command ran outside the local host.",
"type": [
"string",
"null"
]
},
"id": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,14 @@
"null"
]
},
"hostId": {
"default": null,
"description": "The configured exec host, when the command ran outside the local host.",
"type": [
"string",
"null"
]
},
"id": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,14 @@
"null"
]
},
"hostId": {
"default": null,
"description": "The configured exec host, when the command ran outside the local host.",
"type": [
"string",
"null"
]
},
"id": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1341,6 +1341,14 @@
"null"
]
},
"hostId": {
"default": null,
"description": "The configured exec host, when the command ran outside the local host.",
"type": [
"string",
"null"
]
},
"id": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,14 @@
"null"
]
},
"hostId": {
"default": null,
"description": "The configured exec host, when the command ran outside the local host.",
"type": [
"string",
"null"
]
},
"id": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1341,6 +1341,14 @@
"null"
]
},
"hostId": {
"default": null,
"description": "The configured exec host, when the command ran outside the local host.",
"type": [
"string",
"null"
]
},
"id": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,14 @@
"null"
]
},
"hostId": {
"default": null,
"description": "The configured exec host, when the command ran outside the local host.",
"type": [
"string",
"null"
]
},
"id": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,14 @@
"null"
]
},
"hostId": {
"default": null,
"description": "The configured exec host, when the command ran outside the local host.",
"type": [
"string",
"null"
]
},
"id": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,14 @@
"null"
]
},
"hostId": {
"default": null,
"description": "The configured exec host, when the command ran outside the local host.",
"type": [
"string",
"null"
]
},
"id": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,14 @@
"null"
]
},
"hostId": {
"default": null,
"description": "The configured exec host, when the command ran outside the local host.",
"type": [
"string",
"null"
]
},
"id": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,14 @@
"null"
]
},
"hostId": {
"default": null,
"description": "The configured exec host, when the command ran outside the local host.",
"type": [
"string",
"null"
]
},
"id": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ cwd: string,
/**
* Identifier for the underlying PTY process (when available).
*/
processId: string | null, source: CommandExecutionSource, status: CommandExecutionStatus,
processId: string | null,
/**
* The configured exec host, when the command ran outside the local host.
*/
hostId: string | null, source: CommandExecutionSource, status: CommandExecutionStatus,
/**
* A best-effort parsing of the command to understand the action(s) it will perform.
* This returns a list of CommandAction objects because a single shell command may
Expand Down
5 changes: 5 additions & 0 deletions codex-rs/app-server-protocol/src/protocol/item_builders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ pub fn build_command_execution_approval_request_item(
command: shlex_join(&payload.command),
cwd: payload.cwd.clone(),
process_id: None,
host_id: None,
source: CommandExecutionSource::Agent,
status: CommandExecutionStatus::InProgress,
command_actions: payload
Expand All @@ -91,6 +92,7 @@ pub fn build_command_execution_begin_item(payload: &ExecCommandBeginEvent) -> Th
command: shlex_join(&payload.command),
cwd: payload.cwd.clone(),
process_id: payload.process_id.clone(),
host_id: payload.host_id.clone(),
source: payload.source.into(),
status: CommandExecutionStatus::InProgress,
command_actions: payload
Expand Down Expand Up @@ -118,6 +120,7 @@ pub fn build_command_execution_end_item(payload: &ExecCommandEndEvent) -> Thread
command: shlex_join(&payload.command),
cwd: payload.cwd.clone(),
process_id: payload.process_id.clone(),
host_id: payload.host_id.clone(),
source: payload.source.into(),
status: (&payload.status).into(),
command_actions: payload
Expand Down Expand Up @@ -151,6 +154,7 @@ pub fn build_item_from_guardian_event(
command,
cwd: cwd.clone(),
process_id: None,
host_id: None,
source: CommandExecutionSource::Agent,
status,
command_actions,
Expand Down Expand Up @@ -183,6 +187,7 @@ pub fn build_item_from_guardian_event(
command,
cwd: cwd.clone(),
process_id: None,
host_id: None,
source: CommandExecutionSource::Agent,
status,
command_actions,
Expand Down
9 changes: 9 additions & 0 deletions codex-rs/app-server-protocol/src/protocol/thread_history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1790,6 +1790,7 @@ mod tests {
cmd: "echo hello world".into(),
}],
source: ExecCommandSource::Agent,
host_id: None,
interaction_input: None,
stdout: String::new(),
stderr: String::new(),
Expand Down Expand Up @@ -1836,6 +1837,7 @@ mod tests {
command: "echo 'hello world'".into(),
cwd: PathBuf::from("/tmp"),
process_id: Some("pid-1".into()),
host_id: None,
source: CommandExecutionSource::Agent,
status: CommandExecutionStatus::Completed,
command_actions: vec![CommandAction::Unknown {
Expand Down Expand Up @@ -2007,6 +2009,7 @@ mod tests {
cwd: PathBuf::from("/tmp"),
parsed_cmd: vec![ParsedCommand::Unknown { cmd: "ls".into() }],
source: ExecCommandSource::Agent,
host_id: None,
interaction_input: None,
stdout: String::new(),
stderr: "exec command rejected by user".into(),
Expand Down Expand Up @@ -2048,6 +2051,7 @@ mod tests {
command: "ls".into(),
cwd: PathBuf::from("/tmp"),
process_id: Some("pid-2".into()),
host_id: None,
source: CommandExecutionSource::Agent,
status: CommandExecutionStatus::Declined,
command_actions: vec![CommandAction::Unknown {
Expand Down Expand Up @@ -2133,6 +2137,7 @@ mod tests {
command: "rm -rf /tmp/guardian".into(),
cwd: PathBuf::from("/tmp"),
process_id: None,
host_id: None,
source: CommandExecutionSource::Agent,
status: CommandExecutionStatus::Declined,
command_actions: vec![CommandAction::Unknown {
Expand Down Expand Up @@ -2192,6 +2197,7 @@ mod tests {
command: "/bin/rm -f /tmp/file.sqlite".into(),
cwd: PathBuf::from("/tmp"),
process_id: None,
host_id: None,
source: CommandExecutionSource::Agent,
status: CommandExecutionStatus::InProgress,
command_actions: vec![CommandAction::Unknown {
Expand Down Expand Up @@ -2247,6 +2253,7 @@ mod tests {
cmd: "echo done".into(),
}],
source: ExecCommandSource::Agent,
host_id: None,
interaction_input: None,
stdout: "done\n".into(),
stderr: String::new(),
Expand Down Expand Up @@ -2281,6 +2288,7 @@ mod tests {
command: "echo done".into(),
cwd: PathBuf::from("/tmp"),
process_id: Some("pid-42".into()),
host_id: None,
source: CommandExecutionSource::Agent,
status: CommandExecutionStatus::Completed,
command_actions: vec![CommandAction::Unknown {
Expand Down Expand Up @@ -2336,6 +2344,7 @@ mod tests {
cmd: "echo done".into(),
}],
source: ExecCommandSource::Agent,
host_id: None,
interaction_input: None,
stdout: "done\n".into(),
stderr: String::new(),
Expand Down
Loading
Loading