18 Commits

Author SHA1 Message Date
cft0808
3f2dfb5df2 fix: deploy SOUL.md with correct uppercase filename (#294)
OpenClaw only loads SOUL.md (uppercase), but deploy_soul_files() was
writing to soul.md (lowercase), causing the deployed SOUL to be ignored.

Fixes #294
2026-04-20 00:18:35 +08:00
狼哥
f92c54f371 fix: support OPENCLAW_HOME env var (#275)
fix: support OPENCLAW_HOME for non-standard OpenClaw paths\n\nAdds get_openclaw_home() helper in scripts/utils.py and updates all\ninstall/runtime scripts to resolve OpenClaw home from OPENCLAW_HOME\nenvironment variable with fallback to ~/.openclaw.\n\nCloses #271
2026-04-10 00:55:27 +08:00
cft0808
0f1c24bd44 fix: 修复多个bug并合并社区贡献
Bug 修复:
- Fix #232: court_discuss.py 添加 from __future__ import annotations 兼容 Python 3.9
- Fix #233: Dockerfile 添加 channels 模块 COPY 解决 Docker 运行时 ModuleNotFoundError
- Fix #234: sync_agent_config.py 将 dispatchChannel 默认值从 'feishu' 改为空字符串
- Fix #241: sync_agent_config.py 收集 defaults.models 中的所有可用模型到看板选择器

社区贡献 (cherry-pick):
- PR #239 (@ElninoZhong): 添加 workflow state vs execution ownership 文档
- PR #237 (@ElninoZhong): 修复 feishu 默认值问题
- PR #212 (@YIOYIOIOI): Windows install.ps1 优先 python 命令 + UTF-8 编码修复

依赖更新 (Dependabot):
- actions/checkout v4 → v6
- docker/setup-buildx-action v3 → v4
- docker/build-push-action v5 → v7
- actions/labeler v5 → v6
- actions/stale v9 → v10
2026-03-30 21:48:55 +08:00
YueKang
385c8d2ddf fix: prevent self-referential symlinks in sync_scripts_to_workspaces
When install.sh link_resources() creates workspace-*/scripts as a
directory-level symlink pointing to the project scripts/ dir, iterating
over it in sync_scripts_to_workspaces() produces dst_file paths that
resolve to the same real file as src_file.

The old idempotency check only skipped when dst_file itself was already a
symlink:

    if dst_file.is_symlink() and dst_file.resolve() == src_resolved:
        return False

For a workspace whose scripts/ directory is a symlink-to-directory,
dst_file appears as a regular file (is_symlink() == False), so the check
passes, the real source file is unlinked, and os.symlink() re-creates it
as a self-referential link (foo.py -> foo.py).  Running run_loop.sh every
15 s makes the whole scripts/ directory unusable within one cycle.

Fix: resolve dst_file before any other check and bail out early when
dst_resolved == src_resolved, regardless of whether dst_file itself is
stored as a symlink entry.
2026-03-28 16:47:38 +08:00
cft0808
332ef07fc9 feat: multi-channel notification push (Phase 3+4)
- Integrate channel adapters into dashboard server push_notification()
- Add migrate_notification_config() for backward compatibility
- Add /api/notification-channels endpoint
- Update dashboard UI with multi-channel select
- Rename env vars to generic NOTIFICATION_ENABLED/DEFAULT_DISPATCH_CHANNEL
- Add env var fallback in sync_agent_config.py

Closes #200, Closes #201
2026-03-26 21:52:54 +08:00
YIOYIO
dbbd817fd6 fix: Windows 安装/同步/看板 Gateway 兼容性修复 (#203)
Co-authored-by: cft0808 <41196455+cft0808@users.noreply.github.com>
2026-03-26 21:10:11 +08:00
Sliverp
c8d9b9d7c4 fix: use symlinks for workspace script sync to fix data-path split (#56) (#176)
sync_scripts_to_workspaces() previously used physical file copies.  Scripts
that derive project root from __file__ (e.g. kanban_update.py) therefore
resolved to the workspace directory when run as a copied file, causing
tasks_source.json writes to land in the wrong location while the Dashboard
reads from the canonical data/ directory.

Replace write_bytes() with os.symlink() so __file__ always resolves back to
the project scripts/ directory.  This ensures that all path-derived constants
(TASKS_FILE, DATA, etc.) point to the single canonical data/ folder regardless
of which agent workspace runs the script.

Added _sync_script_symlink() helper with:
- Idempotent re-runs (skip if link already correct)
- Automatic cleanup of stale physical copies and broken symlinks
- Full test suite (10 tests) covering creation, idempotency, replacement
  of physical copies, broken symlinks, __file__ resolution, etc.

Closes #56

Co-authored-by: cft0808 <41196455+cft0808@users.noreply.github.com>
2026-03-25 22:20:21 +08:00
Matt Van Horn
f5cbbb146a fix(agents): swap gongbu and bingbu SOUL.md duty assignments (#145)
The Ministry of Works (gongbu) historically handled infrastructure and
public works, while the Ministry of War (bingbu) handled military
operations. The current SOUL.md files had these duties inverted.

- gongbu now handles infrastructure, deployment/ops, and monitoring
- bingbu now handles engineering, architecture, and feature development
- Updated duty labels in sync_agent_config.py to match

Closes #131

Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: cft0808 <41196455+cft0808@users.noreply.github.com>
2026-03-25 00:25:21 +08:00
Ailuntz
99d672b065 fix(config): accept allowAgents in agent list (#108) 2026-03-25 00:23:21 +08:00
cft0808
02dfdcd8b0 fix: resolve open GitHub issues (#142 #139 #136 #131 #127 #124 #132 #125)
- install.sh: clean invalid binding 'pattern' field (Closes #142)
- server.py: make dispatch channel configurable via agent_config.json (Closes #139)
- server.py: add POST /api/set-dispatch-channel endpoint
- sync_agent_config.py: preserve dispatchChannel across syncs
- ModelConfig.tsx/api.ts: add dispatch channel selector UI
- install.ps1: add Windows PowerShell install script (Closes #136)
- Verify gongbu/bingbu SOUL.md are correct and consistent (Closes #131)
- Already fixed in prior commit: Closes #127, Closes #124, Closes #132, Closes #125
2026-03-16 22:08:33 +08:00
cft0808
b91675bc4c feat: 朝堂议政功能 + GitHub issues 批量优化
新增功能:
- 朝堂议政(Court Discussion): 多官员围绕议题展开部门视角讨论
  - 后端 court_discuss.py + 前端 CourtDiscussion.tsx
  - 集成 GitHub Copilot API (gpt-4o)
  - 各部门依据 SOUL.md 职责发表专业意见

GitHub Issues 修复:
- #127: 模型下拉列表自动合并 openclaw.json 已配置模型
- #83:  install.sh 安装时设置 sessions.visibility all
- #88:  install.sh 用 symlink 统一各 workspace 的 data/scripts
- #80:  调度器 stallThreshold 180s→600s, maxRetry 1→2
- #124: skill_manager 增加镜像回退 + 自定义 Hub URL
- #132: sync_from_openclaw_runtime 放宽过滤,保留 Review 状态任务
2026-03-14 23:57:24 +08:00
cft0808
8574607c93 fix: 补全detect_official映射 + 自动同步scripts到workspace 2026-02-27 22:09:08 +08:00
cft0808
8ad2b512c3 fix: 对齐文档与OpenClaw实现链路(安装/同步/统计)
- install.sh: workspace与agent注册补齐太子/吏部/早朝
- sync_agent_config.py: 增加__main__入口,修正taizi映射,兼容model对象结构
- sync_officials_stats.py: 兼容model对象结构,修复TypeError,太子ID改为taizi并保留main兼容
- README_EN.md: 修正Quick Start里旧的9-workspace描述
2026-02-27 21:49:58 +08:00
cft0808
11f15db16f feat: 添加吏部(libu_hr) + 自动部署所有 SOUL.md
1. 吏部 agent:
   - 新建 agents/libu_hr/SOUL.md (人事/培训/Agent管理)
   - 注册到 openclaw.json (shangshu.allowAgents += libu_hr)
   - 添加到 sync_agent_config/sync_officials_stats/server.py/dashboard.html
   - 更新尚书省 dispatch SKILL.md 部门能力索引
   - 所有六部 SOUL.md 中'吏部暂空'→'吏部(libu_hr)负责人事/培训'

2. 自动 SOUL.md 部署:
   - sync_agent_config.py 新增 deploy_soul_files()
   - 每次同步自动将项目 agents/xxx/SOUL.md → workspace soul.md
   - 处理 taizi→main 名称映射
   - 只在内容变更时写入,确保 sessions 目录存在
   - 修复: xingbu 缺 sessions dir, main 缺 workspace

完整阵容 11 个: 🤴太子 + 三省(📜📍📮) + 六部(📝💰⚔️⚖️🔧👔) + 📰钦天监
2026-02-27 00:17:31 +08:00
cft0808
19886035d4 fix: 补全太子(main)+钦天监(zaochao) agent 配置
- 部署 agents/taizi/SOUL.md → ~/.openclaw/agents/main/SOUL.md
  太子之前在裸跑,没有任何指令/人设
- sync_agent_config.py: ID_LABEL 新增 main, 补充 EXTRA_AGENTS 逻辑
  处理不在 openclaw.json agents list 中的 agent (main=默认, zaochao=独立)
- sync_officials_stats.py: OFFICIALS 列表加入 main(太子)
- dashboard.html: _agentLabels 加入 zaochao
- agent_config.json: 8→10 agents, officials_stats: 9→10
2026-02-27 00:03:35 +08:00
cft0808
b8d06a3972 feat: 完成全部剩余功能修复 (P0-P3)
P0:
- 圣旨模板下旨真正创建任务: 新增 POST /api/create-task
  前端 executeTemplate 改为 API 调用(降级仍可剪贴板复制)

P1:
- morning-config POST 字段校验: 检查 categories/keywords/feishu_webhook 类型
- 早报幂等锁支持 --force 强制采集: 看板手动刷新默认 force=true
- sync_agent_config 补全 Copilot 模型列表(6个)

P2:
- utils.py 公共函数抽取: read_json/now_iso/validate_url/safe_name
- refresh_live_data.py 改用 utils.read_json 消除重复定义
- apply_model_changes 回滚标记: 失败时 rolledBack=true 写入日志+前端展示
- 早报日期 API 兼容 YYYY-MM-DD 自动转换 + 格式校验
- Request logging: log_message 改为只记录 4xx/5xx 错误请求
- 飞书 Webhook URL 校验: 限制 https + open.feishu.cn 域名

P3:
- 御批模式基础实现: Review/Menxia 状态显示准奏/封驳按钮
  新增 POST /api/review-action(approve推进/reject退回中书省+轮次+1)
  前端 reviewAction() + 变更日志回滚标记显示
2026-02-26 21:42:13 +08:00
cft0808
efd36ab729 feat: 添加 Copilot 模型配置 + 旨意看板归档功能
模型配置:
- 新增 Copilot 系列模型 (Claude Sonnet 4, Claude Opus 4.5, GPT-4o, Gemini 2.5 Pro, o3-mini)
- 新增 github-copilot/claude-opus-4.6 模型

旨意看板归档:
- 看板顶部新增筛选栏: 进行中 / 已归档 / 全部
- Done/Cancelled 状态自动归入归档视图
- 支持单条归档/取消归档操作
- 支持一键归档所有已完成任务
- 归档卡片虚线边框半透明展示
- Tab 徽章仅统计活跃旨意数

其他:
- agents SOUL.md 更新
- 脚本健壮性改进 (file_lock, refresh, sync)
2026-02-26 21:09:05 +08:00
cft0808
5b46f67603 🏛️ init: 三省六部 OpenClaw Multi-Agent Orchestration System
Features:
- 9 specialized agents (中书省·门下省·尚书省 + 六部)
- Real-time dashboard with 6 tabs (Overview/Kanban/History/Timeline/Models/Skills)
- Model configuration with live-apply via local API server
- One-click install script
- Data sync pipeline (15s refresh loop)
- Full audit trail via flow_log
2026-02-23 22:34:55 +08:00