feat(question): let the agent flag the option it recommends
Closed
KE
1mo ago+49+49+01234567890123456789-3-3-0123456789
The agent can now flag the option it would pick on every question. Replo shows it as a "Recommended" tag. When nobody answers in Slack, Messages, or a task, Replo goes with it instead of blindly taking option 1.
Context: step 3 of the auto-answer plan (Slack thread) · consumers: andytown's tag (next PR) and the auto-answer in andytown #28112 · builds on the saved answers from #59, released as v1.18.32-4.
Why a flag
- Today the recommendation is text: the tool says to put your pick first and append "(Recommended)" to its label. That text leaks into answers, and screens have to parse it.
- It's worth using: over the last 30 days, when the agent marked one, people picked it 70% of the time (316 of 452 option picks). Without a mark, option 1 was picked 64% of the time (483 of 755).
- It's used too rarely: only 29% of steps carry one today. The new rule asks for it on every step.
What changed
- Schema:
QuestionOption(v1) andQuestionV2.Optionget an optionalrecommendedboolean. The v1 description sits insideSchema.optional, so it ships in the OpenAPI and the SDK. - Tool rule (v1
question.txtand v2core/tool/question.ts): setrecommended: trueon the option you'd pick, keep "(Recommended)" out of labels, and leave it off only for choices that are the user's alone (payments, credentials, publishing). - No timer, no auto-answer here. Andytown's coordinator decides when to use the flag, because its alarms survive opencode restarts.
- SDK regenerated by hand (the generate job can't run on the fork). The diff is the new field only.
Testing Done
- Tool test: an asked question keeps
recommended: truethrough the stored row, read back vialist(). Removing the field from the schema fails it. - Route harness:
question.listnow asserts the flag on the HTTP body, since the seeded option carries it.test:httpapipasses 213/213 in coverage, auth, and effect modes. - Question service: 17/17. Typecheck: 30/30 packages.
Next
- Review and merge. I won't merge it.
- I cut v1.18.32-5 with the SDK tarball, then move andytown's three pins.
🤖 Generated with Claude Code
Summary by cubic
Lets the agent flag the option it recommends on every question, replacing the old "(Recommended)" label suffix.
- Adds an optional
recommendedboolean toQuestionOptionandQuestionV2.Option, shipped in the OpenAPI and regenerated SDK. - Updates the tool rules: set
recommended: trueon the option you would pick, keep "(Recommended)" out of labels, and leave the flag off only for choices that are the user's alone (payments, credentials, publishing). - This PR only stores and surfaces the flag; the auto-answer that uses it when nobody responds lands in andytown separately.