Conversation
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.
概述
为 AskUserQuestion 工具新增选项数量上限可配置能力:选项数量上限可通过配置
ask.max_options调整,支持在 4 到 8 之间的整数(默认 6),替代原先硬编码的 4 选项上限。设计要点(ADR-0001)
ask.max_options:默认6,合法范围[4, 8];非整数忽略,越界整数 clamp 到边界并记录告警日志(与既有ask.max_questions的处理方式一致)。options数组长度须在[2, max_options],超出上限硬报错,错误文案为between 2 and N (got M)。options.maxItems随配置生成,模型侧看到的约束与实际校验一致。-p)三个入口统一从AppConfig::ask.max_options取数(create_ask_user_question_tool_async(max_questions, max_options)),TUI 与 daemon 共用同一配置。改动文件(18)
src/config/config.hpp/src/config/config.cpp(新增ask.max_options字段、解析 clamp、校验、序列化)src/tool/ask_user_question_tool.hpp/.cpp(参数透传、校验、schemamaxItems动态化)src/main.cpp/src/daemon/worker.cpp/src/headless/headless_runner.cpptests/config/config_ask_test.cpp、tests/tool/ask_user_question_tool_test.cpp(覆盖默认值、越界 clamp、边界值、schema 同步)docs/adr/0001-configurable-ask-option-limit.md、docs/help/configuration.html、openspec change 全套验证
TaskSuggestionServiceTest,上游既有缺陷、与本次改动无关,文件与远端逐字节一致)