feat(gateway): 接入计划审批 RPC#689
Merged
phantom5099 merged 3 commits intoMay 21, 2026
Merged
Conversation
关联 issue: 1024XEngineer#688 新增 gateway.approvePlan 协议、Gateway 分发与 Runtime bridge 适配,Web 端在最新 draft 计划上提供批准并执行入口。
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
保留计划审批拒绝当前 revision 后隐藏的产品语义,并将 Web 文案调整为需要修改。
覆盖 approve_plan 的网关校验、运行时端口缺失、多工作区路由错误和 bridge 访问拒绝分支。
Collaborator
Author
|
已补充计划审批链路的测试覆盖:
本地覆盖率检查中新增函数已提升到:validateApprovePlanFrame/decodeApprovePlanPayload/MultiWorkspaceRuntime.ApprovePlan/requirePlanApprovalRuntimePort 100%,handleApprovePlanFrame 88.5%,bridge ApprovePlan 91.7%。 已验证:
|
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.
背景
计划模式已经能生成带
plan_id与revision的 draft 计划,但 Web 端缺少一条经过 Gateway 的显式审批通道。用户同意计划后只能继续发送普通文本推动执行,计划审批语义无法被协议层校验,也无法稳定处理 revision 过期、计划 ID 不匹配或状态非法等场景。Closes #688
修改内容
gateway.approvePlanJSON-RPC 方法与approve_planFrame Action,补齐参数归一化、payload 校验、ACL、metrics、registry 与 dispatch 接入。PlanApprovalRuntimePort与 CLI bridge 适配,将计划审批请求收敛到 RuntimeApproveCurrentPlan,并把可预期业务拒绝映射为invalid_action。approvePlan调用;ChatPanel 对最新 draft 计划展示审批面板,支持以default或bypass权限模式批准后进入 build 执行,并在执行启动失败时提供重试入口。gateway.approvePlan的请求、响应和语义说明。验证
git diff --checkgo test ./internal/gateway ./internal/gateway/protocol ./internal/runtimego test ./internal/cli -run "ApprovePlan|ApproveCurrentPlan|GatewayRuntimePortBridge"cd web && npm test -- --runcd web && npm test -- --run src/api/gateway.test.ts src/components/chat/ChatPanel.test.tsx已知情况
go test ./...在本地 Windows 环境存在与本次改动无关的既有失败:internal/cli的 symlink 权限、临时 npm shim 与 web command 用例,internal/memo的固定日期断言,以及internal/tools/bash的 shell 输出相关用例。上述失败未发生在本次新增审批链路的定向测试中。