Auto-render Slack ask_user questions as buttons when options are simple#187
Merged
Auto-render Slack ask_user questions as buttons when options are simple#187
Conversation
added 2 commits
April 18, 2026 14:01
Moves the "render buttons vs plain text" decision out of the system prompt and into the Slack IM adapter. Ode now inspects each question's options and posts an interactive actions block whenever they qualify as simple (2-5 labels, each <= 15 chars, no newlines), falling back to "Options: a / b / c" text otherwise. Both the SDK-emitted question.asked flow and the LLM-invoked ask_user action share the same renderer, so behavior is consistent.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Options: a / b / cplain text otherwise.question.askedevent (Path B, previously always plain text) and the LLM-invoked/api/action ask_user(Path A, previously 2-5 options only, hard-errored otherwise). The action API no longer rejects >5 options; they just render as text.ask_user/buttons guidance line frombuildSystemPrompt— the LLM doesn't need to know about it anymore.Changes
packages/core/runtime/helpers.ts— newhasSimpleOptions()heuristic.packages/core/types.ts—IMAdaptergains an optionalsendQuestion(channelId, threadId, question, options, prefix?)hook.packages/ims/slack/api.ts— extractpostSlackQuestion()(blocks when simple, plain text otherwise); simplifyask_usercase to reuse it.packages/ims/slack/client.ts— Slack adapter implementssendQuestionvia a lazy import of./apito avoid circular deps.packages/core/kernel/request-run.tsandpending-question.ts— preferim.sendQuestionwhen available, fall back to existingsendMessage+formatSingleQuestionPromptfor other platforms.packages/agents/shared.ts— remove the "use ask_user / buttons are enough" Slack system-prompt line.hasSimpleOptionsedge cases (len/newline/bounds) and for the multi-question follow-up usingsendQuestion.Testing
bun test packages/core packages/agents packages/ims→ 211 pass, 0 fail.ask_userwith 3 short options to a live thread (rendered as buttons) and with a long-label option (fell back to plain text).Discord and Lark adapters don't implement
sendQuestion, so they keep the existing plain-text behavior unchanged.