`-p` mode fails if agent succeeds but does not print any conclusion

未关闭
#5,574 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

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

调研方向

Start by tracing the -p prompt flow that handles an agent completing work without producing a final response, and inspect the code that reports the empty-response error and sets the exit code. Reproduce with the command in the issue, then check whether the agent made changes before deciding whether the run should succeed. Done means a run that made changes and printed no conclusion exits with code 0 without an error; a run that did nothing should retain the reported behavior.

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

描述

area:non-interactive
Describe the bug

We have automation that runs copilot with -p, asks the agent to do something and exit. It used to work fine until 1.0.114. Since 1.0.115 the agent is still able to complete its task, but copilot then prints an error message and exits with an error exit code, making the automation think the agent failed.

Affected version

GitHub Copilot CLI 1.0.115.

Steps to reproduce the behavior
$ copilot --model gpt-5.6-luna --effort low --prompt 'Write "test" into foo.txt, then exit without saying anything.'; echo EXIT-CODE: $?
 $ Shell Write test to foo.txt No Content
   printf 'test' > foo.txt


Error: The model returned an empty response, so the run produced no answer.


Changes    +0 -0
AI Credits 0.54 (12s)
Tokens     ↑ 56.1k (37.9k cached, 18.3k written) • ↓ 102 (64 reasoning)
Resume     copilot --resume=c51f8d52-0c32-4e5a-a58c-7e37e6c81f67
EXIT-CODE: 1
Expected behavior

Succeeds, does not print an error message, and exits with 0.

Additional context

Please only trigger the behavior if the agent didn't do anything at all, or add an option to disable it.

主要语言
Python
星标
11.5k
派生
2k
平均合并
6 小时 34 分钟
30 天内合并 PR
3

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/copilot-cli 的其他 Issue

查看 github/copilot-cli 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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