Skip to content

agentHost: add setting to turn off Copilot's Co-authored-by trailer - #339437

Open
Spencer Schoenberg (spencrr) wants to merge 1 commit into
microsoft:mainfrom
spencrr:dev/spencrr/vscode-agent-window-attribution-fix
Open

Spencer Schoenberg (spencrr) wants to merge 1 commit into
microsoft:mainfrom
spencrr:dev/spencrr/vscode-agent-window-attribution-fix

Conversation

@spencrr

@spencrr Spencer Schoenberg (spencrr) commented Oct 3, 2026 •

Copy link
Copy Markdown

Copilot sessions that run in the agent host, like the ones in the Agents window, tell the agent to add this trailer to the commits it makes:

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

It comes from a <git_commit_trailer> block that the Copilot runtime puts in the system prompt. The SDK has a session option for it, coauthorEnabled, which defaults to on. The agent host never sets it, so the only way to avoid the trailer today is to tell the agent not to add it in every session.

The settings people reach for don't help here. git.addAICoAuthor only affects commits made through VS Code's Git UI. The CLI's includeCoAuthoredBy is applied by the CLI app rather than the runtime, so SDK-hosted sessions like ours never see it.

This adds chat.agentHost.copilot.includeCoAuthoredBy and passes it to the SDK as coauthorEnabled when a session is created or resumed.

Some notes:

  • The default is true, so attribution works the same as today unless you opt out. That matches the CLI and the SDK. Whether it should default to off, or follow the consent flow planned for git.addAICoAuthor in Update on "Co-authored-by: Copilot" in commit messages #314311, is a product call I've left out of this PR; it only adds the opt-out. The one difference is that the host now always sends the value, so the SDK makes an extra session.options.update call after each create and resume. coauthorEnabled showed up in the runtime in the same version as enableScriptSafety, which we already require at launch, so I don't expect that call to fail anywhere that works today.
  • The setting reaches the host through the declarative agentHost mirroring, using the default all-hosts scope. Local isn't enough. On my machine the Agents window talks to a CLI-launched agent host over a websocket, which counts as a remote target, and Local settings never reach it.
  • It's application-scoped because a host's config is shared by every window and profile connected to it. As with the other mirrored settings, the last client to write it wins.
  • It's applied when a session starts or resumes, so an open chat keeps its current behavior. The host also needs this change. An older one stores the value and ignores it.
  • It only covers the agent host's Copilot sessions. The extension-host "Copilot CLI" sessions and the Claude and Codex sessions aren't affected.
  • The setting should cover sub-agents too, but the runtime doesn't pass it on yet. I checked the bundled runtime (1.0.92-0) using signed-out BYOK sessions against a local mock model. With coauthorEnabled: false the main prompt drops the <git_commit_trailer> block, but a general-purpose sub-agent's prompt still has it. The SDK doesn't give the host a way to set it per sub-agent (there's no sub-agent hook, and updateSubagentSettings only covers things like model and effort), so the fix belongs in the runtime: includeCoAuthoredBy: false is not inherited by task subagents; their commits still get the Co-authored-by trailer github/copilot-cli#4576. Once that lands, sub-agents should follow this setting without another VS Code change.

Related: #314311 (see this comment), github/copilot-sdk#1172 (the request for the option, which shipped in github/copilot-sdk#1428), and github/copilot-cli#4576.

How to test

  1. Set "chat.agentHost.copilot.includeCoAuthoredBy": false.
  2. Start a new Copilot session in the Agents window and ask it to commit something itself, not through a sub-agent.
  3. The commit shouldn't have the Co-authored-by: Copilot trailer. You can also open ~/.copilot/session-state/<session-id>/events.jsonl and check that the system.message event has no <git_commit_trailer> block.
  4. Set it back to true (or remove it) and start another session. The trailer comes back.

What I ran locally:

  • node test/unit/node/index.js --run src/vs/platform/agentHost/test/node/copilotSessionLauncher.test.ts: 95 passing, including the new test, which fails with the launcher change reverted.
  • The same runner with copilotCliConfig.test.ts, agentHostConfigurationSync.test.ts and agentConfigurationService.test.ts added: 138 passing.
  • npx eslint and build/hygiene.ts on the changed files: clean.
  • npm run typecheck-client: no new errors. My checkout doesn't have Electron's typings installed, so there are 370 unrelated electron errors, but the list is the same with and without this change.

I haven't done the manual Agents window run above against a dev build.

Copilot AI balanced review requested due to automatic review settings October 3, 2026 00:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The default conflicts with the linked consent requirement, and the descriptions omit the known subagent limitation.

Review effort: Balanced
Findings: 1 Medium severity · 2 Low severity

Open (3)
What changed in this PR

Adds an application-scoped setting controlling Copilot commit attribution in Agent Host sessions.

Changes:

  • Mirrors the new setting to all Agent Hosts.
  • Passes coauthorEnabled during session creation and resume.
  • Adds launcher coverage for enabled, disabled, and absent values.
File Description
chat.shared.contribution.ts Registers the user-facing setting.
copilotCliConfig.ts Defines its host configuration schema.
copilotSessionLauncher.ts Forwards the value to the SDK.
copilotSessionLauncher.test.ts Tests configuration forwarding.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/vs/workbench/contrib/chat/browser/chat.shared.contribution.ts
Comment thread src/vs/platform/agentHost/common/copilotCliConfig.ts
Comment thread src/vs/workbench/contrib/chat/browser/chat.shared.contribution.ts
The agent host never set the SDK's `coauthorEnabled` session option, so
Copilot sessions (including the Agents window) always told the agent to
add a `Co-authored-by: Copilot` trailer to its commits, with no way to
opt out.

Add `chat.agentHost.copilot.includeCoAuthoredBy` (default true, so
behavior is unchanged), mirror it to all agent hosts through root config,
and pass it to the SDK when a session is created or resumed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The setting is consistently registered, mirrored, forwarded, and tested without changing existing default behavior.

Review effort: Balanced
Findings: None

Resolved since last review (3)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants