Feature Request: ask_user enum/oneOf fields should always offer an 'Other / custom answer' escape hatch
- Lenguaje dominante
- Shell
- Estrellas
- 11.2k
- Forks
- 1.9k
- Merge medio
- 14 h 16 min
- PR fusionados (30 d)
- 6
Descripción
### 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.
Guía de contribución
Línea de trabajo
Empieza rastreando el manejo del esquema ask_user y la representación de las opciones en la CLI; después, revisa el issue #2067 para conocer el comportamiento relacionado. Se considera terminado cuando los campos enum/oneOf y multi-select enum/anyOf ofrecen automáticamente una ruta Other/custom-text sin descartar otras respuestas.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- shell
- Área
- cli
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Activo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 52/100