[eric] hitl: Approve All persists always-allow so mid-run identical commands stop re-prompting

This commit is contained in:
ciregenz
2026-07-02 00:41:54 -07:00
parent 7076af1e6b
commit a4e81a8f2f
3 changed files with 51 additions and 3 deletions
@@ -435,7 +435,8 @@ const DynamicIsland: React.FC = () => {
for (const g of groups) {
for (const req of g.approvals) {
if (req.tool_name !== 'AskUserQuestion') {
dispatch(handleApproval({ requestId: req.id, behavior: 'allow' }));
// setAlwaysAllow so the SAME command mid-run stops re-prompting: the backend writes the policy into the live in-run snapshot, a plain allow only clears the pending request.
dispatch(handleApproval({ requestId: req.id, behavior: 'allow', setAlwaysAllow: true }));
}
}
}
@@ -792,7 +793,7 @@ const CompactActionablePill: React.FC<{
</IconButton>
</Tooltip>
{remainingCount > 1 && !isIntervention && (
<Tooltip title={`Approve all ${remainingCount}`} arrow>
<Tooltip title={`Approve all ${remainingCount} (stops re-asking for these tools)`} arrow>
<Box
component="button"
onClick={(e: React.MouseEvent) => { e.stopPropagation(); onApproveAll(); }}
@@ -1165,7 +1165,8 @@ const AgentCard: React.FC<Props> = ({
startIcon={<CheckIcon sx={{ fontSize: '14px !important' }} />}
onClick={() => {
for (const req of session.pending_approvals) {
if (req.tool_name !== 'AskUserQuestion') dispatch(handleApproval({ requestId: req.id, behavior: 'allow' }));
// setAlwaysAllow so the SAME command mid-run stops re-prompting: the backend writes the policy into the live in-run snapshot, a plain allow only clears the pending request.
if (req.tool_name !== 'AskUserQuestion') dispatch(handleApproval({ requestId: req.id, behavior: 'allow', setAlwaysAllow: true }));
}
}}
sx={{