feat: ask_user — structured questions from the agent with web card, channel buttons, and text answers (#109922)

* feat(gateway): add transient question runtime (question.* methods + broadcasts)

* feat(agents): add blocking ask_user question tool with chat prompt delivery and text-reply claim

* feat(ui): interactive in-thread question cards for ask_user

* feat(channels): native tap-to-answer buttons for ask_user on Telegram, Discord, and Slack

* feat(ui): unify codex and gateway question cards with interactive gateway answering

* refactor(agents): collapse ask_user pending state to one registry; docs for ask_user

* fix(agents): include ask_user in normal gateway runs; add question-flow control-ui e2e

* test(ui): avoid credential-shaped fixture in question card test

* refactor(ui): reorder stream-group context keys

* fix(gateway,ui): validate question answers at resolve; reject secret/duplicate-label questions; UI retry and reconnect hardening

* fix(gateway,agents): canonicalize accepted option answers; bound ask_user option labels to 64 chars

* chore(ci): prune unused question exports, allowlist mobile question events, fix discord lint

* chore(ci): regenerate protocol/i18n/docs/tool-display artifacts for question surface

* fix(protocol): flatten QuestionRecord for native codegen; drop TS-only alias from schema registry

* chore(android): regenerate ask-user localization resources

* docs: regenerate docs map after rebase

* fix(ci): avoid stale read-only dependency disks

* test: remove stale reef lint suppression ratchet

* fix(ci): keep source locale drift advisory in release gates

* fix(ci): scope locale advisory handling to parity check
This commit is contained in:
Peter Steinberger
2026-07-17 22:24:17 +01:00
committed by GitHub
parent bab9a5ede7
commit da44d52ac6
143 changed files with 7814 additions and 334 deletions
+11
View File
@@ -77,6 +77,11 @@ type MessagePresentationAction =
approvalKind: "exec" | "plugin";
decision: "allow-once" | "allow-always" | "deny";
}
| {
type: "question";
questionId: string;
optionValue: string;
}
| { type: "url"; url: string }
| {
type: "web-app";
@@ -136,6 +141,12 @@ Button semantics:
encode that action into a transport-private callback and resolve it through
the approval service; they must not parse `/approve` command text or infer
kind from the ID.
- `action.type: "question"` identifies one choice for a live, runtime-authored
`ask_user` question. Like `approval`, this is an OpenClaw runtime action;
agents and plugins must not synthesize question IDs. Telegram, Discord, and
Slack map it to transport-private native callbacks and resolve the choice
through the Gateway. Other channels degrade the controls to label text, and
the user can answer with a plain-text reply.
- `action.type: "url"` opens a normal link.
- `action.type: "web-app"` launches a channel-native web app. Set `url` for a
URL-backed app or `widgetId` for an OpenClaw-hosted widget whose launch
+1
View File
@@ -136,6 +136,7 @@ deprecated for new code; see the per-row notes below.
| `plugin-sdk/telegram-account` | Deprecated Telegram account-resolution compatibility facade for tracked owner compatibility; new plugins should use injected runtime helpers or generic channel SDK subpaths |
| `plugin-sdk/zalouser` | Deprecated Zalo Personal compatibility facade for published Lark/Zalo packages that still import sender command authorization; new plugins should use generic channel SDK subpaths |
| `plugin-sdk/interactive-runtime` | Semantic message presentation, delivery, and legacy interactive reply helpers. See [Message Presentation](/plugins/message-presentation) |
| `plugin-sdk/question-gateway-runtime` | Resolve runtime-authored `ask_user` choices through the Gateway from channel interaction handlers |
| `plugin-sdk/channel-inbound` | Shared inbound helpers for event classification, context building, formatting, roots, debounce, mention matching, mention-policy, and inbound logging |
| `plugin-sdk/channel-inbound-debounce` | Narrow inbound debounce helpers |
| `plugin-sdk/channel-mention-gating` | Narrow mention-policy, mention marker, and mention text helpers without the broader inbound runtime surface |