fix(ask): require multiSelect in schema and add desktop multi-select badge / 修复 ask 多选只能单选的问题 - #7792
Open
JesonChou wants to merge 1 commit into
Open
fix(ask): require multiSelect in schema and add desktop multi-select badge / 修复 ask 多选只能单选的问题#7792JesonChou wants to merge 1 commit into
JesonChou wants to merge 1 commit into
Conversation
…badge (esengine#7649) Problem: The ask tool's `multiSelect` parameter was optional. The model frequently omitted it when the question required multiple selections. When `multiSelect` was missing, the desktop AskCard's toggleOption would replace each pick (single-select branch) instead of accumulating them, silently restricting the user to a single choice. The UI also lacked any visual indicator of whether multi-select was active. Root cause: `multiSelect` was not in the schema required list, so models were free to omit it — producing `false` in Go and `undefined` (falsy) in the frontend. Every subsequent selection replaced the previous one via: { ...sel, [question.id]: [label] } // single-select: replace all Fix: - agent/ask.go: add `multiSelect` to the question-level required array. - agent/ask.go: strengthen the Description and field description to warn that omitting `multiSelect: true` silently restricts picks. - AskCard.tsx: render a multi-select badge next to the header. - zh.ts / zh-TW.ts / en.ts: add `ask.multiSelectBadge` i18n keys. - ask_test.go: update provider contract hash after schema change. - golden/*: regenerate baselines to match the new tool description. Verification: - gofmt -l → OK - go vet ./internal/agent/ → OK - go test ./internal/agent/ -run Ask → 11/11 PASS - go test ./internal/boot/ -count=1 → PASS Cache-impact: high — ask tool schema and description changed; golden system_prompt.txt, tool_schemas.json, provider_request.json, and prefix_shape.json all drift. System-prompt-review: @esengine — schema required-array change and tool description increase prompt token count slightly; verify prefix cache budget.
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.
Summary
Fix #7649
When the
asktool presented a multi-pick question, the desktop UI appeared to accept multiple selections but actually replaced each pick with the last — silently restricting the user to a single choice. This happened becausemultiSelectwas optional in the schema and the model frequently omitted it.Root causes
multiSelectwas not required. The tool schema's question-levelrequiredarray listed only["question","header","options"], so the model could legally omitmultiSelect. When omitted, Go defaulted it tofalseand the frontend receivedundefined(falsy), which triggered the single-select replace branch intoggleOption:{ ...sel, [question.id]: [label] }← replaces the entire selectionNo visual indication. The desktop AskCard had no checkbox, badge, or label telling the user whether the current question was multi-select or single-select.
Changes
internal/agent/ask.gomultiSelectto the question-levelrequiredarray; strengthen Description and field description to warn about consequences of omissiondesktop/frontend/src/components/AskCard.tsxq.multiis truedesktop/frontend/src/locales/zh.ts"ask.multiSelectBadge": "可多选"desktop/frontend/src/locales/en.ts"ask.multiSelectBadge": "Multi-select"desktop/frontend/src/locales/zh-TW.ts"ask.multiSelectBadge": "可多選"internal/agent/ask_test.gointernal/boot/testdata/golden/*Verification
Automated
gofmt -l→ OKgo vet ./internal/agent/→ OKgo test ./internal/agent/ -run Ask→ 11/11 PASSgo test ./internal/boot/ -count=1→ PASSManual (desktop)
multiSelect: true.Compatibility
multiSelectwas optional; now required — model must always provide a booleanmultiSelectwill now fail validation; the model learns the new schema immediately)ask.multiSelectBadgekeys added to three locale filesCache impact
Cache-impact: high — ask tool schema and description changed; golden system_prompt.txt, tool_schemas.json, provider_request.json, and prefix_shape.json all drift. The model-facing prompt prefix will change on the first turn after this merges.
Cache-guard: go test ./internal/agent/ -run Ask -count=1, go test ./internal/boot/ -count=1
System-prompt-review: @esengine — schema required-array change and tool description increase prompt token count slightly; verify prefix cache budget.