diff --git a/apps/x/apps/renderer/src/App.tsx b/apps/x/apps/renderer/src/App.tsx index bb75a1eb..89907284 100644 --- a/apps/x/apps/renderer/src/App.tsx +++ b/apps/x/apps/renderer/src/App.tsx @@ -3150,7 +3150,6 @@ function App() { toolCallId: string, subflow: string[], response: 'approve' | 'deny', - scope?: 'once' | 'session' | 'always', ) => { if (!runId) return @@ -3159,7 +3158,6 @@ function App() { await sessionChat.respondToPermission( toolCallId, response === 'approve' ? 'allow' : 'deny', - scope ? { scope } : undefined, ) } catch (error) { console.error('Failed to authorize permission:', error) @@ -6834,8 +6832,6 @@ function App() { toolCall={permRequest.toolCall} permission={permRequest.permission} onApprove={() => handlePermissionResponse(permRequest.toolCall.toolCallId, permRequest.subflow, 'approve')} - onApproveSession={() => handlePermissionResponse(permRequest.toolCall.toolCallId, permRequest.subflow, 'approve', 'session')} - onApproveAlways={() => handlePermissionResponse(permRequest.toolCall.toolCallId, permRequest.subflow, 'approve', 'always')} onDeny={() => handlePermissionResponse(permRequest.toolCall.toolCallId, permRequest.subflow, 'deny')} isProcessing={isActive && activeIsWorking} response={response} diff --git a/apps/x/apps/renderer/src/components/ai-elements/permission-request.tsx b/apps/x/apps/renderer/src/components/ai-elements/permission-request.tsx index 9317bcae..961e85f9 100644 --- a/apps/x/apps/renderer/src/components/ai-elements/permission-request.tsx +++ b/apps/x/apps/renderer/src/components/ai-elements/permission-request.tsx @@ -67,6 +67,13 @@ export const PermissionRequest = ({ const isResponded = response !== null; const isApproved = response === 'approve'; + // Scope actions ("Allow for Session"/"Always Allow") render only when the + // caller wires them: the legacy code-mode path persists grants, but the + // turns path has no grant persistence yet and must not show dead buttons. + const hasScopeActions = + Boolean(onApproveSession || onApproveAlways) && + Boolean(command || filePermission); + // Once a response is chosen, collapse the details to just the header. // Users can click the header to expand them again. const [expanded, setExpanded] = useState(false); @@ -180,12 +187,12 @@ export const PermissionRequest = ({ size="sm" onClick={onApprove} disabled={isProcessing} - className={cn("flex-1", (command || filePermission) && "rounded-r-none")} + className={cn("flex-1", hasScopeActions && "rounded-r-none")} > Approve - {(command || filePermission) && ( + {hasScopeActions && (