Skip to content

Commit e305da7

Browse files
committed
fix(providers): remove unnecessary gh copilot two-token detection
The copilot provider uses a standalone copilot binary, not gh copilot. Removes the two-token subcommand detection block and its corresponding test.
1 parent f0c533f commit e305da7

File tree

1 file changed

+0
-17
lines changed
  • crates/openshell-providers/src

1 file changed

+0
-17
lines changed

crates/openshell-providers/src/lib.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -144,18 +144,6 @@ pub fn normalize_provider_type(input: &str) -> Option<&'static str> {
144144

145145
#[must_use]
146146
pub fn detect_provider_from_command(command: &[String]) -> Option<&'static str> {
147-
// Two-token subcommand patterns (e.g., `gh copilot`)
148-
if command.len() >= 2 {
149-
let first = &command[0];
150-
let basename = Path::new(first)
151-
.file_name()
152-
.and_then(|name| name.to_str())
153-
.unwrap_or(first);
154-
if basename.eq_ignore_ascii_case("gh") && command[1].eq_ignore_ascii_case("copilot") {
155-
return Some("copilot");
156-
}
157-
}
158-
// Single-token detection
159147
let first = command.first()?;
160148
let basename = Path::new(first)
161149
.file_name()
@@ -207,11 +195,6 @@ mod tests {
207195
detect_provider_from_command(&["/usr/local/bin/copilot".to_string()]),
208196
Some("copilot")
209197
);
210-
// gh copilot wrapper
211-
assert_eq!(
212-
detect_provider_from_command(&["gh".to_string(), "copilot".to_string()]),
213-
Some("copilot")
214-
);
215198
// gh alone still maps to github
216199
assert_eq!(
217200
detect_provider_from_command(&["gh".to_string()]),

0 commit comments

Comments
 (0)