github / github/copilot-cli

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

Aberta
#3,323 1 comentário 2 reações 0 responsáveis Ver no GitHub
area:tools
Linguagem predominante
Shell
Estrelas
11.2k
Forks
1.9k
Merge médio
14h 16min
PRs com merge (30d)
6

Descrição

### 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.

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
shell
Domínio
cli
Tipo de issue
Funcionalidade
Dificuldade
4/5
Tempo estimado
3-5 dias
Status de atividade
Ativa
Clareza
Razoavelmente clara
Facilidade para iniciantes
52/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.