fix(agents): classify conventional local PR branches - #3008
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 33 minutes Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThe PR adds conventional branch inference in two source-context resolvers. It also validates verification commands, improves Original-Issue parsing, exposes ChangesBranch source inference
Issue formatting validation
Worker attempt metadata
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant IssueFormatter
participant CommandValidator
participant LLMOrFallback
participant JSONCLI
IssueFormatter->>CommandValidator: Validate verification command
CommandValidator-->>IssueFormatter: Approve or reject command
IssueFormatter->>LLMOrFallback: Format and finalize issue body
LLMOrFallback-->>IssueFormatter: Return formatted output
IssueFormatter->>JSONCLI: Expose needs_refinement
Possibly related issues
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Runner dispatch state for autofix on PR #3008. Do not edit. |
🤖 Keepalive Loop StatusPR #3008 | Agent: Codex | Iteration 0/12 Current State
🔍 Failure Classification| Error type | infrastructure |
|
Keepalive Work Log (click to expand)
|
|
Runner dispatch state for codex on PR #3008. Do not edit. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6239a2b6e5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@templates/consumer-repo/scripts/langchain/issue_formatter.py`:
- Line 865: Update the needs_refinement field in format_issue_body’s result
payload so prompt-injection and oversized-body exits do not default an absent
status to False. Ensure every return path supplies the validated refinement
status, or use True as the conservative fallback for paths without formatted
output.
- Around line 466-467: Update _ORIGINAL_ISSUE_INNER_RE to recognize both
backtick and tilde fence delimiters, while requiring the closing fence to match
the opening character and length. Keep the existing Original-Issue payload
capture and details-tag handling unchanged so _innermost_original_issue can
recover tilde-fenced content consistently with _strip_original_issue_blocks.
- Around line 171-182: Remove the curl alternative from SAFE_VERIFY_COMMAND_RE
so arbitrary curl commands no longer pass verification-command validation. Leave
SHELL_METACHARACTERS_RE and the other explicitly supported command patterns
unchanged; network checks must use a separate fixed-target policy if needed.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 23dbc1f3-b0c2-422b-ba94-a4271d9883c8
📒 Files selected for processing (4)
.github/scripts/__tests__/source-context.test.js.github/scripts/source_context.jstemplates/consumer-repo/.github/scripts/source_context.jstemplates/consumer-repo/scripts/langchain/issue_formatter.py
There was a problem hiding this comment.
Pull request overview
This PR improves PR source classification by treating conventional work-branch prefixes (feat/, fix/, docs/, audit/, chore/, refactor/, perf/, test/) as LOCAL_REQUEST, reducing noisy “missing issue link” warnings while preserving unknown-source warnings for lane-owned branches without explicit lineage.
Changes:
- Extend
inferredSourceType()to map conventional branch prefixes toSOURCE_TYPES.LOCAL_REQUEST(root + consumer template). - Add tests covering the positive conventional-branch case and negative lane-branch cases, and assert template/root parity for the resolved context.
- Update the consumer template’s issue formatter with additional acceptance-criteria gate logic and output metadata (not described in the PR summary).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
.github/scripts/source_context.js |
Classifies conventional branch prefixes as LOCAL_REQUEST via inferredSourceType(). |
templates/consumer-repo/.github/scripts/source_context.js |
Mirrors the same LOCAL_REQUEST inference logic for consumer templates. |
.github/scripts/__tests__/source-context.test.js |
Adds coverage for conventional prefixes and negative lane-prefix cases; checks root/template resolver parity. |
templates/consumer-repo/scripts/langchain/issue_formatter.py |
Adds/adjusts issue-formatting behavior and metadata (scope not reflected in PR description). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…ference Check sync/ branch prefixes and campaign labels before the github-actions[bot] automation_run fallback so consumer sync PRs stay sync_campaign while scheduled conventional bot branches still classify as automation_run. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Closer evidence (cursor, 2026-08-09T14:40Z): fixed the failing Root cause: Fix: reorder inference so Validation: Routing: cleared automation-loop Next safe action: after the required ≥7m post-push window on exact head |
🤖 Bot Comment Handler
The agent has been assigned to this PR to address the bot review comments. Instructions for agent
The bot comment handler workflow has prepared context in the artifacts. |
Provider Comparison ReportProvider Summary
📋 Full Provider Details (click to expand)openai
anthropic
Agreement
Disagreement
Unique Insights
🔍 LangSmith Traces |
Closes #3006
Automated Status Summary
Scope
Classify conventional non-lane work branches as
LOCAL_REQUESTonly in the root and consumer-template source-context modules. Preserve the existing source precedence and keep lane-owned branches unclassified when they have no explicit source.Context for Agent
Related Issues/PRs
Tasks
.github/scripts/source_context.js, add a rule immediately before the finalreturn SOURCE_TYPES.UNKNOWNininferredSourceType()mapping onlyfeat/,fix/,docs/,audit/,chore/,refactor/,perf/, andtest/toSOURCE_TYPES.LOCAL_REQUEST. Use trailing-slashstartsWith()checks, not a bare prefix.templates/consumer-repo/.github/scripts/source_context.js, preserving the consumer/root synchronization contract..github/scripts/__tests__/source-context.test.jswithresolvePrSourceContext infers local_request for conventional work-branch prefixes, coveringfeat/retire-plan-v3and negative lane casescodex/no-issue-linkandcloser/foo.resolvePrSourceContext()fallback ordering unchanged so explicit marker, block, checkbox, and label sources still outrank inference andisExplicitremains false for inferred local requests.Acceptance criteria
node --test .github/scripts/__tests__/source-context.test.jspasses and the new test provesfeat/retire-plan-v3resolves toLOCAL_REQUEST,isValid === true,requiresIssue === false, andisExplicit === false;codex/no-issue-linkandcloser/fooremainUNKNOWNand invalid. Capture the command output in the PR.resolvePrSourceContext leaves unrelated PRs unknowncontinues to pass unchanged forfeature/no-source, proving the match isstartsWith('feat/'), not a barefeatprefix.feat/predicate to a barestartsWith('feat');node --test .github/scripts/__tests__/source-context.test.jsmust fail the existingfeature/no-sourceassertion, then revert the deliberate break before committing.codex/in the conventional-prefix set; the new lane assertion must fail under the same named test command, then revert it before committing.Summary by CodeRabbit
New Features
Bug Fixes
Tests