Skip to content

Conversation

@knowsuchagency
Copy link
Contributor

Summary

This PR implements full support for Claude Code's AskUserQuestion tool, enabling AI agents running in Vibe Kanban to ask users structured multiple-choice questions and receive responses through the UI.

Changes

Backend

  • Protocol Support: Added AskUserQuestion variant to ControlRequestType enum
  • Tool Recognition: Added AskUserQuestion to ClaudeToolData enum with proper serialization
  • Client Handler: Implemented on_ask_user_question method in ClaudeAgentClient
  • Normalization: Added UserQuestion entry type with QuestionStatus enum (Pending, Answered, TimedOut)
  • Service Layer: Created UserQuestions service following the same architecture as the existing Approvals service
  • API Routes: Added POST /api/questions/{id}/respond endpoint
  • Deployment: Integrated user_questions service throughout the deployment stack

Frontend

  • API Client: Added questionsApi with respond method
  • UI Component: Created PendingQuestionEntry component with:
    • Single-select mode (radio buttons)
    • Multi-select mode (checkboxes)
    • Optional "Other" text input
    • Submit button with validation
  • Integration: Updated DisplayConversationEntry to render user_question entries
  • Type Safety: Imported and used generated TypeScript types

Architecture

The implementation mirrors the existing approvals system:

  • Questions timeout after 1 hour
  • Status tracking through conversation patches
  • Real-time UI updates via MsgStore
  • Consistent error handling and validation

Test Plan

  • Test single-select question with radio buttons
  • Test multi-select question with checkboxes
  • Test "Other" text input option
  • Verify question appears in UI when Claude Code sends AskUserQuestion request
  • Verify response is sent back to Claude Code when user submits
  • Test timeout behavior after 1 hour
  • Verify TypeScript compilation passes
  • Verify Rust compilation passes

Related Issue

Closes #1220

Screenshots

(Screenshots will be added after testing)

Implement full support for Claude Code's AskUserQuestion tool to enable agents to ask users structured multiple-choice questions and receive responses.

Backend changes:
- Add AskUserQuestion variant to ControlRequestType enum in protocol types
- Add AskUserQuestion to ClaudeToolData enum and tool name extraction
- Implement on_ask_user_question handler in ClaudeAgentClient
- Add UserQuestion entry type to NormalizedEntryType with QuestionStatus
- Create UserQuestions service (mirroring Approvals service architecture)
- Add /api/questions/{id}/respond API route
- Wire up user_questions service in deployment

Frontend changes:
- Add questionsApi client methods to api.ts
- Create PendingQuestionEntry component with radio/checkbox UI
- Update DisplayConversationEntry to render user_question entries
- Import QuestionResponse and QuestionResponseStatus types

The implementation follows the same architectural patterns as the existing approvals system, supporting:
- Single-select (radio buttons) and multi-select (checkboxes) options
- "Other" text input when allow_other is true
- Timeout handling for pending questions
- Status tracking (Pending, Answered, TimedOut)

Addresses issue BloopAI#1220
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Claude Code AskUserQuestion not supported

1 participant