AskUserQuestion tool is blocked even with permission #51

Closed
opened 2026-01-21 14:59:28 -08:00 by naomi · 0 comments
Owner

Description

The AskUserQuestion tool is currently blocked even when permission is granted. This is because it's an interactive tool that requires user input, but the system only supports permission requests (yes/no), not interactive prompts.

Current Behavior

When Claude tries to use AskUserQuestion:

  1. It gets denied and shows up in permission_denials
  2. The permission modal asks to allow the tool
  3. Even if you allow it, there's no mechanism to handle the actual question/answer interaction
  4. The tool effectively remains blocked

Expected Behavior

The AskUserQuestion tool should:

  1. Present a modal with the question from Claude
  2. Allow the user to provide text input or select from options
  3. Send the user's response back to Claude to continue the conversation

Technical Analysis

The issue stems from the fact that AskUserQuestion is fundamentally different from other tools:

  • Other tools (Read, Write, Bash, etc.) perform actions and return results
  • AskUserQuestion needs bidirectional communication - it needs to get input from the user

The current permission system only handles "allow/deny" decisions, not interactive prompts that need custom user input.

Implementation Requirements

To properly support AskUserQuestion, we need:

1. Backend Changes (Rust)

  • Add a new event type UserQuestionEvent that includes:
    • Question text/prompt
    • Options/choices (if applicable)
    • Tool use ID (to send response back)
    • Conversation ID
  • Add special handling in wsl_bridge.rs for the AskUserQuestion tool
  • Implement a response mechanism to send user answers back to Claude

2. Frontend Changes (Svelte)

  • Create a UserQuestionModal component similar to PermissionModal
  • Handle the new claude:question event in tauri.ts
  • Store pending questions per conversation (like we do with permissions)
  • Implement response sending via a new Tauri command

3. Store Updates

  • Add pendingQuestion to the Conversation interface
  • Add methods to manage question state per conversation

Example Implementation Sketch

// In types.rs
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct UserQuestionEvent {
    pub id: String,
    pub question: String,
    pub options: Option<Vec<String>>,
    pub conversation_id: Option<String>,
}

// In wsl_bridge.rs - special handling for AskUserQuestion
ContentBlock::ToolUse { id, name, input } => {
    if name == "AskUserQuestion" {
        // Emit user question event instead of executing tool
        let question = input.get("question").and_then(|q| q.as_str()).unwrap_or("Question");
        let _ = app.emit("claude:question", UserQuestionEvent {
            id: id.clone(),
            question: question.to_string(),
            options: extract_options_from_input(&input),
            conversation_id: conversation_id.clone(),
        });
    } else {
        // Normal tool handling...
    }
}
// In UserQuestionModal.svelte
<script lang="ts">
  interface Props {
    question: string;
    options?: string[];
    onAnswer: (answer: string) => void;
    onCancel: () => void;
  }
  
  // Modal implementation with text input or option buttons
</script>

Related Information

  • The tool appears to be part of Claude's standard toolset
  • Other desktop Claude clients likely have similar implementations
  • This would enhance the interactive capabilities significantly

Priority

Medium - This is a missing feature rather than a bug, but it would significantly improve the user experience by enabling more interactive conversations with Claude.

This issue was created with help from Hikari~ 🌸

## Description The `AskUserQuestion` tool is currently blocked even when permission is granted. This is because it's an interactive tool that requires user input, but the system only supports permission requests (yes/no), not interactive prompts. ## Current Behavior When Claude tries to use `AskUserQuestion`: 1. It gets denied and shows up in `permission_denials` 2. The permission modal asks to allow the tool 3. Even if you allow it, there's no mechanism to handle the actual question/answer interaction 4. The tool effectively remains blocked ## Expected Behavior The `AskUserQuestion` tool should: 1. Present a modal with the question from Claude 2. Allow the user to provide text input or select from options 3. Send the user's response back to Claude to continue the conversation ## Technical Analysis The issue stems from the fact that `AskUserQuestion` is fundamentally different from other tools: - **Other tools** (Read, Write, Bash, etc.) perform actions and return results - **AskUserQuestion** needs bidirectional communication - it needs to get input from the user The current permission system only handles "allow/deny" decisions, not interactive prompts that need custom user input. ## Implementation Requirements To properly support `AskUserQuestion`, we need: ### 1. Backend Changes (Rust) - Add a new event type `UserQuestionEvent` that includes: - Question text/prompt - Options/choices (if applicable) - Tool use ID (to send response back) - Conversation ID - Add special handling in `wsl_bridge.rs` for the `AskUserQuestion` tool - Implement a response mechanism to send user answers back to Claude ### 2. Frontend Changes (Svelte) - Create a `UserQuestionModal` component similar to `PermissionModal` - Handle the new `claude:question` event in `tauri.ts` - Store pending questions per conversation (like we do with permissions) - Implement response sending via a new Tauri command ### 3. Store Updates - Add `pendingQuestion` to the `Conversation` interface - Add methods to manage question state per conversation ## Example Implementation Sketch ```rust // In types.rs #[derive(Debug, Clone, Serialize, Deserialize)] pub struct UserQuestionEvent { pub id: String, pub question: String, pub options: Option<Vec<String>>, pub conversation_id: Option<String>, } // In wsl_bridge.rs - special handling for AskUserQuestion ContentBlock::ToolUse { id, name, input } => { if name == "AskUserQuestion" { // Emit user question event instead of executing tool let question = input.get("question").and_then(|q| q.as_str()).unwrap_or("Question"); let _ = app.emit("claude:question", UserQuestionEvent { id: id.clone(), question: question.to_string(), options: extract_options_from_input(&input), conversation_id: conversation_id.clone(), }); } else { // Normal tool handling... } } ``` ```typescript // In UserQuestionModal.svelte <script lang="ts"> interface Props { question: string; options?: string[]; onAnswer: (answer: string) => void; onCancel: () => void; } // Modal implementation with text input or option buttons </script> ``` ## Related Information - The tool appears to be part of Claude's standard toolset - Other desktop Claude clients likely have similar implementations - This would enhance the interactive capabilities significantly ## Priority Medium - This is a missing feature rather than a bug, but it would significantly improve the user experience by enabling more interactive conversations with Claude. ✨ This issue was created with help from Hikari~ 🌸
naomi closed this issue 2026-01-23 14:11:19 -08:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nhcarrigan/hikari-desktop#51