Repository navigation
feat(permission/chat): 基础工具默认放行+全自动模式贯通 & 结论置顶修复+流式卡片胶囊化 - #360
Merged
Merged
Conversation
…尾哨兵 / 跨迭代叙述落盘 / 迭代状态行移除 权限链(用户反馈:每个工具都要确认太麻烦): - DEFAULT 模式重口径:基础工具(只读/编辑写/幂等覆写)自动放行, 仅删除类(destructive 且非幂等)与敏感动作先问(PermissionDecider 单一事实源 isDeleteLike,PermissionContext 新增 idempotentHint) - RiskAwareToolGate 撤回 #230 MEDIUM 文件写确认链 → HIGH + 第三方 动态族(mcp_/plugin)兜底,内置 MEDIUM 静默 - BYPASS 全自动贯通:shell_execute / terminal.exec 的命令级确认门 在全自动模式下短路(实时读设置,切回即恢复) - 设置页文案对齐新语义(zh/en),BYPASS 更名「全自动」、DEFAULT 标注「默认(推荐)」 聊天流(用户反馈:结论跑到对话最上方 / 显示迭代无意义 / 思考与 工具要「用时展开、完事折叠」): - Agent 聊天 LazyColumn 尾哨兵(1dp)+ 三处滚动目标贴哨兵 —— scrollToItem 顶边对齐导致长结论被钉视口顶的根因修复 - 跨迭代叙述落盘:ToolCallStart 先落已流出文本再出工具卡(时序 修复 + 中间叙述不再丢失);Aborted 半截回复落 isPartial - ThinkingBubble:流式展开全文、完成折叠单行胶囊;RunningToolCall Card 运行中默认展开;Coding 屏 ThinkingCard 流式展开/收束折叠 - CodeStreamSession 移除「第 N 轮迭代」状态行(轮次统计保留在 Complete 收尾行);清理死字符串 chat_stat_* - 单测同步:PermissionDeciderTest 新决策矩阵 / CodeStreamSession Test 迭代状态行移除断言
…ent 屏 RunningToolCallCard 同口径) - CodeCapsule:RUNNING 态在胶囊行下方流式展示 logTail(6 行限高), 终态自动收起回单行摘要 —— 完整落实「正在使用工具时详细展示工具 输出,使用完之后折叠成胶囊」到 Coding 工作流时间轴 - 结构调整:胶囊 Surface 内 Row 包进 Column 以承载尾窗块 - 顺手规范化 KDoc 内的 \uXXXX 转义为字面字符(语义等价)
- 上游 hubSource/timeoutMs 注释与本分支 BYPASS 短路注释叠加使文件达 1213 行; 五处注释块压缩(金库/workspace 统一/T92+P1 出口/BYPASS/terminal.exec 横幅) - 门禁:check_file_size 1198/1200 ✅ kotlin_balance ✅ check_comment_integrity ✅
Contributor
📱 APK size reportDebug APK: 330.37 MB (346419476 bytes) — artifact |
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.
背景(用户反馈)
改动
一、权限链重口径(DEFAULT = 基础工具放行)
PermissionDecider:PermissionContext新增idempotentHint,「删除类」判定口径 =destructiveHint && !idempotentHint(破坏且不可重放恢复;write_file 等幂等覆写不算),DEFAULT 分支改为基础工具AllowDefault;RiskAwareToolGate:撤回 [security][P1] write_file/edit_file 风险级别 MEDIUM 永不弹确认 —— Agent 可静默覆写用户文件 #230 的 MEDIUM 文件写确认链,收敛为 HIGH + 第三方动态族(mcp_/plugin前缀,会话内问一次),弹窗标题区分「高风险工具 / 第三方工具」;ToolModule:shell_execute/terminal.exec的CommandPermissionGate在 BYPASS 下短路(实时读设置,切回其他模式立即恢复拦截)——「完全不用确认」覆盖全链路;安全边界不变:PLAN 零副作用、规则三元组越级、会话记忆、5 分钟超时 fail-closed、JSONL 审计全保留。
二、结论置顶根因修复(滚动定位)
scrollToItem(末条内容项)会把目标项顶边对齐视口顶——最终结论是长气泡时,收尾动画把它的顶部钉在屏幕最上方。本 PR 采用与主屏一致的scrollOffset = Int.MAX_VALUE(clamp 到合法最大值 = 贴真底)口径,三处滚动目标(结构变化 / 流式跟随 / FAB 回底)统一贴底。三、长对话时序修复(跨迭代叙述落盘)
引擎
contentBuilder每轮新建:跨轮叙述只活在 UIcurrentResponse(渲染在列表末尾),工具卡全部叠在其上方(时序错乱),收尾fullText只含末轮文本(中间叙述丢失)。现在:ToolCallStart先把已流出文本落为独立 Agent 消息再追加工具卡 → 文本→工具→文本保序;ResponseComplete以currentResponse.ifBlank { fullText }落盘;Aborted半截回复落isPartial(与 Error 同口径),流式气泡不再悬挂。四、流式卡片胶囊化 + 迭代标签移除
验证表
scripts/kotlin_balance.py(改动 kt 文件)scripts/check_file_size.sh(main ≤1200 / test ≤1600)scripts/check_code_quality.sh(反模式)scripts/check_string_mirror.py(i18n 镜像):app:testDebugUnitTest验证:core:code-engine:test验证五、影响面
AgentSettings结构不变(复用既有 permissionMode / permissionRules,存量设置向后兼容);