🔒 Protected via Cloudflare Access
Question Tool — Thread Recap
What We Built
Replaced auto-generated action blocks with an explicit question tool that agents call when they need structured input from Dom.
Files Changed
tools/question.js(new) — ~300 LOC, non-blocking toolindex.js— disabled action blocks import, registered question tool + handler~/.openclaw/skills/justin/SKILL.md— added brevity rule + question-on-every-message ruleopenclaw.json— addedquestiontotools.alsoAllowglobally + per-agent
How It Works
- Agent calls
question(prompt, options) - Discord renders: buttons (≤2 options) or combo (first option as button + rest in dropdown)
- Tool returns immediately (non-blocking)
- User clicks → webhook dispatch triggers agent turn + system event backup
- Agent wakes with
[Question answered] "prompt" → User selected: "label" (index N)
Key Design Decisions
- Non-blocking — no timeout fighting with OpenClaw's inbound worker
- No expiry — buttons live forever until clicked (
reusable: true, no TTL) - Restart survival — state persisted to
.question-state.json; click handler reads persisted state post-restart - Webhook + system event — dual dispatch ensures agent wakes reliably
- First option = default — the most likely action (approve, continue, close) goes first as the primary button
- Emoji in labels — no separate text blocks above buttons, emoji baked into button text
Rendering Rules
| Options | Style |
|---|---|
| 1-2 | Buttons only |
| 3+ | First as button (primary), rest in dropdown |
New Global Rules (justin skill)
- Every message ends with
questiontool — structured options, not freeform prose questions - Brevity — 20-40 words ideal, 100 max. Overflow →
showtool
Commits
feat: add question tool, disable action blocksfix: add webhook dispatch to question click handler for agent wakefeat: add combo style (buttons + dropdown) to question toolfeat: final question tool spec — emoji in labels, combo layout, up to 10 options, default-firstfeat: add question tool guidance to global justin skill