hue listen forwards signed Slack requests from the World instance to your bot’s HTTP receiver. Your bot calls the instance’s Slack Web API to reply. You don’t need to install the bot in a real workspace or enable tracing.
Before you begin
- Use a bot with an HTTP receiver, such as a Slack Bolt request handler, and a configurable Slack API URL, bot token, and signing secret. Socket Mode is not supported. You don’t need a public callback URL.
- Run the listener with Node.js 22.12 or later, even if your bot uses Python or another language. The CLI is in the npm package, not the Python package. Use SDK 0.27.0 or later for slash commands and buttons.
- Only Slack traffic goes to the Slack World. Configure other app clients to use test services and credentials.
Prepare a Slack World
Use a World whose Slack account acts as your bot. For a first test, ask your coding agent connected to Hue to generate one:Prompt
start_instance and get_instance_connections.
Register the subscription
Create a Read and write project key in Settings → API keys for the instance’s project. Load it intoHUE_API_KEY in your setup shell. Use the project key to create and inspect the subscription, not to run the bot or listener.
Create a listen subscription. Replace <running instance ID> with the instance ID, not the World version ID. Keep the response file out of Git because it contains the signing secret.
id and signingSecret. Registration sends no request to the bot. One active Slack subscription is allowed per instance; reuse it or revoke it before creating another.
Choose the event names your bot handles:
Configure the bot and start the listener
Put these values in your test configuration, such as an ignored.env.hue-slack file:
HUE_SIM_SLACK_WEB_API_URL and use HUE_WORLD_TOKEN in place of its Slack bot token. JavaScript Bolt uses clientOptions.slackApiUrl; JavaScript Slack WebClient uses slackApiUrl. Python Slack WebClient uses base_url. Set the values where your bot reads its configuration. An environment variable alone won’t change the client.
Configure the HTTP receiver with SLACK_SIGNING_SECRET. Keep normal Slack signature verification enabled. The listener preserves the signed body and headers, including form-encoded commands and button payloads. Your handler must answer url_verification with HTTP 200 and the echoed challenge; Slack frameworks usually handle this.
Start the bot with these values using its normal startup command. Wait until its HTTP receiver is listening, then run the listener in another terminal:
--env-path loads values for the listener only; it does not start the bot or configure its process. The listener forwards every subscribed request to this one URL. If your bot uses separate command or interaction paths, route those requests from this receiver to the corresponding handler.
localhost refers to the listener’s network namespace. For a containerized bot, run the listener in the same namespace or expose the bot’s port on the listener’s host. An off-machine receiver needs an HTTPS URL and --allow-remote-forward.
Wait until GET /api/v1/event-subscriptions/<subscription ID>, authorized with the setup project key, reports verification.state: "verified". The listener performs the verification handshake; don’t call the subscription’s /verify route.
Try a message and inspect the result
Keep both processes running. Open Slack in the instance and go to a channel your bot belongs to. Use the person picker above the message box to choose a teammate in that channel. Send a message your bot handles, such as@Ledger help, and check for the expected reply. In the instance’s Server tab, check that the bot’s Slack API calls reached the instance.
To run the same test over MCP, call send_instance_input. Use list_projects to find the instance’s project ID. If your connection is pinned to one project, omit project_id.
Look up the teammate and channel IDs with get_instance_state. Call auth.test with the bot’s test client to check the workspace and get the bot’s user_id. Use a new idempotency_key for each new input and reuse it if you retry.
BOT_USER_ID inside the mention and change help to a prompt your bot handles. Read the reply with get_instance_state (include_content: true) and inspect the bot’s calls with list_instance_requests.
Try direct messages and interactions
To message the bot directly, set the message’schannel to the bot’s own user ID (U…). Hue opens a direct message for the sender if one doesn’t exist and returns its D… ID in committed.channel. Commands and button clicks take a conversation ID, so send them to the D… ID. Any other user ID is refused with recipient_not_agent. Over REST, POST /api/v1/instances/<instance ID>/inputs takes the same value as channelId.
A slash command or button click carries a trigger_id that your bot can exchange once with views.open or views.push, as in Slack. To act in the modal it opened, send a button click with the modal’s view_id in place of a channel and message, or submit it with view_submission, its view_id and the inputs’ state.values. A button click can carry what the user has entered so far as values, which your bot receives in the payload’s view.state.values. Your bot’s HTTP response to the submission applies as Slack applies it: an empty body closes the modal, and response_action errors, update, push or clear does what it does in Slack. app_home_opened opens the app’s Home tab for a user and sends the home view your bot last published with views.publish.
Troubleshoot a missing reply
The input result’sdeliveries lists the events Hue announced to your subscription. When it is empty for a message, undelivered gives a reason and a message:
The result also gives the instance’s expiry:
expires_at over MCP, expiresAt over REST.
To see what Hue sent your bot and how it answered, list the subscription’s deliveries with the setup project key:
state, a settleReason such as acknowledged or world_sealed, and an attemptLog of every attempt with its outcome, HTTP status, diagnostic and duration. An event’s deliveryId matches the delivery_id (deliveryId over REST) in the input’s result; an attempt’s id is the delivery the listener pulled and acknowledged. For a slash command or button click, input.acknowledgement holds your bot’s answer: its status, its body up to 16 KiB, and replyStored, which says whether Hue stored the reply in the World. listening says whether a listener is pulling now. limit takes 1 to 200 (default 50); pass the answer’s nextCursor as cursor for the next page.
Your receiver must acknowledge within three seconds. A successful command or interaction can return an immediate reply body of at most 64 KiB; URL verification bodies are capped at 4 KiB. These responses must finish within the deadline, even when the body exceeds the capture limit. An interrupted response reports connection_failed without sending its partial body to Hue. Larger bodies are truncated, which can change the displayed reply. Ordinary event response bodies and unsuccessful response bodies stay on the listener’s machine.
Hue stores a slash command’s successful reply in the World as Slack shows it: an ephemeral message that only the sender sees, or a channel message when the reply sets response_type to in_channel. An empty body posts nothing.
Return immediate replies without HTTP compression; the listener does not decode compressed receiver responses. Keep successful replies suitable for storage as test evidence. A response_url in a request authorizes later replies, so keep it out of application logs and shared output.
The listener remembers recent delivery results in memory. A restart loses that memory, and the listener does not guarantee exactly-once execution. Make financial writes and other business effects safe to retry in your application.
Stop and clean up
An instance also stops when its lifetime ends; Use an instance gives the defaults. Its subscription then receives no more events, its world token stops working, and an input answersinstance_closed, whose message says when the instance expired or was stopped. For a longer test, start a new instance with a longer lifetime and register a subscription for it.
Press Ctrl+C to stop the listener. It waits for deliveries in progress. Stop the test bot and the World instance. Remove the ignored .env.hue-slack and .hue-slack-subscription.json files when you no longer need their credentials. For a fresh instance, repeat the connection and subscription setup with its own values.