Skip to content

[Bug]: "Remove agent credits when merging" does nothing for GitLab merge requests #30440

Open

Description

@TonybynMp4

Area

Pull requests (GitLab provider)

Steps to reproduce

  1. Turn on Settings, Source control, "Remove agent credits when merging".
  2. Have a GitLab project whose merge or squash commit template carries agent credits. On TonybynMp4/git-ansible I set the merge template to Merge branch '%{source_branch}' into '%{target_branch}', a blank line, %{title}, %{description}, See merge request %{reference}, and the squash template to %{title} plus %{all_commits}. The project squashes on every merge.
  3. Open a merge request whose description ends in Claude Code's "🤖 Generated with Claude Code" footer and whose commit has Co-authored-by: Claude <noreply@anthropic.com> and a human co-author. !7 is that fixture.
  4. Merge it from T3 Code.

Expected behavior

The merge and squash commits lose the footer and the Claude trailer and keep the human co-author, as they do for GitHub pull requests.

Actual behavior

Both commits keep every credit:

Image

PullRequestService only passes removeAgentCreditsOnMerge to a provider that sets api.mergeMessageRewrite. The GitLab provider doesn't set it, and glab mr merge was never given a message, so GitLab writes its own from the templates.

Impact

Teams that turned the setting on to keep agent credits out of main get them on every GitLab merge, and nothing in the app says the setting was skipped.

Version or commit

7c22e24e3f (main)

Environment

Linux, web dev build, gitlab.com through glab 1.128.0.

Screenshots, recordings, or supporting files

Image

Workaround

Merge on GitLab and edit the messages by hand, or drop %{description} and %{all_commits} from the templates.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions