From 5356e9ddebf6332a1ba0975b80cb620d221a8d69 Mon Sep 17 00:00:00 2001 From: zhayujie Date: Wed, 18 Mar 2026 21:55:09 +0800 Subject: [PATCH] docs: adjust docs order --- common/cloud_client.py | 39 ++++-- docs/docs.json | 290 ++++++++++++++++++++--------------------- 2 files changed, 173 insertions(+), 156 deletions(-) diff --git a/common/cloud_client.py b/common/cloud_client.py index f56ec6d2..162f1d69 100644 --- a/common/cloud_client.py +++ b/common/cloud_client.py @@ -201,27 +201,36 @@ class CloudClient(LinkAIClient): def _handle_channel_create(self, channel_type: str, data: dict): local_config = conf() - self._set_channel_credentials(local_config, channel_type, - data.get("appId"), data.get("appSecret")) + cred_changed = self._set_channel_credentials( + local_config, channel_type, data.get("appId"), data.get("appSecret")) self._add_channel_type(local_config, channel_type) self._save_config_to_file(local_config) - if self.channel_mgr: + if not self.channel_mgr: + return + + existing_ch = self.channel_mgr.get_channel(channel_type) + if existing_ch and not cred_changed: + logger.info(f"[CloudClient] Channel '{channel_type}' already running with same config, " + "skip restart, reporting status only") threading.Thread( - target=self._do_add_channel, args=(channel_type,), daemon=True + target=self._report_channel_startup, args=(channel_type,), daemon=True ).start() + return + + threading.Thread( + target=self._do_add_channel, args=(channel_type,), daemon=True + ).start() def _handle_channel_update(self, channel_type: str, data: dict): local_config = conf() enabled = data.get("enabled", "Y") - self._set_channel_credentials(local_config, channel_type, - data.get("appId"), data.get("appSecret")) + cred_changed = self._set_channel_credentials( + local_config, channel_type, data.get("appId"), data.get("appSecret")) if enabled == "N": self._remove_channel_type(local_config, channel_type) else: - # Ensure channel_type is persisted even if this channel was not - # previously listed (e.g. update used as implicit create). self._add_channel_type(local_config, channel_type) self._save_config_to_file(local_config) @@ -233,9 +242,17 @@ class CloudClient(LinkAIClient): target=self._do_remove_channel, args=(channel_type,), daemon=True ).start() else: - threading.Thread( - target=self._do_restart_channel, args=(self.channel_mgr, channel_type), daemon=True - ).start() + existing_ch = self.channel_mgr.get_channel(channel_type) + if existing_ch and not cred_changed: + logger.info(f"[CloudClient] Channel '{channel_type}' already running with same config, " + "skip restart, reporting status only") + threading.Thread( + target=self._report_channel_startup, args=(channel_type,), daemon=True + ).start() + else: + threading.Thread( + target=self._do_restart_channel, args=(self.channel_mgr, channel_type), daemon=True + ).start() def _handle_channel_delete(self, channel_type: str, data: dict): local_config = conf() diff --git a/docs/docs.json b/docs/docs.json index 80c0bc51..ff3e9271 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -183,6 +183,151 @@ } ] }, + { + "language": "en", + "tabs": [ + { + "tab": "Introduction", + "groups": [ + { + "group": "Overview", + "pages": [ + "en/intro/index", + "en/intro/architecture", + "en/intro/features" + ] + } + ] + }, + { + "tab": "Get Started", + "groups": [ + { + "group": "Installation", + "pages": [ + "en/guide/quick-start", + "en/guide/manual-install" + ] + } + ] + }, + { + "tab": "Models", + "groups": [ + { + "group": "Model Configuration", + "pages": [ + "en/models/index", + "en/models/minimax", + "en/models/glm", + "en/models/qwen", + "en/models/kimi", + "en/models/doubao", + "en/models/claude", + "en/models/gemini", + "en/models/openai", + "en/models/deepseek", + "en/models/linkai", + "en/models/coding-plan" + ] + } + ] + }, + { + "tab": "Tools", + "groups": [ + { + "group": "Tools System", + "pages": [ + "en/tools/index" + ] + }, + { + "group": "Built-in Tools", + "pages": [ + "en/tools/read", + "en/tools/write", + "en/tools/edit", + "en/tools/ls", + "en/tools/bash", + "en/tools/send", + "en/tools/memory", + "en/tools/env-config" + ] + }, + { + "group": "Optional Tools", + "pages": [ + "en/tools/web-search", + "en/tools/scheduler" + ] + } + ] + }, + { + "tab": "Skills", + "groups": [ + { + "group": "Skills System", + "pages": [ + "en/skills/index", + "en/skills/skill-creator" + ] + }, + { + "group": "Built-in Skills", + "pages": [ + "en/skills/image-vision", + "en/skills/linkai-agent", + "en/skills/web-fetch" + ] + } + ] + }, + { + "tab": "Memory", + "groups": [ + { + "group": "Memory System", + "pages": [ + "en/memory" + ] + } + ] + }, + { + "tab": "Channels", + "groups": [ + { + "group": "Platforms", + "pages": [ + "en/channels/web", + "en/channels/feishu", + "en/channels/dingtalk", + "en/channels/wecom-bot", + "en/channels/qq", + "en/channels/wecom", + "en/channels/wechatmp" + ] + } + ] + }, + { + "tab": "Releases", + "groups": [ + { + "group": "Release Notes", + "pages": [ + "en/releases/overview", + "en/releases/v2.0.2", + "en/releases/v2.0.1", + "en/releases/v2.0.0" + ] + } + ] + } + ] + }, { "language": "ja", "tabs": [ @@ -330,151 +475,6 @@ ] } ] - }, - { - "language": "en", - "tabs": [ - { - "tab": "Introduction", - "groups": [ - { - "group": "Overview", - "pages": [ - "en/intro/index", - "en/intro/architecture", - "en/intro/features" - ] - } - ] - }, - { - "tab": "Get Started", - "groups": [ - { - "group": "Installation", - "pages": [ - "en/guide/quick-start", - "en/guide/manual-install" - ] - } - ] - }, - { - "tab": "Models", - "groups": [ - { - "group": "Model Configuration", - "pages": [ - "en/models/index", - "en/models/minimax", - "en/models/glm", - "en/models/qwen", - "en/models/kimi", - "en/models/doubao", - "en/models/claude", - "en/models/gemini", - "en/models/openai", - "en/models/deepseek", - "en/models/linkai", - "en/models/coding-plan" - ] - } - ] - }, - { - "tab": "Tools", - "groups": [ - { - "group": "Tools System", - "pages": [ - "en/tools/index" - ] - }, - { - "group": "Built-in Tools", - "pages": [ - "en/tools/read", - "en/tools/write", - "en/tools/edit", - "en/tools/ls", - "en/tools/bash", - "en/tools/send", - "en/tools/memory", - "en/tools/env-config" - ] - }, - { - "group": "Optional Tools", - "pages": [ - "en/tools/web-search", - "en/tools/scheduler" - ] - } - ] - }, - { - "tab": "Skills", - "groups": [ - { - "group": "Skills System", - "pages": [ - "en/skills/index", - "en/skills/skill-creator" - ] - }, - { - "group": "Built-in Skills", - "pages": [ - "en/skills/image-vision", - "en/skills/linkai-agent", - "en/skills/web-fetch" - ] - } - ] - }, - { - "tab": "Memory", - "groups": [ - { - "group": "Memory System", - "pages": [ - "en/memory" - ] - } - ] - }, - { - "tab": "Channels", - "groups": [ - { - "group": "Platforms", - "pages": [ - "en/channels/web", - "en/channels/feishu", - "en/channels/dingtalk", - "en/channels/wecom-bot", - "en/channels/qq", - "en/channels/wecom", - "en/channels/wechatmp" - ] - } - ] - }, - { - "tab": "Releases", - "groups": [ - { - "group": "Release Notes", - "pages": [ - "en/releases/overview", - "en/releases/v2.0.2", - "en/releases/v2.0.1", - "en/releases/v2.0.0" - ] - } - ] - } - ] } ] }