feat: surface approval 'Always'/'Never' as update_permission tool records#952
Merged
feat: surface approval 'Always'/'Never' as update_permission tool records#952
Conversation
When the user replies "Always" or "Never" to an approval prompt, the
gate persists the permission silently. The chat transcript only showed
the raw "Always" text plus the then-executed tool call, leaving no
visible indication that the permission was remembered.
Emit a synthetic update_permission tool record (with args
{tool, level, [resource]}) whenever ALWAYS_ALLOW or ALWAYS_DENY
persists successfully. It flows through the same StoredToolInteraction
path as real tool calls and the same ToolExecutionStart/End events, so
it renders in the session history, the dashboard tool-call viewer, and
the SSE activity stream.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Description
Follow-up to #950/#951. User asked: "when I set it to always, shouldn't there be a tool call in the admin chat panel showing permissions were updated, like upload_to_storage renders?"
Yes — previously the ApprovalGate flipped PERMISSIONS.json silently. The chat showed only the user's "Always" reply and the then-executed tool; there was no record that a permission was remembered, making the state change invisible in the dashboard.
Fix
When a prompt resolves to ALWAYS_ALLOW or ALWAYS_DENY and the permission persists successfully, emit a synthetic `update_permission` record:
Added `ToolName.UPDATE_PERMISSION` as a constant. The synthetic record is not LLM-callable (not registered in any factory); it only exists as a historical marker.
Type
Tests
Checklist
AI Usage
🤖 Generated with Claude Code