Skip to content

AskUserQuestion shown as permission request instead of question form on mobile #91

@begna112

Description

@begna112

Description

When using certain skills in YOLO mode, the mobile client shows AskUserQuestion tool calls with BOTH the correct question form (with selectable options) AND a generic permission dialog ("Permission required: AskUserQuestion") simultaneously. Interacting with the permission dialog instead of the question form dismisses the question without sending an answer.

Observed behavior

  1. Both UIs appear — The question form renders correctly in the transcript (e.g., "What would you like to focus on?" with options), AND a permission footer appears above the text input area with Yes/No/Don't-ask-again buttons.

  2. Answering the question form works — Selecting options and submitting through the question form works correctly, and the permission dialog also dismisses.

  3. Answering the permission dialog breaks it — Tapping "Yes" on the permission footer calls sessionAllow() which resolves the permission without any answers. The question form is dismissed without the user's selection being sent. The agent receives an empty/approved result instead of the structured answers.

  4. "Don't ask again" doesn't persist — Selecting "Yes, don't ask again for this tool" dismisses the dialog but the same dual-UI behavior repeats on the next AskUserQuestion call.

Root Cause

There are two separate locations that render PermissionFooter for pending permission requests:

Location 1: ToolView.tsx:441 — Correctly excludes AskUserQuestion

{isWaitingForPermission && toolForRendering.permission && sessionId &&
    toolForRendering.name !== 'AskUserQuestion' &&   // ← excluded
    toolForRendering.name !== 'ExitPlanMode' &&
    toolForRendering.name !== 'exit_plan_mode' &&
    toolForRendering.name !== 'AcpHistoryImport' && (
    <PermissionFooter ... />
)}

This is correct — AskUserQuestion is excluded from the inline permission footer because AskUserQuestionView provides a custom question form instead.

Location 2: AgentInput.tsx:1759-1776 — Does NOT exclude AskUserQuestion

{props.sessionId && pendingPermissionRequests.length > 0 ? (
    <View style={styles.permissionRequestsContainer}>
        {pendingPermissionRequests.map((req) => {
            return (
                <View key={req.id} style={styles.permissionRequestCard}>
                    <PermissionFooter
                        permission={{ id: req.id, status: 'pending' }}
                        sessionId={props.sessionId!}
                        toolName={req.tool}
                        toolInput={req.arguments}
                        ...
                    />
                </View>
            );
        })}
    </View>
) : null}

This renders a PermissionFooter above the text input for ALL pending permission requests, including AskUserQuestion. There is no exclusion check here.

Result

  • AskUserQuestionView renders the question form in the transcript ✓
  • AgentInput renders a duplicate PermissionFooter near the keyboard ✗
  • User sees both, and if they interact with the PermissionFooter (which is more prominent/closer to where they're looking), it resolves the permission via sessionAllow() without structured answers
  • The question form is dismissed without the user's answer being sent

Fix

Add the same exclusion to AgentInput.tsx:1761 that exists in ToolView.tsx:441:

{pendingPermissionRequests
    .filter(req => req.tool !== 'AskUserQuestion' && req.tool !== 'ExitPlanMode' && req.tool !== 'exit_plan_mode' && req.tool !== 'AcpHistoryImport')
    .map((req) => { ... })}

Similarly, ToolFullView.tsx:175 has the exclusion but should be verified to match.

Affected Files

  • apps/ui/sources/components/sessions/agentInput/AgentInput.tsx (line 1759-1776 — missing exclusion)
  • apps/ui/sources/components/tools/shell/views/ToolView.tsx (line 441 — has correct exclusion)
  • apps/ui/sources/components/tools/shell/views/ToolFullView.tsx (line 175 — has correct exclusion)

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions