fix: include base branch in AI title suggestion prompt#1080
Conversation
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Review rate limit: 0/1 reviews remaining, refill in 43 minutes and 22 seconds.Comment |
|
Report bugs in Issues Welcome! 🎉This pull request will be automatically processed with the following features: 🔄 Automatic Actions
📋 Available CommandsPR Status Management
Review & Approval
Testing & Validation
Container Operations
Cherry-pick Operations
Label Management
✅ Merge RequirementsThis PR will be automatically approved when the following conditions are met:
📊 Review ProcessApprovers and ReviewersApprovers:
Reviewers:
Available Labels
AI Features
💡 Tips
For more information, please refer to the project documentation or contact the maintainers. |
The AI prompt for conventional title suggestions told the AI to "look at
the recent commits and changes" without specifying the base branch. When
the worktree state didn't clearly show PR changes, the AI had no context
and returned invalid suggestions.
Now the prompt includes explicit git commands with the base branch:
- `git diff origin/{base_ref}`
- `git log origin/{base_ref}..HEAD --oneline`
This ensures the AI always knows how to find the diff, regardless of the
worktree checkout state.
Closes #1019
fa9deed to
b12c1ba
Compare
|
New container for ghcr.io/myk-org/github-webhook-server:latest published |
Problem
The AI prompt for conventional title suggestions told the AI to "look at the recent commits and changes" without specifying the base branch. When the worktree state didn't clearly show PR changes (e.g., after force-push/amend), the AI had no context and returned invalid suggestions like "The PR branch is identical to main with no code changes."
Fix
Updated the prompt to include explicit git commands with the base branch name:
git diff origin/{base_ref}— shows the actual PR diffgit log origin/{base_ref}..HEAD --oneline— shows commit messagesThe prompt is now constructed inside the worktree block (after
base_refis fetched viagithub_api_call), ensuring the AI always has concrete instructions for finding the diff.Changes
webhook_server/libs/handlers/runner_handler.py— moved prompt inside worktree block, addedbase_reffetch, updated prompt with explicit git commandsTesting
Closes #1019