github / github/copilot-cli

Request to Copilot Cloud Agent via custom agent fails with 400 error if model selection does not align

Ouverte
#2,695 4 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
area:agents area:models
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

When assigning a Copilot Cloud custom agent to an issue, any model selection (including `auto`) that does not align with the `model:` field in the custom agent specification crashes the agent with the error `CAPIError: 400 Requested model not available for session`, even after logs indicate that the model has correctly been overridden from the agent definition for that session.

### Affected version

N/A - Github Copilot Cloud Agent

### Steps to reproduce the behavior

1. Create a custom agent definition on a repo with a model definition (e.g. `model: Claude Opus 4.6`)
2. Assign an issue to Copilot (cloud agent) on the repo
3. In the "Assign agent to issue" modal, select the custom agent AND select a mis-matching model (e.g. `Auto` or `Claude Sonnet 4.6`)
4. Observe how the agent session fails with error `CAPIError: 400 Requested model not available for session`

### Expected behavior

Copilot correctly overrides the chosen session model and completes without errors.

### Additional context

Truncated output of `Processing Request (Linux)` step of Copilot pipeline (in this case with `auto` model selected):
```
Custom agent "procedure-agent" specifies model "Claude Opus 4.6" (resolved to "claude-opus-4.6"), overriding session model "sweagent-capi:claude-sonnet-4.6"

[...]

CAPIError 400 Requested model not available for session
ERROR: {
"name": "CAPIError",
"text": "Copilot has encountered an internal error. If the problem persists, please contact GitHub Support, including the request ID `9408:185805:9A4587:A75A6B:69DE0218`. To retry, leave a comment on this pull request asking Copilot to try again.",
"stack": "CAPIError: 400 Requested model not available for session\n at _0x54111a.fromAPIError (file:///home/runner/work/_temp/***-action-main/dist/index.js:28:8030557)\n at WLe.getCompletionWithTools (file:///home/runner/work/_temp/***-action-main/dist/index.js:28:8048929)\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n at async mce.getCompletionWithTools (file:///home/runner/work/_temp/***-action-main/dist/index.js:28:8187000)\n at async _We.runCompletionWithTools (file:///home/runner/work/_temp/***-action-main/dist/index.js:152:36193)\n at async _0x1879ec (file:///home/runner/work/_temp/***-action-main/dist/index.js:152:33944)\n at async _We.agent (file:///home/runner/work/_temp/***-action-main/dist/index.js:152:34283)\n at async _We.runAgentLoop (file:///home/runner/work/_temp/***-action-main/dist/index.js:152:44134)\n at async _We.runAgentLoopAndEvaluate (file:///home/runner/work/_temp/***-action-main/dist/index.js:152:45005)\n at async _We.runAgent (file:///home/runner/work/_temp/***-action-main/dist/index.js:152:65753)",
"message": "400 Requested model not available for session",
"request_id": "00000-eede4b63-803d-4177-bcd9-2ea6893ffbc2",
"ghRequestId": "9408:185805:9A4587:A75A6B:69DE0218",
"service": "capi",
"code": "400",
"skipReport": false,
"isVisionFlow": false
}
```

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par reproduire l’échec avec un custom agent dont le modèle diffère de celui de la session sélectionnée, puis examinez la sortie « Processing Request (Linux) » du pipeline Copilot ainsi que le CAPIError signalé. Le travail est considéré comme terminé lorsque l’agent cloud s’exécute avec succès alors que le modèle sélectionné et celui du custom agent ne correspondent pas, sans l’erreur 400 « Requested model not available for session ».

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

Évaluation

Stack technique
github
Domaine
ai
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Calme
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

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