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

feat(branch): accept the agents/ prefix by default - #645

Merged
shenxianpeng merged 1 commit into
mainfrom
feat/accept-agents-branch-prefix
Oct 29, 2026
Merged

shenxianpeng merged 1 commit into
mainfrom
feat/accept-agents-branch-prefix

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

VS Code's Agents window names its branches agents/<description>, and the prefix is hard-coded: git.branchPrefix is added in front of it (giving feature/agents/...), so users cannot make it conform. The Conventional Branch spec will accept agents/ as an alias of ai/ (conventional-branch/conventional-branch#196). This adds agents to DEFAULT_BRANCH_TYPES, so those branches pass without any config.

Before / After

commit-check --branch on a branch named agents/add-dark-mode-toggle:

Result
Before (2.19.3 from PyPI) ❌ exit 1: CC201 branch check failed ==> agents/add-dark-mode-toggle
After (this branch) ✅ exit 0
For comparison: ai/add-dark-mode-toggle on 2.19.3 ✅ exit 0

Repositories that set allow_branch_types themselves are unaffected: an explicit list still replaces the defaults.

Changes

  • commit_check/__init__.py: agents added after the other AI agent prefixes, with a comment pointing at the spec issue.
  • tests/rule_builder_test.py: asserts agents is a default type and that agents/add-dark-mode-toggle matches.
  • README.md: pre-commit pin moved from v2.19.2 to v2.19.3, the latest published release (tag and PyPI), per AGENTS.md.

tests/conventional_branch_fixtures.json is left alone: it mirrors the spec's v1.1.0 fixtures, and agents/ arrives in the spec's next release.

Tests

pytest: 1449 passed.

Summary by CodeRabbit

  • New Features
    • Branch names beginning with agents/ are now accepted, including names such as agents/add-dark-mode-toggle. This adds another supported prefix for organizing branches while preserving support for existing branch naming conventions.
  • Documentation
    • Updated the pre-commit example to reference version v2.19.3.

VS Code's Agents window names its branches agents/<description>, and the
prefix is hard-coded: git.branchPrefix is added in front of it, so users
cannot make it conform. The Conventional Branch spec will accept agents/
as an alias of ai/ (conventional-branch/conventional-branch#196); accept
it in the default branch types now so those branches pass without config.

Also move the README pre-commit pin to v2.19.3, the latest release.
@shenxianpeng
shenxianpeng requested a review from a team as a code owner October 29, 2026 17:41
@github-actions github-actions Bot added the enhancement New feature or request label Oct 29, 2026
@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

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: 98ab899a-ebaf-467c-a9af-d52306a7a744
Commits

Reviewing files that changed from the base of the PR and between 765198f and d34d46e.

Files selected for processing: 3
  • README.md
  • commit_check/__init__.py
  • tests/rule_builder_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.

Walkthrough

The default branch types now include agents, with tests for the prefix and a matching branch name. The README pre-commit example now references v2.19.3 instead of v2.19.2.

Changes: Default Branch Prefix

Layer / File(s) Summary
Add and test the agents prefix
commit_check/__init__.py, tests/rule_builder_test.py
DEFAULT_BRANCH_TYPES includes agents. Tests check the default type and validate agents/add-dark-mode-toggle against the default branch rule.

Pre-commit Example Revision

Layer / File(s) Summary
Update the example revision
README.md
The pre-commit configuration example updates its pinned revision from v2.19.2 to v2.19.3.

Priority: Normal

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

Change: Feature

Suggested labels: tests

Merge Risk: Minimal · up to d34d4

The default prefix, tests, and documentation revision update are consistent with the stated intent and ready for 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 "feat(branch): accept the agents/ prefix by default" matches the main change. The raw summary shows that commit_check/init.py adds "agents" to DEFAULT_BRANCH_TYPES, and tests/rule_builde…
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 "feat(branch): accept the agents/ prefix by default" matches the main change. The raw summary shows that commit_check/init.py adds "agents" to DEFAULT_BRANCH_TYPES, and tests/rule_builder_test.py checks that agents/add-dark-mode-toggle is accepted by default. The README pin bump from v2.19.2 to v2.19.3 is a minor side change that the title does not need to cover. The title is specific, concise, and follows a conventional commit format.

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 2 files. (1 skipped: 1 unsupported.)

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

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Oct 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (765198f) to head (d34d46e).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #645   +/-   ##
=========================================
  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.

@shenxianpeng
shenxianpeng merged commit 2a77115 into main Oct 29, 2026
32 checks passed
@shenxianpeng
shenxianpeng deleted the feat/accept-agents-branch-prefix branch October 29, 2026 17:57
@shenxianpeng shenxianpeng changed the title feat(branch): accept the agents/ prefix by default feat(branch): accept the agents/ prefix by default Oct 29, 2026
shenxianpeng added a commit to commit-check/commit-check.com that referenced this pull request Oct 29, 2026
Brings the site in step with v2.19.4, published 2026-10-29
([release](https://github.com/commit-check/commit-check/releases/tag/v2.19.4),
on PyPI).

## Before / After

`python -m pytest tests/ -q` with `commit-check==2.19.4` installed:

| | Result |
|---|---|
| Before (`main`) | ❌ 2 failed, 16 passed:
`test_pinned_revisions_match_the_released_version`,
`test_documented_defaults_match_the_runtime` |
| After (this branch) | ✅ 18 passed |

What a reader sees:

| Page | Before | After |
|---|---|---|
| pre-commit snippets (configuration, example, pre-commit guide ×3) |
`rev: v2.19.3` | `rev: v2.19.4` |
| Configuration → `allow_branch_types` default | `… "copilot", "cursor",
"dependabot", "renovate"` | `… "copilot", "cursor", "agents",
"dependabot", "renovate"`, and the description names `agents` (the
prefix VS Code's Agents window uses) |
| Rules → CC201 options | default list without `agents` | names `agents`
among the defaults |
| Rules → CC013, Policy guides | trailers listed up to Copilot's
`Agent-Logs-Url:` | also Cursor's `Made-with: Cursor` |
| Changelog | latest entry v2.19.3 | v2.19.4 (2026-10-29) entry and a
Highlights row |

## Changes

- Pins: `docs/configuration.md`, `docs/example.md`,
`docs/guides/pre-commit.md` (blog posts untouched, as AGENTS.md asks).
- `agents` in the default branch types, from
commit-check/commit-check#645: `docs/configuration.md` (Every option)
and `docs/rules.md` (CC201). The spec-strict config on CC201 is
unchanged: the Conventional Branch spec does not list `agents` yet.
- Cursor's `Made-with: Cursor` trailer, from
commit-check/commit-check#643, which noted the site could name it once
released: `docs/rules.md` (CC013) and `docs/guides/policies.md`.
- `docs/changelog.md`: v2.19.4 entry with its release date, and a
Highlights row, since the release changes what passes.

`mkdocs build --strict` passes locally (no warnings).


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Documentation**
* Updated the changelog and policy guidance to describe recognition of
Cursor’s `Made-with:` trailer. It is rejected when the `forbid` policy
is enabled and corrected to `Assisted-by: Cursor` under `disclose`;
other `Made-with:` values are unaffected.
* Updated configuration and rule documentation to show `agents` as an
accepted default branch prefix.
  * Updated pre-commit examples to use Commit Check v2.19.4.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@codspeed

codspeed Bot commented Oct 29, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

1 warning

⚠️ 128 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 feat/accept-agents-branch-prefix (d34d46e) with main (bd0a8c1)2

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. ↩

  2. No successful run was found on main (765198f) during the generation of this report, so bd0a8c1 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant