Unimportant change

This commit is contained in:
Dita Aji Pratama 2026-06-22 11:37:23 +07:00
parent 941157a672
commit 76d68c0fea

View File

@ -1,14 +1,17 @@
import os, sys, threading, time import os, sys, threading, time, signal
import signal
import config import config
from services.xmpp_client import XMPPClient
from scripts.llm_client import LLMClient
from tools import coder, rag, carrack from tools import coder, rag, carrack
from scripts import gadget
from scripts.personality import build_system_prompt from services.xmpp_client import XMPPClient
from services.telegram_client import TelegramClient
from services.llm_client import LLMClient
from scripts.personality import build_system_prompt
from scripts import gadget
from tui import HendrikTUI
tools_definition = [ tools_definition = [
@ -46,7 +49,6 @@ def main():
i += 2 i += 2
else: else:
i += 1 i += 1
if workspace: if workspace:
resolved = os.path.abspath(workspace) resolved = os.path.abspath(workspace)
if not os.path.isdir(resolved): if not os.path.isdir(resolved):
@ -74,8 +76,6 @@ def main():
services.append(client) services.append(client)
if config.TELEGRAM_ENABLED: if config.TELEGRAM_ENABLED:
from services.telegram_client import TelegramClient
allowed_ids = [] allowed_ids = []
if config.TELEGRAM_ALLOWED_GROUP_IDS.strip(): if config.TELEGRAM_ALLOWED_GROUP_IDS.strip():
allowed_ids = [r.strip() for r in config.TELEGRAM_ALLOWED_GROUP_IDS.split(',') if r.strip()] allowed_ids = [r.strip() for r in config.TELEGRAM_ALLOWED_GROUP_IDS.split(',') if r.strip()]
@ -108,8 +108,8 @@ def main():
svc.stop() svc.stop()
_shutdown = True _shutdown = True
signal.signal(signal.SIGTERM, _handle_sig) signal.signal(signal.SIGTERM, _handle_sig) # Handling interupt
signal.signal(signal.SIGINT, _handle_sig) signal.signal(signal.SIGINT, _handle_sig) # Handling terminate
try: try:
while not _shutdown: while not _shutdown:
@ -117,8 +117,8 @@ def main():
except KeyboardInterrupt: except KeyboardInterrupt:
_shutdown = True _shutdown = True
print("Exiting.", flush=True) print("Exiting.", flush=True)
else: else:
from tui import HendrikTUI
HendrikTUI( HendrikTUI(
llm_client = llm_client, llm_client = llm_client,
tools_definition = tools_definition, tools_definition = tools_definition,