Skip to content

feat: support multiple questions in agent asking tool - #7408

Merged
c121914yu merged 20 commits into
labring:mainfrom
Nixieboluo:feat/multi-ask
Aug 3, 2026
Merged

feat: support multiple questions in agent asking tool#7408
c121914yu merged 20 commits into
labring:mainfrom
Nixieboluo:feat/multi-ask

Conversation

@Nixieboluo

Copy link
Copy Markdown
Collaborator

Context

This PR upgrades ask_user from a single-question interaction to a structured multi-question experience. It allows an Agent to collect several user choices in one step while keeping the interaction recoverable from chat history.

Description

The Agent Ask protocol, service handling, persistence flow, and chat UI are updated to support multiple questions and structured options.

Users can select a provided option or enter a custom answer. The chat UI supports moving between questions, submitting all answers together, and restoring unfinished or completed interactions from conversation history.

Changes in the codebase

  • Added multi-question Agent Ask types and validation.
  • Kept compatibility with the previous options: string[] tool payload format.
  • Added validation to prevent duplicate option labels and answer values.
  • Updated Agent tool handling, interactive state conversion, chat persistence, and history restoration.
  • Added the Agent Ask Composer UI for answering multiple questions.
  • Fixed chat-history answer rendering for auxiliary-generated questions.
  • Ensured regenerated Ask interactions do not create a user-visible message.
  • Refactored the Composer into smaller local UI components while keeping interaction state centralized.
  • Removed redundant tests and retained focused coverage for protocol parsing, persistence, state restoration, and rendering.

Signed-off-by: Nixieboluo me@sagirii.me

@Nixieboluo Nixieboluo changed the title Feat/multi ask feat: add multiple questions support for agent asking tool Jul 29, 2026
@Nixieboluo Nixieboluo changed the title feat: add multiple questions support for agent asking tool feat: support multiple questions in agent asking tool Jul 29, 2026
@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 19.22% 1702 / 8851
🔵 Statements 19.21% 1786 / 9297
🔵 Functions 16.66% 351 / 2106
🔵 Branches 15.73% 788 / 5008
File CoverageNo changed files found.
Generated in workflow #1918 for commit d2b14d9 by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown

Admin Preview Image Ready!

ghcr.io/labring/fastgpt-pr:admin_d2b14d99d9cc752d87f5c0b1a30e59df01e93f82

🕒 Time: 2026-08-03 19:06:08 (UTC+8)

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown

Build Successful - Preview fastgpt Image for this PR:

ghcr.io/labring/fastgpt-pr:fastgpt_d2b14d99d9cc752d87f5c0b1a30e59df01e93f82

🕒 Time: 2026-08-03 18:59:53 (UTC+8)

@c121914yu c121914yu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

共 4 条行内评论;其中 i18n 动态 key 会绕过静态扫描,属于高优先级问题,建议合并前修复。

Comment thread packages/global/core/workflow/template/system/interactive/type.ts Outdated
Comment thread packages/global/core/ai/agent/type.ts Outdated
c121914yu
c121914yu previously approved these changes Jul 30, 2026
@Nixieboluo
Nixieboluo force-pushed the feat/multi-ask branch 2 times, most recently from 9be0d4f to 8408d7a Compare August 3, 2026 07:39
@c121914yu
c121914yu force-pushed the feat/multi-ask branch 2 times, most recently from 245b5a1 to 58530ce Compare August 3, 2026 10:32
Signed-off-by: Nixieboluo <me@sagirii.me>
Signed-off-by: Nixieboluo <me@sagirii.me>
Signed-off-by: Nixieboluo <me@sagirii.me>
Signed-off-by: Nixieboluo <me@sagirii.me>
Signed-off-by: Nixieboluo <me@sagirii.me>
Signed-off-by: Nixieboluo <me@sagirii.me>
Signed-off-by: Nixieboluo <me@sagirii.me>
Signed-off-by: Nixieboluo <me@sagirii.me>
Signed-off-by: Nixieboluo <me@sagirii.me>
Signed-off-by: Nixieboluo <me@sagirii.me>
Signed-off-by: Nixieboluo <me@sagirii.me>
Signed-off-by: Nixieboluo <me@sagirii.me>
Signed-off-by: Nixieboluo <me@sagirii.me>
Signed-off-by: Nixieboluo <me@sagirii.me>
Signed-off-by: Archer <545436317@qq.com>
@c121914yu
c121914yu merged commit 34632ba into labring:main Aug 3, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants