Skip to content

fix(frontend): handle simple question format in AskUserQuestion HITL UI#927

Merged
Gkrumbach07 merged 1 commit intomainfrom
bug/hitl-no-message
Mar 16, 2026
Merged

fix(frontend): handle simple question format in AskUserQuestion HITL UI#927
Gkrumbach07 merged 1 commit intomainfrom
bug/hitl-no-message

Conversation

@Gkrumbach07
Copy link
Copy Markdown
Contributor

Summary

  • Fixes bug where the HITL (Human-in-the-Loop) user input UI never appeared when the agent called AskUserQuestion
  • The component only handled structured { questions: [...] } input, but Claude Code sends a simple { question: "..." } string format — causing parseQuestions to return [] and the component to render nothing
  • Adds fallback parsing for the simple format and a free-form text input when no predefined options exist

Test plan

  • Trigger an AskUserQuestion tool call in a session (e.g. ask the agent something that requires clarification)
  • Verify the HITL question UI renders with a text input field
  • Verify submitting an answer works and the form disables after submission
  • Verify the structured { questions: [...] } format still works (radio buttons, checkboxes)
  • npx vitest run — all 471 tests pass

🤖 Generated with Claude Code

The AskUserQuestionMessage component only handled structured input with
a `questions` array, but Claude Code sends a simple `{ question: "..." }`
format. This caused parseQuestions to return an empty array, making the
component render nothing — so the HITL input UI never appeared.

- Add fallback in parseQuestions for simple `{ question: string }` input
- Add free-form text input rendering when no predefined options exist

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 16, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: eb1e78a9-7b25-4f39-b414-cf94744e7a62

📥 Commits

Reviewing files that changed from the base of the PR and between 8d999e6 and bbde243.

📒 Files selected for processing (1)
  • components/frontend/src/components/session/ask-user-question.tsx

Walkthrough

The ask-user-question component is enhanced to support simplified question format (object with question field) and free-form text input rendering when no predefined options are provided. Text input accepts submissions via Enter key when all questions are answered.

Changes

Cohort / File(s) Summary
Free-form Input Support
components/frontend/src/components/session/ask-user-question.tsx
Extended parseQuestions to accept simple object format with question field; enhanced renderQuestionOptions to render text Input for free-form responses, with Enter key submission logic when all questions are answered.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding support for a simple question format in the AskUserQuestion component.
Description check ✅ Passed The description clearly explains the bug being fixed, why it occurred, and what solution was implemented, all directly related to the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bug/hitl-no-message
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

@Gkrumbach07
Copy link
Copy Markdown
Contributor Author

@Mergifyio queue

@mergify
Copy link
Copy Markdown

mergify bot commented Mar 16, 2026

Merge Queue Status

  • 🟠 Waiting for queue conditions
  • ⏳ Enter queue
  • ⏳ Run checks
  • ⏳ Merge
Required conditions to enter a queue
  • -closed [📌 queue requirement]
  • any of [🔀 queue conditions]:
    • all of [📌 queue conditions of queue default]:
      • #approved-reviews-by >= 1 [🛡 GitHub repository ruleset rule protect-main]
      • #approved-reviews-by>=1
      • commented-reviews-by=coderabbitai[bot]
      • #changes-requested-reviews-by = 0 [🛡 GitHub repository ruleset rule protect-main]
      • #changes-requested-reviews-by=0
      • check-success=End-to-End Tests
      • check-success=test-local-dev-simulation
      • check-success=validate-manifests
    • all of [📌 queue conditions of queue large-pr]:
      • #approved-reviews-by >= 1 [🛡 GitHub repository ruleset rule protect-main]
      • #approved-reviews-by>=2
      • commented-reviews-by=coderabbitai[bot]
      • #changes-requested-reviews-by = 0 [🛡 GitHub repository ruleset rule protect-main]
      • #changes-requested-reviews-by=0
      • check-success=End-to-End Tests
      • check-success=test-local-dev-simulation
      • check-success=validate-manifests
  • -conflict [📌 queue requirement]
  • -draft [📌 queue requirement]
  • any of [📌 queue -> configuration change requirements]:
    • -mergify-configuration-changed
    • check-success = Configuration changed

@Gkrumbach07 Gkrumbach07 merged commit c18ddbb into main Mar 16, 2026
33 checks passed
@Gkrumbach07 Gkrumbach07 deleted the bug/hitl-no-message branch March 16, 2026 15:12
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.

1 participant