fix: allow unlisted commands with confirmation prompt instead of blocking#8
Merged
Merged
Conversation
TuYv
requested changes
Apr 15, 2026
TuYv
left a comment
Owner
There was a problem hiding this comment.
- 之前的4k/2k太克制了 但是20k/10k的放大还是有点浪费的 建议折中并且在截断时告知AI 输出被截断 当前仅为前xxxx字符
2.审批超时没有前端提示
Collaborator
Author
|
这个 PR 主要修复了命令执行的权限控制流程,核心改动有三点: 1. 白名单外命令从直接 block 改为弹窗确认 2. 所有命令统一展示 ExecutionCard 3. 审批弹窗支持「记住命令」 审批超时弹窗逻辑后续放在错误信息弹窗优化一并修复@Lin-wool;另外命令输出的截断策略也存在一些设计问题,单独提了一个 Issue #11 来讨论,避免在这个 PR 里扩大范围。 |
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
Changes
ChatService.ktexecuteToolCallWithApproval审批顺序:先创建卡片 → path check → whitelist check → 仅非白名单才弹审批弹窗BridgeHandler.ktnotifyExecutionCard()方法,调用前端onExecutionCard回调CommandExecutionService.ktbridge.d.tsonExecutionCard回调签名useBridge.tsonExecutionCard回调绑定App.tsxonExecutionCard→ 创建 running 卡片)与审批弹窗(onApprovalRequest→ 仅更新状态为 waiting + 打开弹窗)optimization-backlog.mdTest plan
git status)执行时不弹审批弹窗,直接展示 ExecutionCard 并自动执行CommandExecutionServiceTest+BridgeHandlerDispatchTest全部通过