Skip to content

Commit 92ec892

Browse files
authored
Merge pull request #13743 from gitbutlerapp/kv-branch-122
feat: add CODEX_SHELL detection for Codex agent
2 parents d422a09 + ac5cbfd commit 92ec892

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

crates/but/src/utils/detect_agent.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ fn detect_with(lookup: impl Fn(&str) -> Option<OsString>) -> Option<Agent> {
7979
if is_set("CURSOR_TRACE_ID") {
8080
return Some(Agent::Cursor);
8181
}
82-
if is_set("CODEX_SANDBOX") || is_set("CODEX_CI") || is_set("CODEX_THREAD_ID") {
82+
if is_set("CODEX_SANDBOX")
83+
|| is_set("CODEX_CI")
84+
|| is_set("CODEX_THREAD_ID")
85+
|| is_set("CODEX_SHELL")
86+
{
8387
return Some(Agent::Codex);
8488
}
8589
if is_set("GEMINI_CLI") {
@@ -188,6 +192,14 @@ mod tests {
188192
);
189193
}
190194

195+
#[test]
196+
fn detect_codex_shell() {
197+
assert_eq!(
198+
detect_with(env_from(&[("CODEX_SHELL", "1")])),
199+
Some(Agent::Codex),
200+
);
201+
}
202+
191203
#[test]
192204
fn detect_gemini() {
193205
assert_eq!(

0 commit comments

Comments
 (0)