github / github/copilot-cli

includeCoAuthoredBy: false is not inherited by task subagents; their commits still get the Co-authored-by trailer

未关闭
#4,576 0 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

triage
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

Describe the bug

includeCoAuthoredBy: false in ~/.copilot/settings.json is respected by the interactive session, but is not inherited by task-tool subagents. Commits created by subagents still get the Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> trailer.

This is a follow-up to #3181, which added the opt-out. The setting works for the main session — it just doesn't reach spawned subagents.

Beyond silently ignoring the setting, subagents appear to be told the trailer is mandatory. During a plan-execution run, one subagent amended an otherwise-finished commit purely to add it, and logged:

note: amended cleanup commit to <sha> to add the required Co-authored-by trailer; no file changes.

That "required" wording suggests the subagent's system prompt carries the coauthor instruction unconditionally, rather than gated on coauthorEnabled.

Affected version

GitHub Copilot CLI 1.0.80

Steps to reproduce the behavior
  1. Set the opt-out in ~/.copilot/settings.json:
    { "includeCoAuthoredBy": false }
    
  2. Start an interactive session in a git repo.
  3. Ask the main session to make a commit directly (e.g. via a shell git commit). ✅ No trailer — setting respected.
  4. Now delegate committing work to a subagent, e.g. via the task tool with agent_type: "general-purpose", instructing it to implement a change, commit it, and stop.
  5. Inspect the resulting commit:
    git log -1 --format='%b'
    
  6. ❌ The message contains Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>.

In my case 8/8 commits created by subagents carried the trailer, while every commit made directly from the main session had none. Stripping them across the branch required:

git rebase <base> --exec "git log -1 --pretty=%B | grep -v '^Co-authored-by:' | git commit --amend --quiet -F -"
Expected behavior

includeCoAuthoredBy: false should apply to all commits produced by the CLI, including those created by subagents — the setting reads as global, not session-scoped.

Additional context
  • The setting key itself is correct and current: app.js computes coauthorEnabled: T.includeCoAuthoredBy !== false, and includeCoAuthoredBy?: boolean is declared in sdk/index.d.ts. (The changelog entry for #3181 calls it include_coauthor, which no longer matches the settings.json key — minor doc drift, possibly worth fixing too.)
  • Ruled out as causes in my repo: no git hooks, core.hooksPath unset, and commit.template pointed at an empty file. Raw git commit from the main session never adds the trailer.
  • settings.json had includeCoAuthoredBy: false for ~2 weeks before the affected session, so this isn't a case of the setting being applied late.
  • Environment: macOS 26.5.2, arm64, zsh, iTerm2/agterm.

贡献指南

打开贡献指南

从这里开始

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

调研方向

从计算 coauthorEnabled 的 app.js 和声明 includeCoAuthoredBy 的 sdk/index.d.ts 开始。追踪 task-tool 子代理如何接收设置和 coauthor 指令,然后将 includeCoAuthoredBy 设置为 false 进行复现,并检查 git log。当禁用时由子代理创建的提交省略 trailer,同时默认行为仍保持启用,即表示完成。

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

评估

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

把新 issue 发到你的邮箱

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