mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[PR #5193] [CLOSED] ci(issue-bot): improve limits, tooling, concurrency, and update bot facts #5814
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#5814
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/5193
Author: @rqzbeh
Created: 6/11/2026
Status: ❌ Closed
Base:
main← Head:feature/claude-bot-improvements📝 Commits (1)
baf844fchore: improve claude-issue-bot limits, tooling, and concurrency📊 Changes
1 file changed (+86 additions, -67 deletions)
View changed files
📝
.github/workflows/claude-issue-bot.yml(+86 -67)📄 Description
Summary
This PR comprehensively improves the
claude-issue-bot.ymlworkflow, making it safer, more accurate, and up-to-date with the recentinternal/architecture refactoring. It resolves several critical limitations of the previous implementation and introduces concurrency safeguards.Issues Addressed & Solutions
1. Outdated Repository Context
Issue: The bot's hardcoded "Repository map" was severely outdated. It missed the
internal/prefix and the extensive splitting ofweb/service/into granular domain files (e.g.,client_*.go,inbound_*.go) introduced in the recent massive refactor (#5167). It also lacked awareness of new protocols (MTProto viamtg), CLI commands (migrateDB), and database structures (hashed API tokens).Solution: Updated the
BOT_FACTSblock to perfectly reflect the post-refactorinternal/structure, new directories, and added explicit facts about hashing and Fail2ban systemd usage.2. DRY Violations and Command Injection Risks
Issue: The system prompt facts were duplicated: once as a multiline string in
handle-issue, and again as a massive 450-word string passed directly via--append-system-promptin thementionjob. Furthermore, injecting text with inner double quotes into a double-quoted CLI argument created bash parsing vulnerabilities.Solution: Extracted all knowledge into a single GitHub Actions workflow-level
env.BOT_FACTSblock, making it perfectly DRY. Replaced inner double quotes with single quotes ('postgres://...') and changed thementionjob's argument wrapper to strict single quotes (--append-system-prompt '... ${{ env.BOT_FACTS }}') to guarantee 100% shell injection safety.3. Insufficient Tools and Limits
Issue: The bot was instructed to "check git history" but lacked
Bash(git:*)tool permissions and used a shallow clone (fetch-depth: 1), meaning it hallucinated git history. Additionally,--max-turnswas too low (90 and 70), causing deep investigations to abort prematurely.Solution: Added
fetch-depth: 0to the checkout action and grantedBash(git:*)tool permissions so the bot can accurately read git logs and blame. Increased--max-turnsto 120 (for issues) and 90 (for mentions).4. Missing Concurrency and Timeout Safeguards
Issue: The jobs could theoretically run forever or stack indefinitely if a user spammed mentions.
Solution: Added strict 15-minute
timeout-minuteshard caps. Implemented issue-scopedconcurrencygroups withcancel-in-progress: trueto prevent race conditions and automatically abort stale bot runs if a new comment is posted.How to test
Review the
.github/workflows/claude-issue-bot.ymlchanges. All shell invocations and YAML structures have been thoroughly verified for syntax and escaping.Contribution Guide Compliance
ci(issue-bot): ...).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.