github / github/copilot-cli

Feature Request: ask_user enum/oneOf fields should always offer an 'Other / custom answer' escape hatch

Đang mở
#3,323 1 bình luận 2 reaction 0 người được giao Xem trên GitHub
area:tools
Ngôn ngữ chính
Shell
Star
11.2k
Fork
1.9k
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
6

Mô tả

### Describe the feature or problem you'd like to solve

The `ask_user` tool requires each field to be either a fixed `enum`/`oneOf` (no escape hatch) or a fully open-ended `string` (no suggestions). There's no way for the agent to offer suggested choices while still letting the user provide a custom answer on the same field.

When the agent doesn't know all the valid answers in advance, it has to either:
1. Guess at an enum (forcing the user into one of the agent's guesses), or
2. Use a plain string field (giving the user no guidance), or
3. Manually add an `"Other"` / `"I don't know"` value to the enum (which the agent often forgets to do)

If the user picks "decline" to escape, they lose all their other field inputs, not just the one they don't know.

### Proposed solution

Adopt the pattern Claude Code's `AskUserQuestion` uses: the tool runtime automatically appends an "Other" option to every multiple-choice question, which opens a freeform text input. The agent declares structured suggestions; the runtime guarantees the user can always escape with a custom answer.

From the Claude Code system prompt (extracted from the binary):

> "Users will always be able to select 'Other' to provide custom text input"
>
> "The available choices for this question. ... There should be no 'Other' option, that will be provided automatically."

For Copilot CLI's `ask_user`, this could be:
- On `string` fields with `enum`/`oneOf`: render an additional "Other..." option that opens a freeform input.
- On array fields with `enum`/`anyOf` (multi-select): same — an "Other..." entry that opens freeform.
- The agent declares `enum` choices as before; the runtime adds the escape hatch.

Alternative (less elegant): add an `allowOther: true` field on the schema, or document a convention that the agent must include `"Other (please specify)"` in every enum. But the auto-injection approach matches Claude Code's prior art and means agents don't have to remember.

### Example prompts or workflows

A user asks me to create a service account YAML and I need to know which orgs it should belong to. I know the common orgs but not which ones apply to this specific service account.

Current behavior — I either:
- List the orgs I know as a multi-select enum, forcing the user to pick from my guess, OR
- Use a plain string field "comma-separated org names", losing autocomplete-style guidance

Desired: I offer the common orgs as suggested choices, the runtime adds an "Other..." escape, and a user who doesn't know can either pick a sensible default I marked or type whatever's appropriate.

### Additional context

Related: #2067 (multiline freeform input). That's a different but adjacent gap — even today's freeform string fields are single-line only.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start by tracing the ask_user schema handling and choice rendering in the CLI, then review related issue #2067 for adjacent behavior. Done means enum/oneOf and multi-select enum/anyOf fields offer an automatically injected Other/custom-text path without discarding other answers.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
shell
Lĩnh vực
cli
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
52/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.