#29391 [Bug]: github_copilot provider: IndexError (list index out of range) when max_tokens=1 for newer Claude models (opus-4.7, opus-4.8)
## What happened?
When sending a request with `max_tokens=1` to newer Claude models (`claude-opus-4.7`, `claude-opus-4.8`) via the `github_copilot` provider, LiteLLM returns HTTP 500 with:
```json {"error":{"message":"list index out of range","type":"None","param":"None","code":"500"}} ```
The same request with `max_tokens=2` or higher works perfectly. This breaks **Claude Code's model validation**, which hardcodes `max_tokens:1` as a probe to check if a model is usable.
## Relevant log output
Response headers on the 500: ``` server: uvicorn x-litellm-version: 1.81.3 x-litellm-call-id: 84fd88ec-6c5f-415f-a15c-76e4ef73481f x-litellm-model-id: 7b4da4cc-f571-4e47-b361-c40b0422815b x-litellm-response-cost: 0 ```
The error is a Python `IndexError` originating inside litellm (not from the upstream Copilot backend), as evidenced by `server: uvicorn` and `x-litellm-response-cost: 0` (no upstream completion was processed).
## How to reproduce
```bash # FAILS (500) curl -s "$LITELLM_BASE/v1/messages" \ -H "Authorization: Bearer $KEY" \ -H "content-type: application/json" \ -H "anthropic-version: 2023-06-01" \ -d '{"model":"claude-opus-4.7","max_tokens":1,"messages":[{"role":"…