feat: provides card-based interaction for the ask_clarification tool.#2184
Open
1330482928 wants to merge 10 commits intobytedance:mainfrom
Open
feat: provides card-based interaction for the ask_clarification tool.#21841330482928 wants to merge 10 commits intobytedance:mainfrom
1330482928 wants to merge 10 commits intobytedance:mainfrom
Conversation
Author
a2f33ad to
6b722f5
Compare
Contributor
There was a problem hiding this comment.
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
InteractiveClarificationCardforassistant:clarificationgroups. - Frontend: add a new clarification card component supporting single-select and multi-question form submissions.
- Backend: extend
ask_clarificationtool args withquestionsand 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. |
Author
|
@WillemJiang thanks for review, the modifications have been completed as suggested by Copilot. |
# Conflicts: # frontend/src/app/workspace/chats/[thread_id]/page.tsx # frontend/src/components/workspace/messages/message-list.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

provides card-based interaction for the ask_clarification tool.