Skip to content

feat(desktop): add toggle for tool call visibility#3733

Open
SuMuxi66 wants to merge 1 commit into
esengine:main-v2from
SuMuxi66:fix/tool-calls-toggle
Open

feat(desktop): add toggle for tool call visibility#3733
SuMuxi66 wants to merge 1 commit into
esengine:main-v2from
SuMuxi66:fix/tool-calls-toggle

Conversation

@SuMuxi66

@SuMuxi66 SuMuxi66 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Fixes #3710

新增一个桌面端设置项,用来控制在对话区是否渲染普通的工具调用块。

行为

  • 默认开启,保留现有行为。
  • 关闭后,聊天区不再显示普通的 ToolCard 块。
  • todo_write(任务进度面板)、exit_plan_mode(计划确认/退出弹窗)等功能性 UI 仍正常显示。
  • 仅影响 UI 渲染:不影响 agent 执行、不影响工具结果回传模型、不影响消息历史与日志。

实现要点

  • 新增 [desktop].show_tool_calls 用户配置项(仅 UI 用途,默认 true)。
  • 新增 app.SetShowToolCalls(bool) Wails 绑定,走 applyConfigOnly 持久化。
  • internal/config/render.go[desktop] 段落中渲染 show_tool_calls 字段,确保显式 true / false 都能正确写盘与读回。
  • Transcript 组件新增 showToolCalls prop;两处 case "tool": 在原有 parentId / todo_write / exit_plan_mode 早退之后,新增 if (!showToolCalls) break;
  • SettingsPanel.GeneralSection 新增"显示工具调用"分段开关(开启 / 关闭),点击时先做乐观更新(按钮高亮立即切换),再派发持久化调用。
  • App.tsx 在启动时读取一次持久化的 showToolCalls 并传给 <Transcript>,用户未打开设置面板也能立即生效。
  • 新增单元测试 TestDesktopShowToolCallsRoundTrip,覆盖 nil 默认值 + 显式 true / false 的存盘回读。

验证

  • git diff --check(无冲突标记)
  • cd desktop && go build -o nul ./...(exit 0)
  • go test ./internal/config/(含新测试全部通过)
  • wails generate module(完成)
  • cd desktop/frontend && npx tsc --noEmit(exit 0)

手工验收

  • 关闭开关后,普通工具调用块在聊天区不再显示。
  • 重新打开开关后,普通工具调用块恢复显示。
  • 关闭 / 重启应用后,开关状态保持。
  • 无论开关状态,todo_write 任务进度面板、exit_plan_mode 触发的审批弹窗均正常显示。

@github-actions github-actions Bot added desktop Wails desktop app (desktop/**) v2 Go rewrite (1.x) — main-v2 branch, active development config Configuration & setup (internal/config) labels Jun 9, 2026
@SuMuxi66 SuMuxi66 force-pushed the fix/tool-calls-toggle branch from 7fdf127 to 547c4b8 Compare June 10, 2026 04:24
Add a global setting to control whether tool call blocks are shown in the chat area. The toggle defaults to on (show), persists to the desktop TOML config, and only affects UI rendering. Functional tool UI (todo_write, exit_plan_mode) remains visible regardless of the setting.

Closes: esengine#3710
@SuMuxi66 SuMuxi66 force-pushed the fix/tool-calls-toggle branch from 547c4b8 to 4478106 Compare June 10, 2026 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Configuration & setup (internal/config) desktop Wails desktop app (desktop/**) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: 工具调用要不要显示,最好加个开关

1 participant