Add process controls and restart command

This commit is contained in:
Azimkin
2026-08-28 23:25:20 +02:00
parent 12434ec557
commit d3c02ca203
14 changed files with 358 additions and 4 deletions

View File

@@ -8,7 +8,7 @@ from typing import Any
from pyrogram import Client, idle
from app.ai import AIService
from app.commands import DEFAULT_REGISTRY, CommandRegistry, RuntimeAclStore
from app.commands import DEFAULT_REGISTRY, CommandRegistry, RuntimeAclStore, load_persistent_commands
from app.config import AccountConfig, AppConfig
from app.github_webhook import GitHubWebhookServer
from app.handlers import register_common_handlers
@@ -37,6 +37,10 @@ class AccountManager:
def __post_init__(self) -> None:
self.command_registry = DEFAULT_REGISTRY
if self.config.ai is not None:
loaded = load_persistent_commands(self.config.ai.workspace_dir / "commands", self.command_registry)
if loaded:
log.info("Loaded persistent commands: %s", ", ".join(loaded))
self.ai_service = AIService(self.config.ai) if self.config.ai is not None else None
self.states = [AccountState(config=account) for account in self.config.accounts]
self.github_webhook_server = GitHubWebhookServer(self, self.config.github_webhook)