← 输入框|github.com|刷新
Skip to content

fix(ai): detect aider's default co-author trailer - #652

Merged
shenxianpeng merged 1 commit into
mainfrom
fix/aider-co-author-trailer
Nov 4, 2026
Merged

shenxianpeng merged 1 commit into
mainfrom
fix/aider-co-author-trailer

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Summary

Since v0.85 (2025-06), aider adds Co-authored-by: aider (<model>) <aider@aider.chat> to every commit by default (aider/repo.py). The catalog already has an Aider entry, but its patterns expect either Aider <email> or Some Name (aider), so the model in parentheses stopped either one from matching. Both forbid and disclose let the trailer through.

The trailer is now matched by its address, the same way Cursor's agent is matched by cursoragent@cursor.com. This holds whatever model aider names.

Before vs after

Message:

feat: add flag

Co-authored-by: aider (gpt-4o) <aider@aider.chat>
Policy Before (2.19.4) After
forbid passes, exit 0 CC013 ai-attribution check failed ==> Aider
disclose passes, exit 0 CC014 ai-disclosure check failed, CC015 ai-co-author check failed
Suggest: Use "Assisted-by: aider (gpt-4o)" in place of the co-author line
fix under disclose nothing to fix replaces the line with Assisted-by: aider (gpt-4o)

Changes

  • commit_check/ai_signatures_data.py: adds an ... <aider@aider.chat> identity (co-author and sign-off) to the Aider entry.
  • Tests: detection for two model names, the trailer's role, a 50k-space linear-time case, the disclose fix, and forbid in the validator.

Testing

  • pytest: 1454 pass. The one failure, test_load_config_file_permission_error, happens only because the tests ran as root locally. It is unrelated.
  • Coverage stays at 100% lines and branches, and ruff check / ruff format --check are clean.

Summary by CodeRabbit

  • Bug Fixes
    • Aider co-author and sign-off trailers are now recognized when they use the aider@aider.chat address, regardless of the display name.
    • Aider co-author disclosures retain the model name, and the forbid policy correctly rejects these attributions.

aider has added "Co-authored-by: aider (<model>) <aider@aider.chat>"
by default since v0.85. The model in parentheses kept the existing Aider
patterns from matching, so forbid and disclose let the trailer through.
Match the trailer by its address, as for Cursor's agent.
@shenxianpeng
shenxianpeng requested a review from a team as a code owner November 4, 2026 16:42
@github-actions github-actions Bot added the bug Something isn't working label Nov 4, 2026
@shenxianpeng shenxianpeng self-assigned this Nov 4, 2026
@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Aider signature patterns now match trailers with any display name followed by aider@aider.chat. Tests cover detection, co-author role identification, disclosure text, and rejection under the forbid policy.

Changes: Aider trailer recognition

Layer / File(s) Summary
Match Aider trailer identities
commit_check/ai_signatures_data.py, tests/ai_signatures_test.py
The Aider patterns match any display name followed by aider@aider.chat. Tests cover model names, co-author role detection, and a long-space input.
Verify policy handling
tests/ai_policy_test.py, tests/engine_test.py
Tests check that the proposed disclosure retains the model name and that the forbid policy rejects an Aider co-author trailer.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested labels: bug, tests

Merge Risk: Minimal · up to 84797

The Aider trailer recognition change is ready to merge with normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: Aider's default co-author trailer is now detected. The raw summary says the Aider signature registry now matches trailers containing aider@aider.chat regardless of the…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: Aider's default co-author trailer is now detected. The raw summary says the Aider signature registry now matches trailers containing aider@aider.chat regardless of the display name, and tests cover the default Co-authored-by format. The title uses the conventional fix(ai): prefix and stays concise. It is a PASS.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 4 files.

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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 044f4f3a-2d42-4ec2-ae65-f67b87ee3b6c
Commits

Reviewing files that changed from the base of the PR and between 7eec0ac and 8479796.

Files selected for processing: 4
  • commit_check/ai_signatures_data.py
  • tests/ai_policy_test.py
  • tests/ai_signatures_test.py
  • tests/engine_test.py

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

@sonarqubecloud

sonarqubecloud Bot commented Nov 4, 2026

Copy link
Copy Markdown

@codecov

codecov Bot commented Nov 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (7eec0ac) to head (8479796).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #652   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           14        14           
  Lines         2429      2429           
  Branches       470       470           
=========================================
  Hits          2429      2429           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed

codspeed Bot commented Nov 4, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

1 warning

⚠️ 125 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 653 untouched benchmarks
⏩ 126 skipped benchmarks1


Comparing fix/aider-co-author-trailer (8479796) with main (7eec0ac)

Open in CodSpeed

Footnotes

  1. 126 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@shenxianpeng
shenxianpeng merged commit e849e1a into main Nov 4, 2026
65 of 72 checks passed
@shenxianpeng
shenxianpeng deleted the fix/aider-co-author-trailer branch November 4, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant