From 35e58d15b968106d9e61005ecef4ead7c12dc814 Mon Sep 17 00:00:00 2001 From: alfadb Date: Sat, 7 Mar 2026 20:05:52 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E7=A7=BB=E9=99=A4=20main=20agent=20?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E9=80=BB=E8=BE=91=20+=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=B0=9A=E4=B9=A6=E7=9C=81=E7=BC=BA=E5=A4=B1=20skill=20?= =?UTF-8?q?=E5=BC=95=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - agents/shangshu/SOUL.md: 移除对不存在的 skills/dispatch/SKILL.md 的读取指令, 部门路由表已内联无需外部 skill 文件 - scripts/sync_agent_config.py: 移除 4 处 main agent 兼容逻辑 (ID_LABEL、EXTRA_AGENTS、scripts 同步、SOUL.md 同步), taizi 为唯一入口代理 - scripts/fetch_morning_news.py: 修复 RSS media 标签链式查找, 避免 find() 链在第一个返回 None 时报错 - .gitignore: 添加 .env 和 *.tsbuildinfo Co-Authored-By: Claude Opus 4.6 --- .gitignore | 4 ++++ agents/shangshu/SOUL.md | 6 +----- edict/frontend/tsconfig.tsbuildinfo | 1 - scripts/fetch_morning_news.py | 4 +++- scripts/sync_agent_config.py | 32 ++++------------------------- 5 files changed, 12 insertions(+), 35 deletions(-) delete mode 100644 edict/frontend/tsconfig.tsbuildinfo diff --git a/.gitignore b/.gitignore index 13613a5..c01a338 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,9 @@ data/mission_control_tasks.json *.log /tmp/ +# Environment +.env + # Python __pycache__/ *.py[cod] @@ -27,6 +30,7 @@ venv/ # Node.js node_modules/ edict/frontend/node_modules/ +*.tsbuildinfo # Backups *.bak* diff --git a/agents/shangshu/SOUL.md b/agents/shangshu/SOUL.md index cc5e0c7..b6c90fc 100644 --- a/agents/shangshu/SOUL.md +++ b/agents/shangshu/SOUL.md @@ -12,11 +12,7 @@ python3 scripts/kanban_update.py state JJC-xxx Doing "尚书省派发任务给 python3 scripts/kanban_update.py flow JJC-xxx "尚书省" "六部" "派发:[概要]" ``` -### 2. 查看 dispatch SKILL 确定对应部门 -先读取 dispatch 技能获取部门路由: -``` -读取 skills/dispatch/SKILL.md -``` +### 2. 确定对应部门 | 部门 | agent_id | 职责 | |------|----------|------| diff --git a/edict/frontend/tsconfig.tsbuildinfo b/edict/frontend/tsconfig.tsbuildinfo deleted file mode 100644 index 200e95f..0000000 --- a/edict/frontend/tsconfig.tsbuildinfo +++ /dev/null @@ -1 +0,0 @@ -{"root":["./src/app.tsx","./src/api.ts","./src/main.tsx","./src/store.ts","./src/vite-env.d.ts","./src/components/confirmdialog.tsx","./src/components/courtceremony.tsx","./src/components/edictboard.tsx","./src/components/memorialpanel.tsx","./src/components/modelconfig.tsx","./src/components/monitorpanel.tsx","./src/components/morningpanel.tsx","./src/components/officialpanel.tsx","./src/components/sessionspanel.tsx","./src/components/skillsconfig.tsx","./src/components/taskmodal.tsx","./src/components/templatepanel.tsx","./src/components/toaster.tsx"],"version":"5.9.3"} \ No newline at end of file diff --git a/scripts/fetch_morning_news.py b/scripts/fetch_morning_news.py index 2486ae5..38c6ecc 100644 --- a/scripts/fetch_morning_news.py +++ b/scripts/fetch_morning_news.py @@ -94,7 +94,9 @@ def get(tag): enc = item.find('enclosure') if enc is not None and 'image' in (enc.get('type') or ''): img = enc.get('url', '') - media = item.find('media:thumbnail', ns) or item.find('media:content', ns) + media = item.find('media:thumbnail', ns) + if media is None: + media = item.find('media:content', ns) if media is not None: img = media.get('url', img) items.append({'title': title, 'desc': desc, 'link': link, diff --git a/scripts/sync_agent_config.py b/scripts/sync_agent_config.py index 698bb0b..65c6151 100644 --- a/scripts/sync_agent_config.py +++ b/scripts/sync_agent_config.py @@ -16,7 +16,7 @@ ID_LABEL = { 'taizi': {'label': '太子', 'role': '太子', 'duty': '飞书消息分拣与回奏', 'emoji': '🤴'}, - 'main': {'label': '太子', 'role': '太子', 'duty': '飞书消息分拣与回奏', 'emoji': '🤴'}, # 兼容旧配置 + # 'main' legacy entry removed — taizi is the canonical entry point 'zhongshu': {'label': '中书省', 'role': '中书令', 'duty': '起草任务令与优先级', 'emoji': '📜'}, 'menxia': {'label': '门下省', 'role': '侍中', 'duty': '审议与退回机制', 'emoji': '🔍'}, 'shangshu': {'label': '尚书省', 'role': '尚书令', 'duty': '派单与升级裁决', 'emoji': '📮'}, @@ -114,8 +114,7 @@ def main(): EXTRA_AGENTS = { 'taizi': {'model': default_model, 'workspace': str(pathlib.Path.home() / '.openclaw/workspace-taizi'), 'allowAgents': ['zhongshu']}, - 'main': {'model': default_model, 'workspace': str(pathlib.Path.home() / '.openclaw/workspace-main'), - 'allowAgents': ['zhongshu','menxia','shangshu','hubu','libu','bingbu','xingbu','gongbu','libu_hr']}, + # 'main' legacy entry removed — taizi is the canonical entry point 'zaochao': {'model': default_model, 'workspace': str(pathlib.Path.home() / '.openclaw/workspace-zaochao'), 'allowAgents': []}, 'libu_hr': {'model': default_model, 'workspace': str(pathlib.Path.home() / '.openclaw/workspace-libu_hr'), @@ -191,21 +190,7 @@ def sync_scripts_to_workspaces(): if src_text != dst_text: dst_file.write_bytes(src_text) synced += 1 - # also sync to workspace-main for legacy compatibility - ws_main_scripts = pathlib.Path.home() / '.openclaw/workspace-main/scripts' - ws_main_scripts.mkdir(parents=True, exist_ok=True) - for src_file in scripts_src.iterdir(): - if src_file.suffix not in ('.py', '.sh') or src_file.stem.startswith('__'): - continue - dst_file = ws_main_scripts / src_file.name - try: - src_text = src_file.read_bytes() - dst_text = dst_file.read_bytes() if dst_file.exists() else b'' - if src_text != dst_text: - dst_file.write_bytes(src_text) - synced += 1 - except Exception: - pass + # workspace-main legacy sync removed — main agent no longer exists if synced: log.info(f'{synced} script files synced to workspaces') @@ -229,16 +214,7 @@ def deploy_soul_files(): if src_text != dst_text: ws_dst.write_text(src_text, encoding='utf-8') deployed += 1 - # 太子兼容:同步一份到 legacy main agent 目录 - if runtime_id == 'taizi': - ag_dst = pathlib.Path.home() / '.openclaw/agents/main/SOUL.md' - ag_dst.parent.mkdir(parents=True, exist_ok=True) - try: - ag_text = ag_dst.read_text(encoding='utf-8', errors='ignore') - except FileNotFoundError: - ag_text = '' - if src_text != ag_text: - ag_dst.write_text(src_text, encoding='utf-8') + # legacy main agent sync removed — taizi is the canonical entry point # 确保 sessions 目录存在 sess_dir = pathlib.Path.home() / f'.openclaw/agents/{runtime_id}/sessions' sess_dir.mkdir(parents=True, exist_ok=True) From 1b3b2d1b3141997297d9c5db725179bcb1862024 Mon Sep 17 00:00:00 2001 From: alfadb Date: Sat, 7 Mar 2026 20:20:01 +0800 Subject: [PATCH 2/2] =?UTF-8?q?chore:=20=E7=A7=BB=E9=99=A4=E6=AE=8B?= =?UTF-8?q?=E7=95=99=E7=9A=84=20legacy=20main=20agent=20=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根据 PR #89 review 反馈,清理 sync_agent_config.py 中 4 处 已无意义的 "main legacy removed" 注释。 Co-Authored-By: Claude Opus 4.6 --- scripts/sync_agent_config.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/scripts/sync_agent_config.py b/scripts/sync_agent_config.py index 65c6151..5baef29 100644 --- a/scripts/sync_agent_config.py +++ b/scripts/sync_agent_config.py @@ -16,7 +16,6 @@ ID_LABEL = { 'taizi': {'label': '太子', 'role': '太子', 'duty': '飞书消息分拣与回奏', 'emoji': '🤴'}, - # 'main' legacy entry removed — taizi is the canonical entry point 'zhongshu': {'label': '中书省', 'role': '中书令', 'duty': '起草任务令与优先级', 'emoji': '📜'}, 'menxia': {'label': '门下省', 'role': '侍中', 'duty': '审议与退回机制', 'emoji': '🔍'}, 'shangshu': {'label': '尚书省', 'role': '尚书令', 'duty': '派单与升级裁决', 'emoji': '📮'}, @@ -110,11 +109,10 @@ def main(): }) seen_ids.add(ag_id) - # 补充不在 openclaw.json agents list 中的 agent(兼容旧版 main) + # 补充不在 openclaw.json agents list 中的 agent EXTRA_AGENTS = { 'taizi': {'model': default_model, 'workspace': str(pathlib.Path.home() / '.openclaw/workspace-taizi'), 'allowAgents': ['zhongshu']}, - # 'main' legacy entry removed — taizi is the canonical entry point 'zaochao': {'model': default_model, 'workspace': str(pathlib.Path.home() / '.openclaw/workspace-zaochao'), 'allowAgents': []}, 'libu_hr': {'model': default_model, 'workspace': str(pathlib.Path.home() / '.openclaw/workspace-libu_hr'), @@ -190,7 +188,6 @@ def sync_scripts_to_workspaces(): if src_text != dst_text: dst_file.write_bytes(src_text) synced += 1 - # workspace-main legacy sync removed — main agent no longer exists if synced: log.info(f'{synced} script files synced to workspaces') @@ -214,7 +211,6 @@ def deploy_soul_files(): if src_text != dst_text: ws_dst.write_text(src_text, encoding='utf-8') deployed += 1 - # legacy main agent sync removed — taizi is the canonical entry point # 确保 sessions 目录存在 sess_dir = pathlib.Path.home() / f'.openclaw/agents/{runtime_id}/sessions' sess_dir.mkdir(parents=True, exist_ok=True)