49 Commits

Author SHA1 Message Date
cft0808
ae3942bc87 fix: 兼容 Windows 系统的 Python 解释器路径查找
在 Windows 上不存在 python3 命令,subprocess 调用会抛出 [WinError 2]。
在 utils.py 中新增 python_bin() 函数,优先使用 sys.executable(当前解释器路径),
回退到 shutil.which('python3') / shutil.which('python'),确保全平台兼容。
server.py 和 kanban_update.py 中所有硬编码的 'python3' 替换为 python_bin()。

Closes #289
2026-04-27 22:42:06 +08:00
voidborne-d
714f442e31 fix: eliminate TOCTOU race in task mutation paths
Background dispatch threads, the periodic scheduler scan, and HTTP
handlers all followed a load_tasks() → modify → save_tasks() pattern
without any mutual exclusion.  The atomic_json_write only protects the
write itself; it does NOT prevent a concurrent reader from loading a
stale snapshot and overwriting another thread's changes.

Scenario (before this fix):
  1. HTTP handler calls load_tasks() — gets snapshot A
  2. Dispatch thread calls load_tasks() — gets the same snapshot A
  3. HTTP handler modifies task X, calls save_tasks() — writes A'
  4. Dispatch thread modifies task Y, calls save_tasks() — writes A''
     (based on A, not A'), silently losing the HTTP handler's changes
     to task X

This is a classic TOCTOU (Time-of-Check-Time-of-Use) race.  The project
already has atomic_json_update() in file_lock.py that holds an exclusive
lock for the entire read-modify-write cycle, but none of the task
mutation paths used it.

Fix:
- Add modify_tasks(modifier) wrapper around atomic_json_update +
  refresh trigger
- Add modify_task(task_id, updater) convenience wrapper for single-task
  mutations
- Convert _update_task_scheduler (called from dispatch daemon threads)
  to use modify_task
- Convert handle_scheduler_scan (periodic background scanner) to use
  modify_tasks, with dispatch side-effects deferred until after the
  lock is released
- Convert handle_scheduler_retry and handle_scheduler_rollback to use
  modify_task

HTTP handler paths (handle_task_action, handle_review_action, etc.)
still use load_tasks/save_tasks for now — they run in the main thread
and are lower risk — but can be migrated incrementally.

Add 17 regression tests covering: atomic API correctness, scheduler
update persistence, scan stall detection, concurrent write survival
(the actual race), source-level audit of critical paths, and backward
compatibility of load_tasks/save_tasks.
2026-04-22 06:00:26 +00:00
cft0808
96abcd12ec fix: normalize timestamps in SessionsPanel and server lastActive (#278 cherry-pick)
Cherry-pick the SessionsPanel.tsx and server.py fixes from PR #278
that were not covered by the merged #282:
- SessionsPanel: use shared formatDashboardTime for activity timestamps
- server.py: convert lastActive to local timezone in get_task_activity()
2026-04-20 00:25:18 +08:00
狼哥
c958d06cb4 fix(flow): prevent premature task completion before review (#280)
cmd_done() 不再直接写 Done,改为校验 todos 完成度后路由到 Review;dashboard 准奏也增加 todo 完成度门控,防止子任务未完成就关闭任务
2026-04-20 00:17:01 +08:00
狼哥
78f54655cc fix(dashboard): handle missing OpenClaw CLI during dispatch (#290)
Windows 环境下 OpenClaw CLI 未在 PATH 时,subprocess 抛出 WinError 2。新增 shutil.which 解析和 OPENCLAW_BIN 环境变量支持,将原始错误转为可操作的 openclaw-missing 状态
2026-04-20 00:16:51 +08:00
Sebastion
c3c4e2a71f fix: CWE-22 path traversal in file:// URL handling (#258)
fix: apply allowed_roots check to file:// URLs in add_remote_skill (CWE-22)\n\nAdds .resolve() and allowed_roots validation to the file:// URL branch\nin add_remote_skill(), closing a path traversal vulnerability.\nIncludes 3 regression tests.
2026-04-05 21:48:44 +08:00
cft0808
4e51e348a5 fix: 修复任务卡死三大问题
1. Gateway检测增加重试机制(3次+递增等待),避免瞬时不可达直接放弃
2. 新增定时巡检线程(每120秒),自动发现停滞任务并触发重试/升级/回滚
3. 回滚增加次数上限(最多3次),超限自动标记Blocked防止无限循环
2026-04-05 14:51:34 +08:00
cft0808
74d8130391 feat: Week 0-4 optimizations - event bus, state machine, dispatch, outbox relay
- EventBus: Redis Streams pub/sub for decoupled service communication
- State machine: strict lifecycle transitions with audit logging
- Dispatch worker: parallel execution, retry with backoff, resource locking
- Orchestrator: DAG-based task decomposition and dependency resolution
- Outbox relay: transactional outbox pattern for reliable event delivery
- Auth: dashboard authentication module
- Agent groups: sansheng/liubu agent configuration
- CI/CD: Docker publish workflow, systemd service, start script
- Frontend: dashboard build assets
- Tests: state machine consistency tests
2026-04-04 12:16:32 +08:00
cft0808
18c15209ca feat: free-form edict input + task output viewer (#92, #29)
- Add '自由下旨' textarea in templates tab for natural language edicts
- Add /api/task-output/<id> endpoint to read deliverable content
- Add '查看奏章' button in memorial modal to load output inline

Closes #92, Closes #29
2026-03-26 22:14:01 +08:00
cft0808
7cb0a6ad12 feat: multi-workspace task data auto-detection + time parsing improvements
- Auto-detect task data dir from ~/.openclaw/workspace-*/data (#117)
- Score and select best task source (non-demo tasks preferred)
- Update healthz and live-status to use detected data dir
- Add robust parseDateFlexible() for timestamp handling (#67)
- Add UTF-8 encoding to file_lock reads for Windows compat (#96)
- Use absolute path in install.sh hint (#107)

Closes #117, Closes #107
2026-03-26 21:59:35 +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
cft0808
f237fd6834 fix: dispatch 不再默认传 --deliver --channel feishu,避免非飞书用户报错 (#182)
将 dispatchChannel 默认值从 'feishu' 改为空字符串。
仅当 agent_config.json 中显式配置了 dispatchChannel 时才传
--deliver --channel 参数,避免未配置飞书的用户(telegram/wecom
等)遇到 'unknown channel: feishu' 错误。

Fixes #182
2026-03-25 22:29:11 +08:00
maka
dcba308778 fix: dashboard 端口支持通过 --port/EDICT_DASHBOARD_PORT 配置 (#173)
run_loop.sh 中 scheduler-scan 的 curl 地址硬编码为 7891,与
server.py 的 --port 参数不一致,导致改变端口后 loop 无法调用
dashboard API。

- run_loop.sh:从 EDICT_DASHBOARD_PORT 环境变量读取端口(默认 7891)
- server.py:启动时根据 --port 动态更新 _DASHBOARD_PORT 和
  _DEFAULT_ORIGINS,修正 CORS fallback 地址

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: cft0808 <41196455+cft0808@users.noreply.github.com>
2026-03-25 00:28:04 +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
689b1eafbf fix: 流程一致性审计修复 + 文档更新
状态机:
- kanban_update.py 新增 _VALID_TRANSITIONS 校验, 非法状态跳转被拒绝
- _STATE_AGENT_MAP['Taizi'] 从旧 ID 'main' 修正为 'taizi'

数据一致性:
- zaochao emoji 前后端统一为 📰 (store.ts + dashboard.html)
- zaochao org '朝报司' 修正为 '钦天监' (sync_from_openclaw_runtime.py)
- server.py _MIN_TITLE_LEN 10→6, 与 kanban_update.py 保持一致
- schema.json 从 v2 重写为 v3, 对齐实际 11 状态 + 14 字段 + 11 角色

安装:
- install.sh first_sync 补充 sync_officials_stats.py 调用

文档:
- README 新增朝堂议政面板说明 + 状态机校验说明 + install 步骤更新
- CONTRIBUTING 更新测试断言数 + 新增 court_discuss.py 条目
2026-03-16 00:19:57 +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
6b3ab88128 refactor: 消除冗余I/O、去重复定义、补全测试覆盖
- kanban_update.py: 提取 _trigger_refresh(),消除 save(load()) 双重 I/O
  每次任务操作节省一次 fcntl 锁 + 读文件 + 写文件的冗余开销
- kanban_update.py + server.py: now_iso/read_json 统一从 utils 导入,
  删除本地重复实现,移除未使用的 datetime/atomic_json_write 导入
- server.py: 修复 yaml import 静默失败——分离 ImportError 与 YAML 语法错误,
  先做字符串结构校验(无需 PyYAML),再严格验证语法
- tests/test_kanban.py: 测试数从 3 增至 8,补全 cmd_flow/cmd_done/
  cmd_progress/cmd_todo/progress_log_capped 覆盖
- run_loop.sh: 补充第二参数(巡检间隔)文档注释
- install.sh: 删除 Python heredoc 中无效的 __file__ 判断死代码

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 22:18:11 +08:00
cft0808
709e163932 feat: 添加远程 Skills 资源管理功能
新增远程 skill 管理系统,支持从 GitHub/HTTPS URL 获取:
- API 端点: add-remote-skill, remote-skills-list, update-remote-skill, remove-remote-skill
- CLI 工具: scripts/skill_manager.py (add-remote, list-remote, update-remote, remove-remote, import-official-hub)
- 文档: remote-skills-guide.md 和 remote-skills-quickstart.md
- 功能: 安全验证、YAML 校验、版本管理、多渠道操作
2026-03-02 06:21:28 +08:00
cft0808
1691ac1a2e feat: 推进后自动派发Agent + Todo详情展开
1. 自动流转机制:
   - 新增 dispatch_for_state() 函数,根据状态自动匹配并派发 Agent
   - handle_advance_state() 手动推进后自动派发对应 Agent(不再只改状态)
   - handle_review_action() 准奏/封驳后自动派发下一环节 Agent
   - 每个状态对应针对性的派发消息(含任务ID+标题+上下文)
   - 后台异步派发,带2次重试 + Gateway 存活检测

2. Todo 子任务详情功能:
   - kanban_update.py cmd_todo() 新增 detail 参数(--detail 标志)
   - 前端 todo-item 支持点击展开/收起详情
   - 有详情的 todo 显示 ▶ 展开箭头,点击展开显示产出内容

3. Agent SOUL 文件更新:
   - 中书省/尚书省/六部(工兵户礼刑)均添加 todo --detail 命令说明
   - 指引Agent在完成子任务时上报具体产出详情
2026-03-01 14:58:22 +08:00
cft0808
b7ad34a8d1 fix: 修复任务卡住根因 — agent ID main→taizi + 派发重试
根因分析:
1. dispatch_to_agent 使用 --agent main,但 main 未注册到 Gateway
   → 每次派发静默失败: Unknown agent id "main"
2. LLM provider 偶发超时导致单次派发丢失
3. 僵尸 openclaw-agent 进程残留

修复:
- dispatch_to_agent: --agent main → --agent taizi(Gateway 注册名)
- wake_agent: 移除 taizi→main 映射,直接使用 agent_id
- _STATE_AGENT_MAP: Taizi 映射从 main 改为 taizi
- _AGENT_DEPTS: 移除重复的 main 条目
- dispatch_to_agent: 增加最多3次重试(指数退避 5s/10s)
- wake_agent: 增加最多2次重试
- 分离 TimeoutExpired 异常处理,日志更明确
2026-03-01 14:42:57 +08:00
cft0808
df13cbdfd8 feat: Agent 在线状态检测 + 唤醒 + 前置校验
server.py:
- 新增 get_agents_status(): 检测 Gateway 进程/probe + 各 Agent 状态
  - 读取 sessions.json 判断最后活跃时间 → running/idle/offline/unconfigured
  - 检测 openclaw-agent 进程、workspace 是否存在
  - Gateway HTTP probe (ws://127.0.0.1:18789)
- 新增 wake_agent(): 通过 openclaw agent --agent 发送唤醒消息
- 新增 /api/agents-status GET 端点
- 新增 /api/agent-wake POST 端点
- dispatch_to_agent 前置 Gateway 存活检查

dashboard.html:
- 省部调度 Tab 新增 Agent 状态面板
  - 12个 Agent 卡片,实时显示在线状态 (绿/黄/灰/红)
  - Gateway 状态指示器
  - 单个唤醒按钮 + 全部唤醒按钮
  - 运行中/待命/离线/未配置 汇总统计
- 切换到省部调度 Tab 自动加载状态
- 下旨前前置检测 Gateway 是否在线,不在线时警告
2026-03-01 13:40:57 +08:00
cft0808
3272b2639f feat: 五项功能增强 — 数据补全/阶段耗时/Todos进度/Done回顾/资源上报
server.py:
- get_task_activity 返回 taskMeta (title/state/org/output/block/priority等)
- 新增 _compute_phase_durations: 各阶段停留时长 + 总耗时
- 新增 _compute_todos_summary: 完成率汇总 (total/completed/percent)
- 新增 _compute_todos_diff: 连续 todos 快照差异 (changed/added/removed)
- progress/todos 条目保留 state/org 快照
- resourceSummary 汇总 tokens/cost/elapsed

kanban_update.py:
- cmd_progress 新增 tokens/cost/elapsed 可选参数
- CLI 解析 --tokens/--cost/--elapsed 标志
- 资源数据有值才写入 progress_log

dashboard.html:
- Done/Cancelled 任务显示"执行回顾"(单次拉取不轮询)
- 阶段耗时时间线条形图 + 总耗时
- Todos 进度条 (百分比 + 三色条)
- 资源消耗汇总卡片 (tokens/cost/elapsed)
- Todos diff 高亮: 新增🆕/完成/变更↻/删除🗑
2026-03-01 13:15:21 +08:00
cft0808
b7bf616f06 refactor: 全面安全加固与代码优化 - TOCTOU竞态修复/CORS/XXE/SSRF/路径遍历/Docker加固 2026-03-01 12:59:24 +08:00
cft0808
5af9a581f4 fix: 修复get_task_activity逻辑问题 - agent归属判定优先状态映射
- agent_id不再被progress_log最后一条记录无条件覆盖
- 仅当状态映射无法确定agent时才降级使用最后上报者
- related_agents始终包含当前负责agent
- dashboard/kanban_update多处增量改进
2026-03-01 09:02:51 +08:00
cft0808
a5befd26c5 fix: 实时动态改为展示Agent自报进展,移除session日志抓取
- get_task_activity() 完全重写:只展示 flow_log + now(progress) + todos
- 不再从Agent session JSONL中抓对话日志(消除驴唇不对马嘴问题)
- 前端新增 flow/progress/todos 三种条目渲染
- 创建任务默认now改为'等待中书省接旨'(不再用套话'正在规划')
2026-02-27 23:09:50 +08:00
cft0808
81bb9c771f fix: 防止重复创建旨意任务 + 清理脏标题
问题:太子和中书省各调 kanban create 创建了两个相同任务
(JJC-002 和 JJC-004),且标题带'传旨:'前缀和元数据。

修复:
- zhongshu SOUL: 如果太子已提供任务ID,直接用 state 更新,
  不重复 create
- kanban_update.py: create 禁止覆盖 Done/Cancelled 状态的
  任务,提示用新ID
- _sanitize_title(): 新增剥离'传旨:'/'下旨:'前缀
- server.py: handle_create_task 同步添加前缀清理
- 清理了重复的 JJC-004 和垃圾 JJC-005
2026-02-27 20:28:42 +08:00
cft0808
5d3359dbf4 feat: 活跃任务展示 Agent 最新工作动态
当任务处于活跃状态(中书/门下/尚书/执行中等)但无精确匹配的活动
记录时,自动展示该 Agent 最新一轮对话段的实时动态。

- 新增 get_agent_latest_segment(): 读取 Agent 最新 session 的
  最后一条 user 消息起的对话内容
- 三级匹配策略: task_id精确 → 关键词匹配 → Agent最新对话段
- API 返回 activitySource 字段标识来源
  (task/keyword/agent_latest)
- Dashboard 显示黄色提示横幅区分 Agent 最新活动 vs 任务精确活动
2026-02-27 20:17:03 +08:00
cft0808
0c8ed57ee1 fix: 实时动态面板 — 关键词+对话段匹配替代盲目fallback
问题:任务的实时动态面板显示了其他对话/任务的活动(如 HEARTBEAT、早朝简报)。
根因:task_id 未匹配时,fallback 盲目返回 agent 最近全部活动。

修复:
- 新增 _extract_keywords():从任务标题提取 2-4 字中文词+英文词作为关键词
- 新增 get_agent_activity_by_keywords():
  1. 按关键词找到匹配的 session 文件
  2. 在 session 内按 user 消息分割对话段
  3. 只返回关键词匹配度最高的对话段内的活动
- 删除盲目 fallback(get_agent_activity(task_id=None))
- OC-* 任务直接读其关联的 session 文件
2026-02-27 20:11:51 +08:00
cft0808
e1314fb2e5 fix: 看板综合修复 — Pipeline/标题/kanban脚本/实时动态 2026-02-27 19:58:32 +08:00
cft0808
4791f4bfc9 fix: 实时活动面板修复 — 补全 Next/Pending 状态映射
- _STATE_AGENT_MAP 新增 Next(从org推断) 和 Pending(默认zhongshu)
- _ORG_AGENT_MAP 新增 中书省/门下省/尚书省 映射
- _STATE_FLOW 新增 Pending→Taizi 和 Next→Doing 推进路径
- _STATE_LABELS 补全 Pending/Next
- 修复 state=='Doing' 才走 org 推断的限制, 扩展到 Next 状态
2026-02-27 19:38:20 +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
21ffb94335 fix: 活动面板按任务ID过滤 + 派发改走太子Agent
问题1: 实时动态面板显示所有对话,不是该任务的也在
  - get_agent_activity() 新增 task_id 参数,过滤内容含任务ID的条目
  - get_task_activity() 搜索所有相关Agent的session(从flow_log推断)
  - 跨多个session文件搜索(最近3个),按时间排序
  - 前端显示agent来源标签(中书省/门下省/太子等)

问题2: 模板旨意派发后依然卡住
  - dispatch_to_agent 改为发送给 main agent(太子)而非zhongshu
  - 太子是入口Agent,走正常流程: 太子→中书省→门下省→尚书省
  - 消息明确标注'看板已有记录,请勿重复创建'避免重复建任务
2026-02-26 23:48:43 +08:00
cft0808
b6ad8d1646 feat: 实时动态面板 + 模板旨意自动派发
1. 自动派发: 模板创建旨意后自动发送给中书省 Agent 执行
   - handle_create_task 添加 dispatch_to_agent() 后台线程
   - 通过 openclaw agent CLI 触发 zhongshu agent

2. 实时动态 API:
   - GET /api/task-activity/<task_id> 获取任务关联 Agent 活动
   - GET /api/agent-activity/<agent_id> 获取 Agent 最新活动
   - 从 ~/.openclaw/agents/<id>/sessions/*.jsonl 读取
   - 解析 assistant/tool_use/toolResult/user 消息

3. Dashboard 实时动态面板:
   - 任务详情模态框底部显示 Agent 实时活动日志
   - 每 4 秒自动刷新, 类似 VS Code Copilot 实时输出
   - 图标区分: 🤖助手 💭思考 🔧工具 结果 📥用户
   - 自动检测活跃状态(5分钟内有活动=绿灯)
   - 关闭模态框自动停止轮询
2026-02-26 23:23:04 +08:00
cft0808
434ba2ebc0 fix: 任务创建时org应为中书省而非模板执行部门
- server.py: handle_create_task 创建时 org 固定为中书省
  模板执行部门改存 targetDept 供尚书省派发参考
- kanban_update.py: cmd_create 根据 STATE_ORG_MAP 推导 org
  cmd_state 更新状态时自动同步 org 字段
- dashboard.html: executeTemplate 传 org=中书省, targetDept=模板部门
- 修复已有任务 JJC-20260226-011 数据(兵部→中书省)
2026-02-26 23:05:30 +08:00
cft0808
3b87c30efa refactor: 严格三省六部制流程 - 新增太子分拣+门下回传中书
- 新增 agents/taizi/SOUL.md: 太子角色负责分拣飞书消息
- 重写 zhongshu SOUL.md: 接收太子需求起草方案送门下审议
- 重写 menxia SOUL.md: 审议后封驳结果回传中书省
- 重写 shangshu SOUL.md: 接收准奏方案分派六部汇总回太子
- 重写五部 SOUL.md: 全部改用 CLI 命令
- dashboard/server/kanban 新增 Taizi 状态支持

完整流程: 皇上-太子(分拣)-中书(起草)-门下(审议)-尚书(派发)-六部(执行)-尚书(汇总)-太子(回奏)-皇上
2026-02-26 22:48:47 +08:00
cft0808
f26127af75 fix: 修复任务流程卡住问题 — SOUL.md 全面改用 CLI 命令
根因:SOUL.md 中的内联 Python 用 pathlib.Path(__file__) 定位路径,
但 Agent 运行时 __file__ 不是 SOUL.md 路径,导致看板更新静默失败,
任务永远卡在 Zhongshu 状态。

修复:
- zhongshu/SOUL.md: 所有看板操作改用 kanban_update.py CLI 命令
- menxia/SOUL.md: 封驳/准奏操作改用 CLI 命令
- shangshu/SOUL.md: Doing/Review/Done 操作改用 CLI 命令
- 三个 SOUL.md 均加 ⚠️ 警告提示禁止自行读写 JSON
- server.py: 新增 /api/advance-state 手动推进接口
- dashboard.html: 新增「 推进到下一步」按钮(解卡用)
2026-02-26 22:10:24 +08:00
cft0808
d8a935196c fix: 防止闲聊被误建为旨意任务
- SOUL.md 增加旨意vs闲聊判定规则(最高优先级)
- kanban_update.py 增加标题质量校验(最短10字、垃圾词过滤、纯标点拒绝)
- server.py create-task API 增加同样校验
- 清理21条垃圾/重复JJC任务(否/?/开启了么/11条重复传旨调研等)
2026-02-26 21:57:36 +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
ff9ae7937f fix: 批量修复 P0-P2 功能缺陷
P0 修复:
- server.py 使用 file_lock 原子读写 tasks_source.json,防止并发数据丢失
- todayDone 统计改为按日期过滤,不再统计所有 Done 任务
- save_tasks() 的 Popen 加异常捕获

P1 修复:
- 模型列表动态化:优先从后端 knownModels 获取,不再纯硬编码
- 省部调度 Tab 补充钦天监 (zaochao) 部门
- 小任务筛选补充 刑部/门下省/钦天监 按钮
- 官员数据在 loadLive 时提前加载,省部调度不再显示'待配置'
- Docker demo 数据补全 tasks_source.json + morning_brief.json

P2 修复:
- 奏折复制补充 开始/完成时间、总耗时、磋商轮次
- /healthz 增强:检查 data 目录可写、tasks 文件可读
- metrics 新增 totalDone 字段区分总完成数和今日完成数
2026-02-26 21:21:58 +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
af59a09e30 feat: memorials + templates + ceremony + sessions + docs rewrite 2026-02-24 23:53:36 +08:00
cft0808
dade209ce6 fix: server.py BrokenPipe崩溃修复
- Handler.handle(): 捕获 BrokenPipeError/ConnectionResetError 防止崩溃
- send_json()/send_file(): 同样处理客户端断开场景
- 看板不再因浏览器刷新/关闭而整体宕机
2026-02-24 22:44:12 +08:00
cft0808
c6cf88b62d rename: 项目正式更名为 Edict
- 仓库重命名: openclaw-sansheng-liubu → edict
- README.md/README_EN.md: 标题+描述更新为 Edict
- Docker 镜像: cft0808/sansheng-demo → cft0808/edict
- 所有链接/引用统一更新
2026-02-24 22:29:43 +08:00
cft0808
0007991061 feat: 看板优化(皇上本地改动同步)
- dashboard.html: 界面优化
- dashboard/server.py: 后端优化
- scripts/kanban_update.py: 逻辑优化
- agents/shangshu/SOUL.md + agents/zhongshu/SOUL.md: 省部配置更新
2026-02-24 22:19:32 +08:00
cft0808
1110886de2 fix: 可移植性修复 + server.py 路由修复
- SOUL.md: 硬编码路径替换为 __REPO_DIR__ 占位符,支持跨环境部署
- dashboard/server.py: 修复 morning-brief/refresh 路由
  - 原错误:POST handler 混入 GET 分支导致永远 404
  - 修复:将 POST /api/morning-brief/refresh 移至 do_POST 正确位置
- scripts/: 路径变量改用 __file__ 相对路径,提升可移植性
- install.sh / run_loop.sh: 同步修复
2026-02-24 21:53:01 +08:00
cft0808
88c1836f9c feat: 早朝简报系统 - 每日6:00自动采集政治/军事/经济/AI新闻,图文并茂,中文翻译 2026-02-24 00:18:16 +08:00
cft0808
b8c8d22702 feat: 官员总览 - Token消耗/实际费用/功绩统计/心跳监控 2026-02-23 23:12:41 +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