Skip to content

fix(acp): use tool id as permission cache key instead of command string#990

Merged
bug-ops merged 1 commit intomainfrom
fix/acp-permission-cache-key
Feb 26, 2026
Merged

fix(acp): use tool id as permission cache key instead of command string#990
bug-ops merged 1 commit intomainfrom
fix/acp-permission-cache-key

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Feb 26, 2026

Problem

Allow always for bash tool calls had no effect — every distinct command
triggered a new permission prompt regardless of prior decisions.

Root Cause

terminal.rs set ToolCallUpdateFields::title to the full command string
(gh api repos/.../contents/docs --jq '...'). The permission cache in
AcpPermissionGate keys on title, so each unique command was a separate
cache entry. Selecting Allow always saved one specific command string but
never matched subsequent calls.

Fix

  • title is now set to the stable tool id ("bash")
  • The full command moves to raw_input and remains visible in the IDE's
    "View Raw Input" panel
  • A single Allow always for bash now covers all shell invocations

Test plan

  • cargo clippy -p zeph-acp -- -D warnings passes
  • All 133 unit tests in zeph-acp pass
  • Manual: allow bash once, trigger another bash call — no prompt
  • Manual: allow bash always, restart session — no prompts for any command

Previously the ToolCallUpdateFields title was set to the full command
string (e.g. "gh api repos/.../contents/docs --jq '...'"), making the
permission cache key unique per invocation. This caused Allow always to
have no effect — every distinct command bypassed the cache and prompted
the user again.

Fix: set title to the stable tool id ("bash") and move the full command
to raw_input for display in the IDE's "View Raw Input" panel. A single
Allow always for bash now covers all shell invocations.
@github-actions github-actions bot added rust bug Something isn't working size/XS labels Feb 26, 2026
@bug-ops bug-ops enabled auto-merge (squash) February 26, 2026 19:29
@bug-ops bug-ops merged commit b75d6b7 into main Feb 26, 2026
25 checks passed
@bug-ops bug-ops deleted the fix/acp-permission-cache-key branch February 26, 2026 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working rust size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant