Accepted Telegram senders could use /permissions and its callbacks to
persistently remove their own tool restrictions. The same access also
exposed instance-wide plugin toggles.
Add a per-bot admin_users allowlist and enforce it when opening settings
and processing every settings callback. Administrators must still pass
allowed_users; an omitted or empty admin_users list grants nobody settings
access. Resolve membership from the current bot configuration on each
event so revocation applies to existing buttons.
Expose the administrator list in the WebUI and document its defaults.
Add regression coverage for message and callback routes, denied writes,
authorized policy persistence, runtime tool decisions, and revocation.
Validation:
- Conda framework: 123 tests and 41 subtests passed.
- Docker framework: 9 focused tests and 41 subtests passed.
- WebUI: administrator field renders, parses entries, and clears correctly.
- JavaScript syntax and git diff checks passed.
- Restarted the bound Docker instance and verified HTTP 200.
Telegram network delivery was not exercised; tests use synthetic events
and disposable policy files without changing live bot access settings.
Reject HTTP updates for polling bots and require a matching nonempty webhook secret before aiogram dispatch. Validate webhook secrets during setup and revoke local webhook authorization before removal or polling startup.
Update configuration guidance and the security ledger. Add regression coverage through the real Flask route and aiogram dispatcher, including invalid headers, setup validation, and polling transitions.
Validation: 13 tests and 11 subtests passed in the focused Telegram suite; both new tests also passed in the Docker framework runtime.
- handler.py: Added handle_new_members() to send customized greetings (supports {name} placeholder, skips bots).
- bot_manager.py: Registered new handler using NEW_CHAT_MEMBERS filter.
- _10_telegram_bot.py: Integrated _wrap_new_members to ensure the bot uses the latest configuration.
- config.html: Added Welcome New Members toggle and Welcome Message input (conditional visibility based on Group Mode).
- telegram-config-store.js & default_config.yaml: Added default state (false) and documentation.
- Replaced :value reactive binding on Allowed Users and User→Project Mapping inputs with x-effect and focus guard, ensuring Alpine.js rerenders don't clear user-typed values while editing.
- Enhanced setUserProjects() to preserve incomplete entries (e.g., 123=), preventing accidental data loss.
- Refactored Default Project <select> persistence: replaced x-model with a x-effect + @change one-way binding, fixing value resets before option loading completes.
- Removed standalone aiohttp HTTP server for webhook mode; switched to Agent Zero's built-in API handler at /api/plugins/_telegram_integration/webhook.
- Added a new unauthenticated POST handler (api/webhook.py) that receives Telegram updates and feeds them to aiogram's Dispatcher.
- Webhook URLs are auto-constructed from the base URL and API path—no additional port or reverse proxy configuration required.
- Added webhook_secret verification in the API handler for improved security.
- bot.delete_webhook() is now called before starting polling mode to prevent TelegramConflictError races.
- Improved bot lifecycle: detects active webhook mode via webhook_active flag to avoid restart loops on each job_loop tick.
- Removed unused aiohttp/SimpleRequestHandler code.