github / github/copilot-cli

Fails with "posix_spawnp failed" and then misdiagnoses command as missing

Ouverte
#2,736 3 commentaires 6 réactions 0 personnes assignées Voir sur GitHub
area:tools
Langage dominant
Shell
Étoiles
11.2k
Forks
1.9k
Merge moyen
14 h 16 min
PR mergées (30 j)
6

Description

### Describe the bug

GitHub Copilot CLI fails to launch a shell command with:

``

After that, the agent may incorrectly conclude that the command is not installed or not on `PATH`, even when the command exists and runs normally outside Copilot.

### Environment

- Copilot CLI: `1.0.27`
- macOS: `26.4` (`25E246`)
- Architecture: `arm64`
- Terminal: Reproduced in Ghostty and Terminal app

### Expected behavior

Copilot should either:
- run the shell command successfully, or
- report a shell/process-launch failure without inferring that the command is missing.

It should not translate `posix_spawnp failed` into “command not found” unless it has separately verified that.

### Actual behavior

Copilot returns:
```

```
and then incorrectly infers that the command is unavailable or not on PATH.

### Reproduction

Prompt used:
```
Run exactly: command -v teamcity && teamcity auth status. Do not explain, just use the shell tool and report the result.
```
### Observed results

#### 1. Direct shell outside Copilot

This succeeds:
```
command -v teamcity && teamcity auth status
```
Output begins with:

/opt/homebrew/bin/teamcity

and the authentication status is reported correctly.

#### 2. Copilot non-interactive without broad approval

Command:
```
copilot -p "Run exactly: command -v teamcity && teamcity auth status. Do not explain, just use the shell tool and report the result."
```
Result:

Permission denied and could not request permission from user

That is understandable for non-interactive permissions.

#### 3. Copilot non-interactive with broad approval

Command:
```
copilot -p "Run exactly: command -v teamcity && teamcity auth status. Do not explain, just use the shell tool and report the result." --allow-all-tools
```
Result:

### Why this looks like a CLI bug

The same shell command works outside Copilot in the same environment.

This suggests:

1. a shell/process-launch failure inside Copilot CLI, and
2. a reasoning/diagnostic bug where posix_spawnp failed is treated as if the command were missing from PATH.

### Affected version

1.0.27

### Steps to reproduce the behavior
```
brew install jetbrains/utils/teamcity
copilot -p "Run exactly: command -v teamcity && teamcity auth status. Do not explain, just use the shell tool and report the result."
```

### Expected behavior

_No response_

### Additional context

_No response_

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par reproduire le problème avec `copilot -p` en utilisant la commande `teamcity`, à la fois avec et sans `--allow-all-tools`, puis comparez-le à l’invocation directe du shell. Suivez le lancement du processus de l’outil shell de la CLI et la gestion des erreurs autour de `posix_spawnp failed`. Le travail est terminé lorsque la commande se lance lorsqu’elle est autorisée, ou lorsque la CLI signale un échec de lancement du processus sans prétendre que la commande est absente de PATH.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
macos, shell
Domaine
cli, operating-systems
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Calme
Clarté
Plutôt claire
Accessibilité débutants
48/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.