Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(source-control): omit agent credits from PR merge messages #16192

Mergedjuliusmarmingemerged 2 commits intomain fromrefs/pull/16192/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

Problem

Merging a PR from T3 Code keeps agent co-author trailers and generated-by footers in GitHub's default merge message. Users who omit those credits currently have to edit the message outside T3 Code.

Change

Add Remove agent credits when merging in Source Control settings on web, desktop, and mobile. It defaults to off and supports project overrides. The server reads GitHub's proposed merge body, removes recognized agent credit lines while preserving human co-authors and Markdown examples, then supplies the cleaned body over stdin. Cleaned messages are tied to the head commit that was read.

Applies to ordinary GitHub merge and squash actions, including auto-merge. Merge queues, native stack merges, other hosting providers, and existing commit messages are outside this setting's scope.

Scope and approval

Maintainer-requested configuration of the existing PR merge capability. This controls the merge message without adding a workflow or changing product defaults. The shared setting, server implementation, client controls, tests, and user guidance all address that option.

Verification

  • 498 focused tests passed across merge-message cleanup, GitHub CLI actions, the PR service, and settings contracts. Coverage includes human co-authors, Markdown examples (including invalid openers, indented fences, and closing markers with trailing text), CRLF, empty cleaned bodies, default-off behavior, project overrides, auto-merge, rebase/queue exclusions, and stopping before merge when the message cannot be read.
  • Local server, web, mobile, and contracts typechecks passed. Scoped lint and whitespace checks passed. The base-branch SQL import blocker was fixed on main in 73fd3c1, then this branch was rebased onto it. All nine thread-stop regression tests also pass.
  • Verified in the collaborative browser over the tailnet against isolated worktree state: default off, enabling and persistence after reload, project overrides, and resetting to the inherited value. No live PR was merged for verification. Native mobile UI was typechecked but not driven on a device.
  • Read-only GitHub API verification confirmed the proposed merge-message and queue/head fields.

Before

Actual base checkout, with matching data, viewport, and scroll position.

Before: Source Control settings without agent credit removal

After

New setting at its default off value, at the same 1280 × 600 viewport and scroll position.

After: Source Control settings with the agent credit removal option

Implemented with gpt-6.1-sol through the Codex harness in T3 Code.

    1. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Not approved

      Macroscope's review found this PR not approvable — This PR adds a project-scoped merge-message policy and changes GitHub merge execution by reading proposed messages and submitting cleaned bodies with head-commit protection. It also introduces a new default-off product setting, which requires human review.

      Notes:

      • Diff unchanged. Approvability was decided on eligibility alone.

      No code changes detected at 95521dc. Prior analysis still applies.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    2. juliusmarminge added labelsmacroscope-review

    3. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →

      Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration
      • Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml
      • Review profile: CHILL
      • Plan: Team
      • Run ID: efd7d74d-8c7f-4cc4-9a1d-1b6f499b9447
      📥 Commits

      Reviewing files that changed from the base of the PR and between f32c23cf1aa9ff177224e93c239165adc67798c0 and a940604991a4bb3bc4941468693d746702eab7b3.

      📒 Files selected for processing (14)
      • apps/mobile/src/features/settings/SettingsServerControlsRouteScreen.tsx
      • apps/server/src/pullRequest/GitHubPullRequestCli.test.ts
      • apps/server/src/pullRequest/GitHubPullRequestCli.ts
      • apps/server/src/pullRequest/GitHubPullRequestProvider.ts
      • apps/server/src/pullRequest/PullRequestProvider.ts
      • apps/server/src/pullRequest/PullRequestService.test.ts
      • apps/server/src/pullRequest/PullRequestService.ts
      • apps/server/src/pullRequest/mergeMessage.test.ts
      • apps/server/src/pullRequest/mergeMessage.ts
      • apps/web/src/components/settings/ProjectDefaultsSettings.tsx
      • apps/web/src/components/settings/settingsSearch.ts
      • docs/user/source-control.md
      • packages/contracts/src/settings.test.ts
      • packages/contracts/src/settings.ts

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.


      📝 Walkthrough

      Walkthrough

      A default-off, project-scoped setting controls agent-credit removal from eligible GitHub merge messages. The server resolves the setting, cleans proposed messages for supported actions, and passes changed messages to the GitHub CLI with a head-commit match.

      Changes

      Agent credit removal

      Layer / File(s)Summary
      Setting contract and controls
      packages/contracts/src/settings.ts, packages/contracts/src/settings.test.ts, apps/mobile/src/features/settings/SettingsServerControlsRouteScreen.tsx, apps/web/src/components/settings/ProjectDefaultsSettings.tsx, apps/web/src/components/settings/settingsSearch.ts, docs/user/source-control.md
      The default-off setting supports project overrides. Mobile and web source-control settings expose the option, and search and documentation describe it.
      Resolve settings for pull-request actions
      apps/server/src/pullRequest/PullRequestService.ts, apps/server/src/pullRequest/PullRequestService.test.ts, apps/server/src/pullRequest/PullRequestProvider.ts, apps/server/src/pullRequest/GitHubPullRequestProvider.ts
      PullRequestService resolves the project setting for non-stack GitHub merge and auto-merge actions. The provider receives the option only when enabled.
      Recognize and remove agent credits
      apps/server/src/pullRequest/mergeMessage.ts, apps/server/src/pullRequest/mergeMessage.test.ts
      The message filter removes recognized agent attribution while retaining human co-authors and protected examples. Tests cover recognition, formatting, and preservation cases.
      Apply filtered messages in GitHub actions
      apps/server/src/pullRequest/GitHubPullRequestCli.ts, apps/server/src/pullRequest/GitHubPullRequestCli.test.ts
      For supported actions, the CLI reads the proposed message and head OID. If cleaning changes the message and no merge queue is enabled, it passes the cleaned body and head match to the GitHub CLI.

      Priority: ⬇️ Low

      Estimated code review effort: 3 (Moderate) | ~25 minutes

      Change: Feature

      Sequence Diagram(s)

      sequenceDiagram
        participant PullRequestService
        participant GitHubPullRequestProvider
        participant GitHubPullRequestCli
        participant GitHubGraphQL
        participant removeAgentCredits
        participant GitHubCLI
        PullRequestService->>GitHubPullRequestProvider: Pass enabled removal option
        GitHubPullRequestProvider->>GitHubPullRequestCli: Forward action and option
        GitHubPullRequestCli->>GitHubGraphQL: Read queue status, head OID, and proposed message
        GitHubGraphQL-->>GitHubPullRequestCli: Return queue status, head OID, and message
        GitHubPullRequestCli->>removeAgentCredits: Clean proposed message
        removeAgentCredits-->>GitHubPullRequestCli: Return cleaned message
        GitHubPullRequestCli->>GitHubCLI: Run action with changed body and head match

      Suggested reviewers: maria-rcks

      Merge Risk: ⚪ Minimal · up to a9406

      The setting’s reviewed paths show no remaining merge-blocking issue. Merge after normal checks.

      🚥 Pre-merge checks | ✅ 4 | ❌ 1

      ❌ Failed checks (1 warning)

      Check nameStatusExplanationResolution
      Docstring Coverage⚠️ WarningDocstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 13 files. (1 skipped: …Write docstrings for the functions missing them to satisfy the coverage threshold.
      ✅ Passed checks (4 passed)
      Check nameStatusExplanation
      Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Title check✅ PassedThe title clearly and concisely identifies the main change: removing agent credits from pull request merge messages. It uses a conventional commit format.
      Description check✅ PassedThe description covers the problem, change, scope, verification, UI screenshots, and implementation tool. It explains the setting’s behavior and exclusions. The scope section says the change was maint…
      Full details: Docstring Coverage

      Explanation

      Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 13 files. (1 skipped: 1 unsupported.)

      ✨ Finishing Touches 💡 1
      📝 Generate docstrings 💡
      • Commit to this branch
      • Create a new PR
      🧪 Generate unit tests (beta)
      • Commit to this branch
      • Create a new PR
      • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

      Comment `@coderabbitai help` to get the list of available commands.
    4. Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ℹ️ The exact PR base did not have a successful artifact. Baseline uses the latest successful main measurement shown below.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire4.9 KiB5.0 KiB+23 B (+0.5%)6.8 KiB✅
      CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      CodexLive turn WebSocket wire1.2 KiB1.2 KiB+23 B (+1.9%)2.0 KiB✅
      CodexLive turn WebSocket decoded20.8 KiB20.9 KiB+41 B (+0.2%)29.3 KiB✅
      CodexLive turn messages12+1 (+100.0%)8✅
      ClaudeTotal thread wire5.0 KiB5.0 KiB−17 B (−0.3%)6.8 KiB✅
      ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      ClaudeLive turn WebSocket wire1.2 KiB1.2 KiB−17 B (−1.4%)2.0 KiB✅
      ClaudeLive turn WebSocket decoded21.2 KiB21.2 KiB0 B (0.0%)29.3 KiB✅
      ClaudeLive turn messages220 (0.0%)8✅

      Baseline: 250e052 · PR result: 95521dc · Source CI: success

      Scenario and decoded snapshot size

      10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

      • Codex decoded thread snapshot: 108.5 KiB
      • Claude decoded thread snapshot: 108.8 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

    5. juliusmarminge merged this24238fe

    6. juliusmarminge closed this

    7. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

Sign in to join this conversation.