3.5.0
BoxLang AI Module 3.5.0. A transport-agnostic gateway processing API, webhook verification handshakes, and a new minimum BoxLang runtime of 1.14.0.
Released: September 11, 2026
BoxLang AI 3.5.0 makes the gateway layer usable from any host framework. The request processing that sat behind public/gateway.bxm is now a set of transport-agnostic statics that take the pieces of a request and return a normalized result, so a framework with its own router (ColdBox, for example) can mount the gateway surface wherever it likes. It also adds the verification handshake that chat platforms perform before they start posting webhooks.
⚠️ Migration
The minimum BoxLang runtime is now 1.14.0 (box.json minimumVersion, previously 1.8.0). BoxLang 1.13 and earlier resolve unqualified identifiers inside a catch body against the class variables scope before locals and arguments. BoxLang 1.14.0 fixed this. The module still qualifies its own catch reads, but middleware, tools and interceptors you write should not rely on older runtimes. The module now compiles and tests against BoxLang 1.17.0.
✨ New Features
🔌 Transport-Agnostic Gateway Processing
GatewayRequestProcessor now exposes four statics that touch no transport. Each takes the parts of a request and returns { statusCode, body, contentType, headers }.
processInbound( gatewayName, rawBody, headers, session )
Verify the signature, parse the body, and optionally dispatch each message into a GatewaySession
processHandshake( gatewayName, params )
Answer a platform's URL verification request
readInteraction( requestID )
Read one pending human-in-the-loop interaction
submitDecision( requestID, rawBody, headers )
Verify the signature and submit the human decision for a pending interaction
processHttp() is now a thin layer over the same statics, so the existing /~bxai/gateway.bxm surface is unchanged.
import bxModules.bxai.models.gateway.http.GatewayRequestProcessor;
// In your own router or handler
result = GatewayRequestProcessor::processInbound(
gatewayName: "my-platform",
rawBody : getHTTPRequestData().content,
headers : getHTTPRequestData().headers,
session : mySession
)
// result.statusCode, result.body, result.contentType, result.headersPass the raw body unchanged. Signatures are computed over the exact body string, so it must not be re-serialized before it reaches processInbound().
Dispatch, not just parse: when you pass a GatewaySession, every parsed message is handed to handleInbound() and acknowledged with 202 immediately. The returned futures are deliberately never joined, because a platform webhook times out in seconds and an agent turn does not. The response reports which thread each message landed on:
A single-message event also sets an X-Thread-Id header, so a caller can correlate the reply that arrives later. Without a session, processInbound() parses only and returns 200 with the normalized messages, exactly as before.
Documentation: Gateways
🤝 Verification Handshakes: IGateway.verifyHandshake()
Many platforms send a GET to your webhook URL before they start posting to it, to prove the URL is yours. Meta's WhatsApp Cloud hub.challenge echo is the classic example.
Override
verifyHandshake( params )in a gateway and declare the new"verifyHandshake"capability.The method returns a response (
statusCode,body,contentType) rather than a boolean, because most handshakes echo a challenge back as plain text.The default throws
GatewayCapabilityNotSupported, so only gateways whose platform performs a handshake need to override it.processHandshake()answers405for any gateway that does not declare the capability.MockGatewayis the reference implementation.
🧵 GatewaySession.resolveThreadId() Is Public
resolveThreadId( message, sourceGateway ) is pure and side-effect free, and it is now public. A caller that dispatches without waiting on the turn needs it to report where the work landed, and getQueueDepth() and cancelRun() are addressed by a thread id the caller has to be able to compute.
🪲 Fixed
An inbound event whose body is not valid JSON is now rejected with
400and a message naming the parse failure, instead of surfacing as a generic500.OpenAI compatible chat providers now fail with a
ProviderErrorwhen a response omitschoices, and use top-levelmessagewhen present. This prevents intermittent Mistral tool-call crashes fromKeyNotFoundException.
📖 Documentation
Last updated