Skip to content

feat: add per-tool execution approval gate and streamline tool settings - #329

Merged
coder-hhx merged 2 commits into
Stack-Cairn:mainfrom
yyg-max:feat/tool-approval-gate
Jul 30, 2026
Merged

feat: add per-tool execution approval gate and streamline tool settings#329
coder-hhx merged 2 commits into
Stack-Cairn:mainfrom
yyg-max:feat/tool-approval-gate

Conversation

@yyg-max

@yyg-max yyg-max commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add a permission gate that can require explicit user approval before a tool
runs, with a centralized approval bar that shows the exact command. Alongside
the feature, shrink the tool-config surface by removing the unfinished plugin
platform and the vestigial selectable/custom system tools, and merge the two
overlapping tool settings pages into one.

Changes

Permission gate

  • Resolve an allow / ask / deny policy per tool — by explicit tool name,
    MCP server:<id>, or tool group:<id> — from settings.system.toolPolicies,
    enforced in beforeToolCall. Default stays allow, so no regression.
  • Add a centralized approval bar above the composer: per-call allow once,
    allow for this chat (in-memory, per conversation), and deny, plus batch
    allow/deny when more than one tool is pending.
  • Show the pending tool's command/arguments in the approval bar — full command,
    wrapped, height-capped with internal scroll for very long commands — and keep
    the transcript tool card collapsed while awaiting approval.
  • Persist toolPolicies through the existing system_settings store; sync the
    pending marker + summary to the WebUI over the gateway event stream.

Remove plugin platform

  • Delete the QuickJS plugin runtime, manifest/install/grants/config, plugin
    skills discovery, the Plugins Hub, and the AppSettings.plugins field.
  • rquickjs is retained for provider usage queries.

Remove selectable/custom system tools (proto to UI)

  • Reserve ChatRequest field 6 (selected_system_tools) in gateway.proto
    and regenerate Go/TS; drop it from the Go handler, the Rust event/settings
    layer, and the desktop turn pipeline.
  • Delete the http_get_test demo tool and customSystemTools.

Streamline settings

  • Fold the built-in tool approval controls into the System Tools page and remove
    the separate Tool Permissions page.
  • Remove the dead ToolApprovalCard component.

Compatibility and upgrade

  • buf breaking passes: field 6 is reserved (number + name), so the wire format
    stays compatible; new clients simply omit it and old payloads are ignored.
  • toolPolicies defaults to empty (every tool allow), so existing setups see
    no behavior change until a user opts a tool into ask/deny.
  • Requires a gateway + desktop restart after upgrade so the regenerated protobuf
    takes effect.

Test plan

  • Set a tool (e.g. Bash) to ask in System Tools; confirm the approval
    bar appears with the command and the transcript card stays collapsed.
  • allow once / deny / allow for this chat behave per scope; a new
    conversation asks again.
  • Long/multi-line command shows fully in the bar (wrapped, scrolls) without
    pushing the buttons off.
  • WebUI shows the same approval bar + command over the gateway bridge, and
    recovers after a page refresh.
  • Settings shows a single System Tools page with per-tool policy; no Plugins
    or Tool Permissions entries remain.
  • Gates: buf lint/breaking, go build/test, cargo check/test,
    both tsc, biome, mirror.

@yyg-max
yyg-max marked this pull request as draft July 29, 2026 16:42
proto-check now calls `buf breaking --against` directly; remove the
scripts/check-buf-breaking.mjs wrapper and tidy buf.yaml comments.
@yyg-max
yyg-max force-pushed the feat/tool-approval-gate branch 2 times, most recently from 2b324be to 991ea7b Compare July 30, 2026 02:56
… settings

Add a permission gate that can require user approval before a tool runs,
and reduce tool-config surface by removing the unfinished plugin platform
and the vestigial selectable/custom system tools.

Permission gate:
- Resolve an allow/ask/deny policy per tool (explicit tool name, MCP
  server, or tool group) from settings.system.toolPolicies, enforced in
  beforeToolCall; default allow so there is no regression.
- Add a centralized approval bar above the composer with per-call
  allow-once / allow-for-this-chat / deny, plus batch allow/deny.
- Show the pending command/arguments summary in the approval bar (full
  command, wrapped, height-capped with scroll) and keep the transcript
  tool card collapsed while awaiting approval.
- Persist toolPolicies via the existing system_settings store; sync the
  pending marker + summary to the WebUI over the gateway event stream.

Remove plugin platform:
- Delete the QuickJS plugin runtime, manifest/install/grants/config,
  plugin skills discovery, plugins Hub, and the AppSettings.plugins field.
- rquickjs stays for provider usage queries.

Remove selectedSystemTools / custom system tools (proto to UI):
- Reserve ChatRequest field 6 (selected_system_tools) in gateway.proto
  and regenerate Go/TS; drop it from the Go handler, Rust event/settings,
  and the desktop turn pipeline.
- Delete the http_get_test demo tool and customSystemTools.

Streamline settings:
- Fold the built-in tool approval controls into the System Tools page and
  remove the separate Tool Permissions page.
- Remove the dead ToolApprovalCard component.
@yyg-max
yyg-max force-pushed the feat/tool-approval-gate branch from 991ea7b to f69f24d Compare July 30, 2026 03:18
@yyg-max
yyg-max marked this pull request as ready for review July 30, 2026 03:26
@yyg-max
yyg-max requested review from coder-hhx and su-fen and removed request for su-fen July 30, 2026 03:28
@coder-hhx
coder-hhx merged commit 8db7f66 into Stack-Cairn:main Jul 30, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants