Repository navigation
feat(assistant): request approval for external MCP writes - #973
Open
crispinhu27 wants to merge 3 commits into
Open
crispinhu27 wants to merge 3 commits into
crispinhu27 wants to merge 3 commits into
Conversation
The resumed-turn context now says 待确认的平台写入 because external MCP writes wait for approval instead of going into drafts. Keep asserting that the turn names the qualified submission tool, using the new wording. Co-Authored-By: Claude Code <noreply@anthropic.com>
Collaborator
Author
修复 core CI 失败(head
|
| 场景 | 结果 |
|---|---|
调用 mock_tickets__create_ticket |
出现「批准外部写入:Mock Tickets · create_ticket」卡片,参数里的 token 显示为 [redacted];等待期间上游调用数不变 |
| 批准 | 上游只执行 1 次,CLI 收到 mock upstream executed create_ticket |
| 拒绝 | 上游调用数不变,CLI 收到「用户拒绝了本次外部 MCP 写入 create_ticket,操作未执行。不要换一种方式重试。」 |
| 等待审批时停止回复 | CLI 退出(context canceled),native-approvals 变为 [],上游调用数不变 |
/api/health 返回 200,日志里没有 panic。停止回复这一项是在合并 main 之前的构建上验证的,批准和拒绝在合并后重新跑过。
| 审批卡片 | 批准后 |
|---|---|
![]() |
![]() |
| 拒绝后 | 等待时停止回复 |
![]() |
![]() |
没有验证的部分:远端 Runner 的逐请求取消(本地没起远端 Runner)、真实模型下 CLI 的行为。
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.




What changed
In Request approval mode, the session gateway immediately rejected external MCP writes. It now uses the external-write approval panel introduced in #947. The current speaker sees the MCP server, tool, and redacted arguments. Approval releases the original call once and returns its result to the CLI.
The gateway expires the pending request on refusal, timeout, turn stop, or mode handoff. Runner connections carry cancellation per MCP request so a disconnected call loses its approval without affecting parallel calls.
Scope
Compatibility
Approvals use the existing generation payload. For remote execution, update the Runner alongside the API to enable per-request cancellation for manual MCP approvals.
Validation
TestMySQLNativeApprovalsShareGenerationControlStateagainst isolated MySQL 8.4.bash scripts/build-chatbot.sh(371 tests) andpython3 scripts/check-public.py.Safety