We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents d422a09 + ac5cbfd commit 92ec892Copy full SHA for 92ec892
1 file changed
crates/but/src/utils/detect_agent.rs
@@ -79,7 +79,11 @@ fn detect_with(lookup: impl Fn(&str) -> Option<OsString>) -> Option<Agent> {
79
if is_set("CURSOR_TRACE_ID") {
80
return Some(Agent::Cursor);
81
}
82
- if is_set("CODEX_SANDBOX") || is_set("CODEX_CI") || is_set("CODEX_THREAD_ID") {
+ if is_set("CODEX_SANDBOX")
83
+ || is_set("CODEX_CI")
84
+ || is_set("CODEX_THREAD_ID")
85
+ || is_set("CODEX_SHELL")
86
+ {
87
return Some(Agent::Codex);
88
89
if is_set("GEMINI_CLI") {
@@ -188,6 +192,14 @@ mod tests {
188
192
);
189
193
190
194
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
+
191
203
#[test]
204
fn detect_gemini() {
205
assert_eq!(
0 commit comments