Skip to content

Commit 279c9c0

Browse files
committed
docs: say the acknowledgement no longer waits, not that handlers run after it
Deferred handlers launch at acknowledgement time and may start before the 2xx is written, so "runs after the acknowledgement" overstated the order. _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
1 parent f7365a7 commit 279c9c0

4 files changed

Lines changed: 12 additions & 11 deletions

File tree

‎docs/how-to/deferred-dispatch.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ expects a first agent activity within about 10 seconds. By default the runtime
55
runs your handler *before* it acknowledges the webhook, so a handler that
66
calls an LLM can easily miss those deadlines.
77

8-
Deferred dispatch fixes this. The runtime acknowledges the webhook first and
9-
runs your handler afterwards on a detached context
8+
Deferred dispatch fixes this. The acknowledgement no longer waits for your
9+
handler, which runs on a detached context
1010
([ADR 0002](../adr/0002-async-dispatch.md)).
1111

1212
## Enable It
@@ -41,9 +41,9 @@ Dispatch runs in two parts:
4141

4242
1. **Before the acknowledgement**, on the request context: signature
4343
verification, normalization, dedupe marking, and thread lock acquisition.
44-
2. **After the acknowledgement**, on a runtime-managed detached context: your
45-
handler. It runs concurrently with the webhook response and may start
46-
just before the 2xx is written. While it runs, the runtime renews the
44+
2. **Launched at acknowledgement time**, on a runtime-managed detached
45+
context: your handler. It runs concurrently with the webhook response and
46+
may start just before the 2xx is written. While it runs, the runtime renews the
4747
thread lock lease in the background.
4848

4949
If the lease is lost — the state backend fails to extend it, it expires, or

‎docs/how-to/interactive-components.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ mention, post Block Kit content with an `mrkdwn` text element containing
117117
Under the default `DispatchSync`, the adapter sends Slack its empty 2xx only
118118
after your handler returns, so a slow handler can miss Slack's 3-second
119119
budget. Enable [deferred dispatch](deferred-dispatch.md), usually with
120-
`chat.ConcurrencyQueue`, so the handler runs after the acknowledgement.
120+
`chat.ConcurrencyQueue`, so the acknowledgement no longer waits for your
121+
handler.
121122

122123
## Open A Modal
123124

‎docs/how-to/linear-agent-sessions.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ sections).
5353

5454
Linear expects a first activity within about 10 seconds of a session event,
5555
and more activity within about 30 minutes. Enable
56-
[deferred dispatch](deferred-dispatch.md) so the real work runs after the
57-
webhook is acknowledged. Then, in the handler:
56+
[deferred dispatch](deferred-dispatch.md) so the webhook acknowledgement no
57+
longer waits for the real work. Then, in the handler:
5858

5959
1. Post a quick **thought** (`PostThought`) right away. Not a response: a
6060
response ends the session.

‎examples/linear-agent-hello-world/README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,6 @@ Expected behavior:
143143
(`chat.AdapterAs[*linear.Adapter]`) rather than a generic runtime API.
144144
- Inbound signals (including `stop`) and structured session context are preserved
145145
on `Message.Raw`; read them with `linear.RawMessageFrom`.
146-
- This example runs under `chat.DispatchDeferred`, so follow-up work runs
147-
after the webhook is acknowledged, while the runtime holds and renews the
148-
thread lock.
146+
- This example runs under `chat.DispatchDeferred`, so the webhook
147+
acknowledgement does not wait for follow-up work, and the runtime holds and
148+
renews the thread lock while that work runs.

0 commit comments

Comments
 (0)