Skip to content

fix: 移除 main agent 兼容逻辑 + 修复尚书省缺失 skill 引用#89

Open
alfadb wants to merge 2 commits intocft0808:mainfrom
alfadb:fix/remove-main-agent-and-dispatch-skill
Open

fix: 移除 main agent 兼容逻辑 + 修复尚书省缺失 skill 引用#89
alfadb wants to merge 2 commits intocft0808:mainfrom
alfadb:fix/remove-main-agent-and-dispatch-skill

Conversation

@alfadb
Copy link

@alfadb alfadb commented Mar 7, 2026

Summary

  • agents/shangshu/SOUL.md: 移除对不存在的 skills/dispatch/SKILL.md 的读取指令。部门路由表已内联在 SOUL.md 中,无需外部 skill 文件(运行时会产生 ENOENT 错误)
  • scripts/sync_agent_config.py: 移除 4 处 main agent 兼容逻辑(ID_LABEL、EXTRA_AGENTS、scripts 同步、SOUL.md 同步)。Edict v1.2 设计中 taizi 为唯一入口代理,main 已废弃
  • scripts/fetch_morning_news.py: 修复 RSS media 标签链式查找,find() 返回 None 时不能直接链式调用第二个 find()
  • .gitignore: 添加 .env(含数据库凭据)和 *.tsbuildinfo(构建缓存)

Test plan

  • OpenClaw 部署环境验证:尚书省派发六部流转测试通过,六部全部正常接旨
  • 确认 sync_agent_config.py 在无 main agent 目录的环境下正常运行
  • 确认 fetch_morning_news.py 能正确解析含/不含 media 标签的 RSS 源

🤖 Generated with Claude Code

- 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 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 7, 2026 12:06
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

该 PR 主要围绕 Edict v1.2 的 agent 入口收敛(以 taizi 为唯一入口)进行清理,同时修复 RSS 图片解析的兼容性问题,并移除会导致运行时报错的错误引用/构建产物提交。

Changes:

  • sync_agent_config.py 移除 main agent 的 legacy 兼容配置与同步逻辑,仅保留 taizi 作为规范入口。
  • 修复 fetch_morning_news.py 中 RSS media:* 标签解析:避免 ElementTree Element 在布尔判断下因“无子节点”被当作 False 导致误走 fallback。
  • 清理尚书省 SOUL 指令中对不存在 skill 文件的读取,并将 .env*.tsbuildinfo 纳入忽略规则(并删除已提交的 tsbuildinfo)。

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
scripts/sync_agent_config.py 移除 main 的 legacy entry、EXTRA_AGENTS、workspace 脚本同步与 SOUL 同步逻辑
scripts/fetch_morning_news.py 修复 media:thumbnail / media:content 的查找逻辑,改用 is None 判空
agents/shangshu/SOUL.md 移除对不存在的 skills/dispatch/SKILL.md 的读取步骤,内联路由表继续使用
.gitignore 忽略 .env*.tsbuildinfo,避免敏感信息/构建缓存进入仓库
edict/frontend/tsconfig.tsbuildinfo 删除误提交的 TS 构建缓存文件

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 113 to 118
@@ -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'),
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的注释仍写“兼容旧版 main”,但本次改动已移除了 main 的 legacy 逻辑(ID_LABEL/EXTRA_AGENTS 等)。建议更新或删除该注释,避免误导后续维护者对 EXTRA_AGENTS 的用途判断。

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 1b3b2d1 — removed all 4 residual legacy comments, including the one in EXTRA_AGENTS and the parent comment above it.

根据 PR cft0808#89 review 反馈,清理 sync_agent_config.py 中 4 处
已无意义的 "main legacy removed" 注释。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants