Skip to content

feat: provides card-based interaction for the ask_clarification tool.#2184

Open
1330482928 wants to merge 10 commits intobytedance:mainfrom
1330482928:feat/interactive-ask-question
Open

feat: provides card-based interaction for the ask_clarification tool.#2184
1330482928 wants to merge 10 commits intobytedance:mainfrom
1330482928:feat/interactive-ask-question

Conversation

@1330482928
Copy link
Copy Markdown

provides card-based interaction for the ask_clarification tool.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 13, 2026

CLA assistant check
All committers have signed the CLA.

@1330482928
Copy link
Copy Markdown
Author

实现效果:
image

@1330482928 1330482928 force-pushed the feat/interactive-ask-question branch from a2f33ad to 6b722f5 Compare April 13, 2026 16:21
@WillemJiang WillemJiang requested a review from Copilot April 14, 2026 01:34
@WillemJiang WillemJiang added question Further information is requested reviewing The PR is in reviewing status labels Apr 14, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a card-based UI flow for ask_clarification, enabling structured clarification prompts (including multi-question “form” mode) to render as interactive components in the chat UI rather than plain markdown.

Changes:

  • Frontend: detect JSON clarification payloads and render an InteractiveClarificationCard for assistant:clarification groups.
  • Frontend: add a new clarification card component supporting single-select and multi-question form submissions.
  • Backend: extend ask_clarification tool args with questions and emit a JSON payload for form-mode clarifications from the clarification middleware.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
frontend/src/components/workspace/messages/message-list.tsx Parses clarification tool-message content as JSON and conditionally renders an interactive clarification card.
frontend/src/components/workspace/messages/interactive-clarification-card.tsx New interactive card component for single and form clarification flows.
frontend/src/app/workspace/chats/[thread_id]/page.tsx Wires card submission into chat by sending a follow-up user message derived from the card response.
backend/packages/harness/deerflow/tools/builtins/clarification_tool.py Adds questions parameter and updates tool docstring to describe multi-question usage.
backend/packages/harness/deerflow/agents/middlewares/clarification_middleware.py Emits a JSON payload for form-mode clarifications when questions is provided.

Comment thread frontend/src/components/workspace/messages/interactive-clarification-card.tsx Outdated
Comment thread frontend/src/components/workspace/messages/interactive-clarification-card.tsx Outdated
Comment thread frontend/src/components/workspace/messages/interactive-clarification-card.tsx Outdated
Comment thread frontend/src/app/workspace/chats/[thread_id]/page.tsx
Comment thread frontend/src/components/workspace/messages/message-list.tsx
Comment thread backend/packages/harness/deerflow/agents/middlewares/clarification_middleware.py Outdated
Comment thread frontend/src/components/workspace/messages/interactive-clarification-card.tsx Outdated
Comment thread frontend/src/components/workspace/messages/interactive-clarification-card.tsx Outdated
@1330482928
Copy link
Copy Markdown
Author

@WillemJiang thanks for review, the modifications have been completed as suggested by Copilot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

question Further information is requested reviewing The PR is in reviewing status

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants