github / github/copilot-cli

[BUG]: Terminal streaming renderer corrupts output - characters doubled/truncated during streaming

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

描述

## Description

The Copilot CLI terminal renderer corrupts streamed output, producing doubled characters, truncated tokens, and repeated lines. This affects both the thinking/reasoning phase output and the final assistant response output.

## Steps to Reproduce

1. Ask Copilot CLI any question that produces a moderately long response
2. Observe the output as it streams to the terminal

## Observed Behavior

Output is visibly corrupted during streaming. Examples seen:
- Partial tokens rendered before full token is available (e.g. `apil` instead of `apiVersion`)
- Characters doubled mid-word (e.g. `obserrvability`, `permpermissions`)
- Words repeated mid-sentence (e.g. `New ReliNew Relic`, `useruser`)
- Lines repeated (e.g. `metadata:` block appearing twice)
- Thinking/reasoning tokens streamed visibly with same corruption artifacts

Example corrupted output observed:
```
apil
apiVersion: rbac.authorization.k8s.io/v1
...
- apiGroups: [piGroups: [""]
```

## Expected Behavior

Output should render cleanly with no corruption, doubled characters, or repeated lines.

## Environment

- Copilot CLI version: 1.0.61
- OS: Darwin (macOS)

## Notes

The underlying content being generated is correct — the issue is purely in how the CLI streams and renders tokens to the terminal.

贡献指南

打开贡献指南

调研方向

首先,在 macOS 上复现 Copilot CLI 终端渲染器中的内容损坏,并比较 thinking/reasoning 和最终响应的流式传输。跟踪渲染器如何处理部分 token 和行更新;当流式输出与底层内容一致,且没有重复字符、截断或重复行时,即表示完成。

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

评估

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

把新 issue 发到你的邮箱

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