feat(wecom_bot): add Wecom Bot QR code scan auth

This commit is contained in:
zhayujie
2026-03-31 21:27:50 +08:00
parent 8744810b25
commit 66b71c50e9
6 changed files with 312 additions and 34 deletions

View File

@@ -102,13 +102,17 @@ class SkillManager:
else:
enabled = entry.metadata.default_enabled if entry.metadata else True
merged[name] = {
entry_dict = {
"name": name,
"description": skill.description,
"source": prev.get("source") or skill.source,
"enabled": enabled,
"category": category,
}
display_name = prev.get("display_name")
if display_name:
entry_dict["display_name"] = display_name
merged[name] = entry_dict
self.skills_config = merged
self._save_skills_config()

View File

@@ -244,10 +244,13 @@ class BrowserService:
with self._lock:
if self._alive and self._thread and self._thread.is_alive():
return
# Wait for old thread to fully exit before creating a new one
old = self._thread
if old and old.is_alive():
old.join(timeout=5)
# Fresh queue to avoid stale sentinels from a previous close()
self._task_queue = queue.Queue()
self._alive = True
# Reuse existing queue so tasks queued during restart are not lost
if self._task_queue is None:
self._task_queue = queue.Queue()
self._ready = threading.Event()
self._thread = threading.Thread(target=self._run_loop, daemon=True, name="BrowserThread")
self._thread.start()