CRITICAL FIX: Bot was triggering itself causing 10+ duplicate runs
Problem:
- When bot posts comments containing @codebot (e.g., help responses, PR reviews)
- Workflows trigger on those bot comments
- Bot responds again with @codebot mention
- Infinite loop → 10+ duplicate workflow runs → excessive API costs
Solution:
- Added github.event.comment.user.login != 'Bartender' to all workflow conditions
- Prevents bot from reacting to its own comments
- Bot username 'Bartender' is now hardcoded in workflows
Changes:
- .gitea/workflows/ai-comment-reply.yml: Added bot username check
- .gitea/workflows/ai-chat.yml: Added bot username check
- .gitea/workflows/ai-issue-triage.yml: Added bot username check
- CLAUDE.md: Documented bot self-trigger prevention and username update instructions
- README.md: Added Step 3 to bot customization with critical warning
Impact:
- Eliminates infinite loop scenarios
- Prevents excessive API costs from duplicate runs
- Workflows only trigger on human user comments
Note: If bot username changes from 'Bartender', all three workflow files must be updated.
Implements PR changelog generator that analyzes diffs and generates
Keep a Changelog format entries ready for CHANGELOG.md.
Features:
- Generates structured changelog entries (Added/Changed/Fixed/etc.)
- Automatically detects breaking changes
- Includes technical details (files, LOC, components)
- User-focused language filtering out noise
- Ready to copy-paste into CHANGELOG.md
Implementation:
- Added changelog.md prompt template with Keep a Changelog format
- Implemented _handle_changelog_command() in PRAgent
- Added _format_changelog() for markdown formatting
- Updated PRAgent.can_handle() to route changelog commands
- Added 'changelog' to config.yml commands list
Workflow Safety (prevents duplicate runs):
- Added '@codebot changelog' to ai-comment-reply.yml conditions
- Excluded from ai-chat.yml to prevent duplication
- Only triggers on PR comments (not issues)
- Manual command only (no automatic triggering)
Testing:
- 9 comprehensive tests in TestChangelogGeneration class
- Tests command detection, formatting, config validation
- Verifies prompt formatting and Keep a Changelog structure
Documentation:
- Updated README.md with changelog command and examples
- Added detailed implementation guide in CLAUDE.md
- Included example output and use cases
Related: Milestone 2 feature - PR changelog generation for release notes