github / github/app

Title: Copilot App Repeatedly Calls apply_patch with Empty Content and Gets S...

未关闭
#1,924 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
Bugs
主要语言
没有语言数据
星标
2.1k
派生
153
PR 合并指标
30 天内没有已合并 PR

描述

Title: Copilot App Repeatedly Calls apply_patch with Empty Content and Gets Stuck in a Loop

I would like to report an issue I've encountered when using GitHub Copilot App with GPT models (via BYOK).

In many coding tasks, Copilot frequently chooses to invoke the `apply_patch` tool. However, the generated tool call often contains no patch content, resulting in the following error:

`apply_patch requires a non-empty string input (the patch content).`

The main issue is not only the failed tool execution itself, but that Copilot repeatedly retries the same `apply_patch` call after the failure. The agent appears unable to recover from the error and can become stuck in a loop continuously invoking the same tool.

Observed behavior:

* Copilot decides to use `apply_patch`.
* The tool receives an empty patch.
* The tool returns the error above.
* The agent retries the same action.
* The process may repeat multiple times without making progress.
* Additional requests and credits are consumed during these retries.

Expected behavior:

* If an empty patch is generated, the agent should detect the issue before invoking the tool.
* After receiving this specific error, the agent should either regenerate the patch content or choose an alternative approach.
* The agent should avoid repeatedly invoking the same tool with identical invalid input.
* Tool failures should not result in an infinite retry loop.

Environment:

* Product: GitHub Copilot App
* Model: GPT model via BYOK
* Error message: `apply_patch requires a non-empty string input (the patch content)`

It would be helpful if the agent could include safeguards against empty patch submissions and implement retry limits for tool invocation failures.

Thank you for looking into this issue.

---
| Field | Value |
| --- | --- |
| App version | 1.0.21 |
| OS | macOS 13.7.6 |
| Theme | GitHub |
| Path | /chat |
| Tenure | Week 6 |

贡献指南

打开贡献指南

调研方向

首先,使用 GPT 模型通过 BYOK 重现 GitHub Copilot App 1.0.21 中的空 `apply_patch` 调用,然后观察重试行为和报告的错误。完成的标准是:空补丁会被阻止或恢复,并且重复出现的相同工具失败会停止,不会进入无界循环或发出更多不必要的请求。

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

评估

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

把新 issue 发到你的邮箱

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