github / github/copilot-cli

Bug: Cannot read properties of null (reading 'length') when using BYOK

未关闭
#3,911 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
area:configuration area:models
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

### Describe the bug

When using BYOK (Bring Your Own Key) in the Copilot CLI, I encounter the following error: `Cannot read properties of null (reading 'length')`.

Image

### Affected version

GitHub Copilot CLI 1.0.64.

### Steps to reproduce the behavior

1. Open Copilot CLI with the following command:

> COPILOT_PROVIDER_TYPE=openai COPILOT_PROVIDER_WIRE_API=completions COPILOT_PROVIDER_BASE_URL=https://api.mistral.ai/v1 COPILOT_PROVIDER_API_KEY=$MISTRAL_API_KEY COPILOT_MODEL=mistral-medium-latest COPILOT_PROVIDER_MAX_PROMPT_TOKENS=262144 COPILOT_PROVIDER_MAX_OUTPUT_TOKENS=262144 copilot --yolo --log-level all --log-dir logs/

2. Send prompt

```
hi
```

### Expected behavior

No error

### Additional context

[process-1782304659429-43157.log](https://github.com/user-attachments/files/29293096/process-1782304659429-43157.log)

贡献指南

打开贡献指南

调研方向

Start with the reported `copilot` command and its BYOK environment variables, then inspect the attached `process-1782304659429-43157.log` for the null value and preceding operation. Reproduce with the `hi` prompt using Copilot CLI 1.0.64 and verify that the prompt completes without the `reading 'length'` error.

由索引模型根据 Issue 内容生成。

评估

技术栈
shell
领域
cli
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
冷清
描述清晰度
需要澄清
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。