Skip to content

Fix rolex#559

Merged
dfwgj merged 7 commits intomainfrom
fix-rolex
Mar 7, 2026
Merged

Fix rolex#559
dfwgj merged 7 commits intomainfrom
fix-rolex

Conversation

@dfwgj
Copy link
Collaborator

@dfwgj dfwgj commented Mar 7, 2026

概述

本次更新为 RoleX V2 带来了完整的认知循环支持,修复了关键的 plan/todo
操作问题,并优化了大禹迁移功能。同时改进了用户体验,为 V2 用户提供了专属的快捷入口。

✨ 主要功能

🎯 核心操作支持

  • want - 制定产品目标
  • plan - 为目标制定执行计划
  • todo - 创建具体任务
  • finish - 完成任务
  • achieve - 达成目标,沉淀经验
  • focus - 查看当前进行中的工作
  • abandon - 放弃目标/任务

🧠 自我沉淀(学习循环)

  • reflect - 反思遇到的问题,创建经验
  • realize - 总结领悟的原则
  • master - 沉淀为标准操作流程(SOP)
  • synthesize - 向其他角色传授知识
  • forget - 遗忘过时的知识

🔧 关键修复

1. 修复 RoleX V2 plan/todo 操作失败 (#faf7f75)

问题: plan 操作后执行 todo 操作失败,报错 "No focused plan"

根本原因: plan 操作未传递 id 参数,导致 focusedPlanId 未设置

修复内容:

  • 升级所有 RoleX 包从 1.1.0 到 1.3.0
  • 修复 RolexBridge.plan() 接收和传递 id, after, fallback 参数
  • 修复 RolexActionDispatcher._plan() 传递所有参数
  • 更新 MCP 工具描述,添加关键警告

影响: 现在 plan → todo 流程可以正常工作

2. 修复大禹迁移功能 (#3208cb4)

问题: 大禹的迁移文档是为 RoleX 0.11.0(文件系统)设计的,不适用于 RoleX 1.3.0(数据库)

修复内容:

  • 移除过时的 "born → activate → synthesize" 流程
  • 更新为正确模式:synthesize 直接传入 targetRole 参数
  • 添加职位命名规范:"角色名+岗位"格式
  • 说明 appoint 的 position 必须与 establish 的 name 一致
  • 基于实际迁移经验更新文档

影响: V1 到 V2 角色迁移现在可以正常工作

3. 修复通知自动合并问题 (#70dec5a)

问题: 新通知不会出现在已有通知数据中

修复内容:

  • 修改 getNotifications() 自动检测新通知
  • 自动合并新通知到现有列表前面
  • 保留现有通知的已读状态

影响: 用户重启后能看到新通知

🎨 用户体验改进

1. AgentX 欢迎页面 V2 专属预设 (#91a6793)

添加两个 V2 专属预设问题(仅在系统设置开启 V2 时显示):

  • "激活大禹帮我把v1迁移到v2"
  • "查看我现在的组织架构"

布局优化:

  • V2 关闭:2 列布局(4 个问题)
  • V2 开启:3 列布局(6 个问题)

2. 记忆工具智能引导 (#4b71b5c)

当 V2 角色使用 remember/recall 工具时:

  • 提供清晰的错误提示
  • 引导使用 action 工具的认知循环操作
  • 提供完整的示例代码

3. 版本更新通知 (#5b8dc6a)

添加 v2.2.1 版本更新通知,展示:

  • 核心操作列表
  • 自我沉淀功能
  • 大禹迁移修复

📝 文档更新

MCP 工具描述

  • 添加完整的 V2 学习循环示例
  • 添加职位命名规范说明
  • 强调 plan 操作必须传入 id 参数
  • 更新组织操作示例

大禹角色文档

  • migration-workflow.execution.md - 更新迁移工作流
  • rolex-api.knowledge.md - 更新 API 速查表
  • 添加实际迁移经验和最佳实践

⚠️ 重要提示

plan 操作关键要点

plan 操作必须传入 id 参数,否则后续 todo 操作会失败:

// ❌ 错误
{ "operation": "plan", "role": "_", "source": "..." }

// ✅ 正确
{ "operation": "plan", "role": "_", "source": "...", "id": "my-plan" }

职位命名规范

- establish 创建职位时,name 必须是"角色名+岗位"格式(如"产品经理岗位")
- appoint 任命时,position 参数必须与 establish 的 name 完全一致
- 验证方式:用 directory 检查 members 列表

📊 变更统计

- 14 个文件修改
- 378 行新增,77 行删除
- 7 个提交

主要文件变更

- packages/core/ - RoleX 核心修复
- packages/mcp-server/ - 工具描述更新
- packages/resource/ - 大禹文档更新
- apps/desktop/ - UI 和通知改进

🧪 测试建议

1. 测试 plan → todo 流程
// 1. 创建计划
{ "operation": "plan", "role": "_", "source": "Feature: 测试计划...", "id": "test-plan" }

// 2. 创建任务
{ "operation": "todo", "role": "_", "source": "Feature: 测试任务..." }
2. 测试大禹迁移
  - 激活大禹
  - 迁移一个 V1 角色到 V2
  - 验证职位命名规范
3. 测试 V2 预设问题
  - 开启 V2 设置
  - 重启应用
  - 检查 AgentX 欢迎页面是否显示 6 个预设问题
4. 测试通知
  - 重启应用
  - 检查是否显示 v2.2.1 更新通知

dfwgj and others added 7 commits March 7, 2026 10:57
Fixed "No focused plan" error that occurred when executing todo operations
after plan operations. The root cause was that the plan operation wasn't
passing the id parameter through the call chain, preventing focusedPlanId
from being set in the context.

Changes:
- Upgrade all RoleX packages from 1.1.0 to 1.3.0
- Fix RolexBridge.plan() to accept and pass id, after, fallback parameters
- Fix RolexActionDispatcher._plan() to pass all parameters to bridge
- Update MCP tool description with critical warning about plan requiring id
- Add comprehensive examples for complete V2 learning cycle workflow

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Updated dayu (role migration agent) documentation to reflect RoleX 1.3.0
database storage behavior and correct usage patterns based on actual
migration experience.

Key changes:
- Remove outdated "born → activate → synthesize" workflow
- Update to correct pattern: synthesize accepts targetRole parameter directly
- Add critical position naming convention: "角色名+岗位" format required
- Document that appoint's position parameter must match establish's name exactly
- Add verification method: use directory to check members list
- Update MCP tool examples with proper Chinese position names

Based on real migration workflow documented in 流程.txt showing successful
migrations without activate step between born and synthesize operations.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Added notification for v2.2.1 release highlighting RoleX V2 cognitive cycle
support and Dayu migration fixes.

Changes:
- Add v2.2.1 notification to notification center
- Document core operations: want, plan, todo, finish, achieve, focus, abandon
- Document self-reflection cycle: reflect, realize, master, synthesize, forget
- Highlight Dayu migration feature fix for V1 to V2 role migration
- Add both Chinese and English translations

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…r/recall

Updated remember and recall tools to provide helpful guidance when used with
V2 roles, directing users to the appropriate action tool operations instead.

Changes:
- remember tool: Guide V2 roles to use reflect/realize/master/synthesize/forget
- recall tool: Guide V2 roles to use identity/focus for knowledge queries
- Add detailed examples showing correct action tool usage
- Explain that V2 roles use database storage and cognitive cycle system
- Maintain backward compatibility for V1 roles (DPML format)

This improves user experience by providing clear migration paths from V1
memory tools to V2 cognitive cycle operations.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Added two new preset questions that only appear when V2 is enabled:
- "Activate Dayu to migrate v1 roles to v2"
- "View current organization structure"

Changes:
- Add dayu and directory preset questions to i18n files (zh-CN and en)
- Update WelcomePage to fetch V2 config on mount
- Conditionally show V2-only questions based on enableV2 setting
- Adjust grid layout: 2 columns (V2 off) or 3 columns (V2 on)
- Add GitBranch and Users icons for new presets

This provides quick access to V2-specific features for users who have
enabled RoleX V2 in system settings.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fixed issue where new notifications wouldn't appear after app restart
because localStorage already contained old notification data.

Changes:
- Modified getNotifications() to check for new default notifications
- Compare existing notification IDs with default notifications
- Auto-merge new notifications to the front of the list
- Preserve existing notifications and their read status

Now when users restart the app, they will see new notifications even if
they already have notification data in localStorage.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Updated changeset file with detailed release notes covering all changes
in v2.2.1 release.

Highlights:
- RoleX V2 complete cognitive cycle support (want/plan/todo/finish/achieve/focus/abandon)
- Self-reflection cycle (reflect/realize/master/synthesize/forget)
- Fixed plan/todo operations failure (plan requires id parameter)
- Fixed Dayu migration feature for RoleX 1.3.0
- Updated remember/recall tools to guide V2 roles to action tool
- Added V2-only preset questions to AgentX welcome page
- Fixed notification auto-merge issue
- Added position naming convention documentation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dfwgj dfwgj merged commit 667ef7d into main Mar 7, 2026
@dfwgj dfwgj deleted the fix-rolex branch March 7, 2026 04:09
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.

1 participant