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
Matt Van Horn
f4a019a88d
feat: add smooth animations to kanban dashboard ( #293 )
...
添加卡片加载渐入动画、主题切换平滑过渡、Tab 数字计数器动画,纯 CSS + vanilla JS,尊重 prefers-reduced-motion
2026-04-20 00:23:01 +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
cft0808
f41c981a19
fix(dashboard): 统一所有时间字段为本地时区展示 ( #277 )
...
将流转日志、会话详情、奏章时间线、巡检报告中的原始 substring
时间提取替换为 parseDateFlexible + 本地格式化,消除 UTC/本地混用。
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-04-14 23:05:15 +08:00
cft0808
70cd997a25
fix(court_discuss): 动态 max_tokens + 截断 JSON 修复 ( #265 )
...
- 根据参与官员数量动态计算 token 预算 (每位官员 300 + 200 基础)
- 新增 _try_repair_truncated_discuss() 从截断的 JSON 中提取完整消息
- 更新 .gitignore 防止追踪本地开发文件
2026-04-10 01:05:00 +08:00
cft0808
65c09cb94f
chore: remove unrelated tracked files and update .gitignore
...
- Remove .vite/ cache directory from tracking
- Remove .vscode/settings.json (IDE-specific)
- Remove stale dashboard/dist build assets (old hashes)
- Remove root PDF duplicate of edict_agent_architecture.md
- Add .vite/ and .vscode/ to .gitignore
2026-04-05 22:19:38 +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
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
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
f31d1a7843
feat: add feedback button '祈告上苍' to dashboard header ( #98 )
...
- Opens GitHub issue creation with bug/feature templates
- Pre-fills title prefix and body template based on type
- Auto-sets appropriate label (bug/enhancement)
Closes #98
2026-03-26 22:06:58 +08:00
cft0808
1b506312a2
feat: add light/dark theme toggle to dashboard ( #152 )
...
- Add light theme CSS variables (html.light)
- Add toggle button in header with localStorage persistence
- All existing elements auto-adapt via CSS custom properties
Closes #152
2026-03-26 22:04:59 +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
Matt Van Horn
fb0a8fb0a7
fix(dashboard): stop auto-archiving Done/Cancelled tasks in UI filter ( #147 )
...
The isArchived() function treated all Done/Cancelled tasks as archived,
hiding them from the active view immediately on completion. This caused
tasks with incomplete progress to appear archived prematurely.
Change isArchived() to only check the explicit archived flag, matching
the server-side archival logic. Done tasks now stay visible until the
user explicitly archives them.
Fixed in both dashboard/dashboard.html and edict/frontend/src/store.ts.
Note: dashboard/dist/ needs a rebuild (npm run build) to pick up the
React source change.
Closes #54
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 22:19:27 +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
29fae3fb25
feat(ui): implement remote skills management panel
2026-03-02 07:28:15 +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
5bf2aa6c62
fix: 天下要闻采集后自动刷新
...
根因: refreshNews() 用固定 setTimeout(45s) 等待采集完成,
期间无轮询反馈,用户看不到更新。loadAll() 5秒轮询
也不包含 loadMorning(),在要闻页面停留不会自动刷新。
修复:
- refreshNews: 采集前记录旧时间戳,采集后每5秒轮询API
检测 generated_at 是否变化,一旦检测到更新立即刷新
页面并提示成功(最长2分钟超时)
- loadAll: 在天下要闻 tab 且不在采集轮询中时,随5秒
周期自动刷新要闻数据
2026-03-01 15:47:45 +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
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
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
8a639991f8
fix: 修复dashboard.html JS语法错误导致页面空白
...
模板字面量中 ${ } 表达式缺少闭合花括号,导致整个 script 块无法执行
2026-02-26 22:57:52 +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