feat: 落地 Agent 三模式与审批流水线 - #27
Merged
Merged
Conversation
- 在 `coordinator.go` 中实现了 Agent 状态的创建、会话标记、作业投递、步骤领取、状态加载、事实追加、步骤提交、取消请求和活跃恢复等功能。 - 删除了 `map.go` 文件,移除了不再使用的映射函数。 - 更新 `memory_index.go` 和 `worker.go`,优化了索引压缩和作业执行逻辑。 - 在 `persist.go` 中简化了数据库操作,移除了冗余的事件发布逻辑。 - 新增了测试文件 `fixture_test.go`,为 API 和运行时提供了基础测试框架。 相关功能尚待完善,包括数据库写入和事件发布的完整实现。后续将继续优化和扩展功能。
- 新增 `coordinator_test.go` 和 `runtime_more_test.go` 文件,包含对 Agent 状态管理功能的全面测试。 - 在 `coordinator.go` 中实现了 Agent 状态的创建、会话标记、步骤领取等功能,并优化了状态加载逻辑。 - 更新 `worker.go`,增强了作业执行和取消请求的处理。 - 在 `map.go` 中添加了数据库映射函数,简化了数据操作。 相关功能的测试用例确保了 Agent 的稳定性和可靠性,后续将继续扩展功能和测试覆盖率。
- 在 `index.ts` 中新增 `isRecoverableRun` 和 `RECOVERABLE_RUN_STATUSES`,以支持可恢复运行状态的管理。 - 在 `client.ts` 中实现 `getRun` 和 `continueRun` 方法,允许获取和继续运行。 - 更新 `types.ts`,定义 `Run` 接口及相关状态,增强类型安全。 - 在 `chat-page.tsx` 和 `session-sidebar.tsx` 中添加恢复按钮,提升用户交互体验。 - 在 `use-session-timeline.ts` 中实现恢复逻辑,支持自动检测可恢复的运行状态。 这些改进提升了系统的稳定性和用户体验,后续将继续优化相关功能。
- 修改 `package.json` 中的开发脚本,使用 `concurrently` 同时启动 API 和 Web 服务,提升开发效率。 - 在 `pnpm-lock.yaml` 中添加 `concurrently` 作为开发依赖,确保环境一致性。 - 更新 `README.md`,明确一条命令同时启动 API 和 Web 的使用说明。 - 在 `core` 包中新增审批相关功能,包括 `listApprovals` 和 `getApproval` 方法,增强审批管理。 - 在 `chat` 相关模块中添加审批处理逻辑,支持审批记录的应用与决策。 这些改进提升了开发体验和审批功能的可用性,后续将继续优化相关功能。
- 在 `conversation-timeline.tsx` 中实现用户消息的编辑功能,允许用户修改排队中的消息内容。 - 在 `router.go` 中新增 PATCH 路由以支持消息更新。 - 在 `message.go` 中实现 `UpdateMessage` 方法,处理消息内容的更新逻辑。 - 添加 `message_update_test.go` 测试文件,验证只有排队中的消息可以被编辑,并确保其他状态的消息编辑请求被拒绝。 - 更新数据库查询以支持消息内容的更新。 这些改进增强了用户交互体验,后续将继续优化消息管理功能。
- 在 `architecture.md` 中更新了关于同一会话的活动运行管理逻辑,确保在已有活动时返回 409 错误。 - 在 `core` 包中新增 `joinQueuedTexts` 函数,处理待发送文本的合并逻辑。 - 更新 `package.json` 中的测试脚本,添加对 `queue.test.ts` 的支持。 - 在 `chat` 模块中移除不再使用的 `updateMessage` 方法,简化代码。 - 新增 `queue.test.ts` 测试文件,验证 `joinQueuedTexts` 函数的正确性。 - 在 `ui` 组件中调整了文本样式,提升用户界面的可读性。 这些改进提升了消息处理的灵活性和用户体验,后续将继续优化相关功能。
- 在 `client.ts` 中新增 `archiveSession` 方法,支持归档会话。 - 在 `session-sidebar.tsx` 中添加删除按钮,允许用户删除会话并确认操作。 - 更新 `use-session-list.ts` 中的 `removeSession` 方法,处理会话删除逻辑并刷新会话列表。 - 在 `chat-page.tsx` 中实现会话删除后的处理逻辑,确保用户体验流畅。 这些改进增强了会话管理功能,提升了用户交互体验。
创建会话时在 Handler 冻结 workspace_id,Git 带 session_id 时用该目录;未设 DB_DSN 时 SQLite 写仓根 data/。 Co-authored-by: Cursor <cursoragent@cursor.com>
把 read/write/edit/ls/grep/find/bash/powershell 和 plan_* 接到 Ports,Inspect 拦目录外路径;工作区写入 Current working directory。 Co-authored-by: Cursor <cursoragent@cursor.com>
三个内置 Agent 共用全量工具表,mode 只冻可执行 Names 与模式规则;目录外路径必须审批,yolo 也不能抬成放行。 Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-authored-by: Cursor <cursoragent@cursor.com>
SATA260
force-pushed
the
feat/agent-modes
branch
from
September 14, 2026 07:29
6e27d2a to
ead4d6a
Compare
## Summary - 更新 `callToolsBatch` 方法以支持在自动审批模式下先进行复审,复审通过后直接执行工具,未通过则等待人工审批。 - 添加 `reviewThenDispatch` 函数以处理复审逻辑,确保在自动模式下的工具事件不会提前触发。 - 修改相关测试用例以验证新的自动审批逻辑和工具事件的正确性。 ## Test plan - [ ] 运行所有单元测试以确保新逻辑的正确性。 - [ ] 验证在自动审批模式下,工具事件的触发顺序符合预期。 Closes #26
## Summary - 新增 `TestReviewerPromptStatesCriteria` 测试用例,验证复审提示中包含的状态信息。 - 更新 `reviewerPrompt` 函数,详细描述审核标准和输出格式,确保提示内容更清晰。 ## Test plan - [ ] 运行所有单元测试以验证新测试用例的正确性。 - [ ] 确保 `reviewerPrompt` 输出符合预期的审核标准和格式。
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.
Summary
mode只冻可执行Names与一条 developer 模式规则。Names→ AgentEffects表 →manual/auto/yolo。目录外必须 ask,Agent 表和 yolo 都不能抬成 allow。auto开单后由独立复审模型填单,失败则升级给人。前端拆成工作模式与审批两个菜单。Closes #20
Test plan
cd server && go test ./...pnpm test:client.cursor/*.md