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.
Critical fix for workflow routing that was causing 3x duplication on every
@codebot mention. All three workflows (ai-chat, ai-comment-reply, ai-issue-triage)
were triggering simultaneously.
Changes:
- ai-issue-triage.yml: Only runs on '@codebot triage' (unchanged, already specific)
- ai-comment-reply.yml: Only runs on specific commands (help, explain, suggest, etc)
- ai-chat.yml: Only runs on free-form questions (excludes all specific commands)
Workflow routing logic:
1. '@codebot triage' → ai-issue-triage.yml ONLY
2. '@codebot <command>' → ai-comment-reply.yml ONLY
3. '@codebot <question>' → ai-chat.yml ONLY (fallback)
This prevents the massive duplication issue where every @codebot mention
triggered all three workflows simultaneously, causing 10+ redundant runs.
Updated documentation in CLAUDE.md with workflow routing architecture.