fix: 防止子 Agent 直接弹出用户问答卡 - #3316
Conversation
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c0b81e2d8f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
| Filename | Overview |
|---|---|
| packages/maker-core/src/agents/codex/index.ts | 增加 descendant 用户问答拒绝逻辑,但同步 provenance 查询仍会把先于 item 通知到达的合法权限请求误拒。 |
| packages/maker-core/src/agents/claude-code/capability-routing.ts | 为本地和远程 Claude 会话增加一致的 AskUserQuestion root-only 守卫。 |
| packages/maker-core/src/agents/claude-code/index.ts | 将新的本地 provenance hook 和远程 root-only guard 接入 Claude 会话启动流程。 |
| packages/maker-cc-manager/src/sdk-handlers.ts | 扩展远程 guard 校验以接受原生 AskUserQuestion 的精确工具名。 |
| packages/maker-cc-manager/src/protocol.ts | 将协议升级至 v5、bundle 升级至 0.0.10,以强制远端 daemon 支持新增守卫。 |
Sequence Diagram
sequenceDiagram
participant Child as 子 Agent
participant Runtime as Agent Runtime
participant Context as Tool Context
participant UI as 用户交互
Child->>Runtime: requestUserInput
Runtime->>Context: 查询 item provenance
alt 已识别为权限请求
Runtime->>UI: 打开权限审批
UI-->>Runtime: 审批结果
Runtime-->>Child: 返回权限答案
else 已识别为用户问答
Runtime-->>Child: 拒绝并要求上报父 Agent
else provenance 尚未到达
Runtime-->>Child: 当前实现立即返回空答案
end
Reviews (5): Last reviewed commit: "fix: simplify descendant input classific..." | Re-trigger Greptile
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5aa147ac3d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2ca1250a8b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
Signed-off-by: Dash <125997726+dashhuang@users.noreply.github.com>
收敛检查点:Codex descendant 用户输入本轮把连续反馈归为同一个失败族:把 Codex app-server 的确定协议顺序假设成可乱序竞态,继而在客户端增加 provenance 等待、取消和超时机制。 一句话不变量:descendant 的用户问答永远不能创建问答卡;descendant 的权限审批仅在同一 唯一状态 owner:
协议依据:仓库固定运行时为 对称路径与测试:现有回归覆盖 root 提问、descendant 原生未知请求拒绝、descendant MCP 权限放行、descendant dynamic 问答拒绝,以及 Claude 本地/远程 结论:Greptile 总结中的“provenance 稍晚到达”反例不适用于本仓固定的 Codex 0.145.0 调用链;当前实现按上述不变量保留。 |
MagicLizi
left a comment
There was a problem hiding this comment.
按维护者指示批准;合并仍需通过 review-pr 的代码审查与其余安全门。
|
合了。子 Agent 再不会直接弹问答卡到用户脸上,该问的还是回到父任务里处理。 |
这次改了什么
摘要
收口子 Agent 的用户问答能力,避免 native subagent 或 Codex descendant 直接创建用户问答卡,同时保留主 Agent 的正常提问能力和子 Agent 的权限审批能力。
变更类型
fix缺陷修复feat新功能refactor/perf重构或性能优化docs/test/chore文档、测试或工程维护范围
ask_user_question和原生requestUserInput的 descendant 拒绝。PreToolUse与远程 cc-manager 的root-only守卫。UI 变化
怎么验证的
自动验证
手工验证
不涉及。
未执行的验证
未进行 Desktop 实机手工验证;本 PR 不包含 UI 改动。
风险
风险分类
影响与回滚
提交前检查
git commit -s,见 DCO)