con un clic
code-review
Review code in the vpn-bot-refactor project; optionally land the change via git push
Menú
Review code in the vpn-bot-refactor project; optionally land the change via git push
Subscription, payment, quota, and refund operations. Reading subscription state, extending users, granting quota, looking up payment history.
Runbook for mass outages — prod down, en-masse client disconnects. Order of triage, who to notify, how to roll back.
Server administration — Docker, systemd, logs, certs, SSH between nodes, and git operations on the deployed repo
VPN infrastructure ops — Xray nodes, X-UI panel, traffic, client configs, and entry↔exit failover diagnostics
| name | code-review |
| description | Review code in the vpn-bot-refactor project; optionally land the change via git push |
| type | prompt |
| whenToUse | User asks to review code, audit a diff, check a PR, or "fix and commit" something concrete |
| arguments | ["target"] |
Default working tree: $REPO_PATH = /opt/vpn-bot (synced from git@github.com:Annoyt/VPNautodeploy.git, branch main).
If $target looks like a path → read that file. If it looks like a commit SHA → git -C "$REPO_PATH" show <sha>. If it looks like a PR number → gh pr view <n> (assume gh is configured).
aiohttp handlers in bot/core/web_server.py must use await asyncio.to_thread(...) for blocking DB and sync XUI calls; never call time.sleep inside the event loop. The bot itself runs on sync polling, so handlers there are free to block.?-binding, not f-strings. Schema names must match the prod DB (message_text, timestamp, started_at, expires_at), not the legacy names in CREATE TABLE._validate_admin; every callback that targets another user verifies validator.validate_admin(user_id).BOT_TOKEN, XUI_PASSWORD, REALITY_PUBLIC_KEY, KIMI_BRIDGE_TOKEN, or session/cred file paths. The dashboard's secret_status whitelist is the contract.FORUM_GROUP_ID must include message_thread_id. Inline web_app buttons must only appear in 1:1 chats (group falls back to url button + admin_token query).bot/core/database.py was added/renamed, check the prod table actually matches (the CREATE IF NOT EXISTS does not migrate existing tables).If the user explicitly says "fix and commit" / "почини и закоммить":
cd "$REPO_PATH"
git pull --ff-only origin main
# edit files
python3 -c "import sys; sys.path.insert(0,'.'); from bot.handlers.callbacks import *" # smoke-import what you touched
git add <specific paths>
git status -s # show user what you're about to commit
# ASK FOR CONFIRMATION HERE if change touches auth, billing, or x-ui sync
git commit -m "<type>(<scope>): <imperative summary>
<optional body>
Co-Authored-By: kimi-bot <kimi-bot@local>"
git push kimi-origin main # writes via /root/.ssh/github_kimi (deploy key)
Then deploy and verify:
docker compose -f "$REPO_PATH/docker-compose.yml" up -d --build vpn-bot
sleep 8
docker compose -f "$REPO_PATH/docker-compose.yml" logs vpn-bot --tail 20 | grep -iE 'error|warn|registered'
bot/services/user_lifecycle.py (revoke_user_key) and bot/utils/validators.py.forward_to_support, the smoke import + a targeted log read are the bar.requirements.txt → propose, wait./opt/vpn-bot/.env schema → never push without user.CREATE, ALTER, DROP) → propose the SQL, get OK, then run.If review only — review, summarize, don't touch the working tree.