🔒 Protected via Cloudflare Access

question Tool — Design Doc

Summary

Replace auto-generated action blocks with an explicit question tool. Agents call it when they need structured input from Dom. Buttons render in Discord, clicks route back to the agent session.


Why

Current (action blocks):

Proposed (question tool):


Tool Spec

question(params) → { answered: true, selected: "..." }

Parameters

Example Call

{
  "prompt": "Which approach for the cache layer?",
  "options": [
    { "label": "Redis", "emoji": "⚡", "description": "Fast, in-memory, needs separate service" },
    { "label": "Postgres", "emoji": "🐘", "description": "Already running, slower but simpler" },
    { "label": "Skip caching", "emoji": "⏭️" }
  ]
}

Discord Rendering

Buttons Style (default, ≤3 options)

Uses Discord Components v2 container with:

Select Style (4+ options or explicit)

Uses string select component with maxValues: 1.


Response Routing — The Key Insight

Synchronous Tool Response (blocking)

Unlike action blocks (which use webhook + system event to simulate a new user turn), question blocks the tool call until Dom responds:

  1. Agent calls question() tool
  2. Plugin sends Discord component message via sendDiscordComponentMessage
  3. Plugin blocks the tool call — does not return result yet
  4. Dom clicks a button
  5. Interactive handler fires, resolves the pending promise
  6. Tool returns { answered: true, selected: "Redis", index: 0 }
  7. Agent continues with the answer in context

Why this eliminates the expiry problem:

Timeout Handling

If timeout elapses before Dom clicks:


Disabling Action Blocks

Kill entirely (not opt-in). One line change in index.js:

- actionBlocks.setup(api);
+ // actionBlocks.setup(api) — replaced by question tool

Then clean up: delete lifecycle/action-blocks.js, .action-blocks-state.json, and action block refs in tools/debug.js.


Coexistence with show

They complement each other. An agent could combine them:

  1. show(content="Here's the analysis of both approaches...")
  2. question(prompt="Which one?", options=[{label:"A"}, {label:"B"}])

Migration Path

  1. Implement question tool alongside action blocks
  2. Disable action blocks
  3. Clean up action blocks code
  4. Update SKILL.md files to document question

Open Questions

  1. Multi-select? Add multi: true param for picking multiple options?
  2. Free-text? Optional "Other..." button that opens a modal for custom input?
  3. Auto-question on explicit questions? No — the whole point is intentional, not automatic.
  4. Tool availability: All agents, or only mindset agents? (Suggestion: all)

Estimated Complexity