fix: tell ask_user models that the first option is shown as Recommended (#30196)

The ask_user card badges the first option of every question as "Recommended", but nothing ever told the model that. The model picks whatever order it likes, so the badge really means "listed first" and users act on a recommendation the model never made.

The ask_user tool description now states that the first option is labelled Recommended and that the model should list the option it recommends first, so the badge reflects an actual choice.

Kept the badge and instructed the model instead of adding a per-option "recommended" flag: the flag would need a schema change, validation in the request normalizer and a frontend change, for the same result in the common case. Dropping the badge was the other option, but it removes a useful affordance rather than fixing it.

Verified that the added line reaches the model by running the docstring through the tool-spec builder and checking the generated OpenAI function schema.

Fixes #30195
This commit is contained in:
Classic298 2026-09-19 16:59:18 +02:00 • committed by GitHub
parent 5d7c17f41a
commit 1f8f1f61bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -526,6 +526,7 @@ async def ask_user(
Use this when the next step depends on user intent, preference, or a tradeoff that cannot be inferred safely.
:param questions: 1-3 question objects, each with id, header, question, and 2-3 options. Each option needs label and description.
List the option you recommend first; the UI labels the first option Recommended.
:param allow_other: Whether users may enter a free-form answer instead of choosing one of the options
:param timeout_ms: How long the browser should keep the prompt open before cancelling it
:return: JSON with status and answers keyed by question id