fix: kanban_update.py 相对路径导致多 Agent 数据孤岛问题#90
Open
luomeng119 wants to merge 1 commit intocft0808:mainfrom
Open
fix: kanban_update.py 相对路径导致多 Agent 数据孤岛问题#90luomeng119 wants to merge 1 commit intocft0808:mainfrom
luomeng119 wants to merge 1 commit intocft0808:mainfrom
Conversation
sync_scripts_to_workspaces() 将脚本物理复制到各 workspace 后, kanban_update.py 的 __file__ 相对路径指向 workspace 私有目录, 导致 11 个 Agent 各自写入孤岛数据,中央看板断连。 修复:优先读取 EDICT_HOME 环境变量定位中央仓库, run_loop.sh 启动时自动 export EDICT_HOME,向后兼容。
|
利用scripts/run_loop.sh脚本去export的话,export的变量在脚本外获取不到,还是走入了else分支,没有真正解决问题 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题描述
按官方
install.sh标准流程部署后,启动多 Agent 实际协同时,子 Agent 无法将任务数据写入中央看板,导致tasks_source.json数据断连、看板全部瘫痪。根本原因
sync_agent_config.py中的sync_scripts_to_workspaces()函数会将scripts/目录下所有脚本物理复制到 11 个 Agent 的私有 workspace(~/.openclaw/workspace-*/scripts/)。但
kanban_update.py第 27 行使用的是相对路径:__file__上两级 =edict-sansheng/✅ 正确workspace-taizi/scripts/后:__file__上两级 =workspace-taizi/❌ 错误结果:11 个 Agent 各自在私有目录里创建
data/tasks_source.json,形成数据孤岛,中央看板完全断连。任何按官方流程部署的用户都会遇到此问题。修复方案
scripts/kanban_update.py优先读取环境变量
EDICT_HOME定位中央仓库,没有才 fallback 到相对路径(保持向后兼容):scripts/run_loop.sh启动时自动 export
EDICT_HOME,所有子进程继承:影响范围
EDICT_HOME时行为与原版一致sync_agent_config.py重新分发脚本时,分发的即为修复版本,永久生效