fix(webhook): disable async delivery for single-shot HTTP ingress - #69166
fix(webhook): disable async delivery for single-shot HTTP ingress#69166Bartok9 wants to merge 3 commits into
Conversation
|
Thanks @alt-glitch — good catch on the overlap. This PR's distinct value is extending the capability flag to |
|
Thanks for tracing the generic webhook lifecycle. The Problems
Suggested changes
Automated hermes-sweeper review. |
|
Thanks @teknium1 — applied both suggestions:
Green locally ( |
Closes NousResearch#69145 Root cause: NousResearch#66617 bound declare_stateless_channel for hermes -z and cron so delegate_task runs inline when the channel cannot wake after the turn. Webhook (and msgraph_webhook) keep supports_async_delivery= True by default; gateway marks the parent session ended after one response, then NousResearch#55578 drops ASYNC DELEGATION BATCH COMPLETE injections. Fix: set supports_async_delivery=False on WebhookAdapter and MSGraphWebhookAdapter so run.py _set_session_env propagates the capability like APIServerAdapter. Verification: pytest tests/gateway/test_async_delivery_capability.py -q
…n test Address hermes-sweeper review: - Drop the MSGraphWebhookAdapter flag; it has no demonstrated ended-session stranded-completion path (stable subscriptionId chat id, no on_processing_complete session-close override). Investigate separately if a concrete reproduction appears. - Replace class-attribute-only assertion with a _set_session_env regression test that verifies the gateway actually binds async_delivery=False for a webhook inbound, plus a delivering-platform (telegram) control that binds True through the same path.
ba365b3 to
59b09c7
Compare
Summary
Closes #69145
Webhook (and MS Graph webhook) one-shot sessions still strand background
delegate_taskresults: the parent turn ends, the session is marked ended, and the #55578 fail-closed path drops async completion injection. #66617 fixed the same class of bug forhermes -zand cron viadeclare_stateless_channel()/async_delivery=False; the gateway path already propagates each adapter'ssupports_async_deliveryflag in_set_session_env, but webhook left the defaultTrue.Motivation / Root cause
background=True.finish_reason=stop, completions cannot safely re-enter an ended session.Fix
Set
supports_async_delivery = Falseon:gateway/platforms/webhook.py—WebhookAdaptergateway/platforms/msgraph_webhook.py—MSGraphWebhookAdapterAPIServerAdapteralready does this. Tools that consultasync_delivery_supported()then fall back to synchronous inline delegation (existing #53027 / #63142 / #66617 path).Tests
tests/gateway/test_async_delivery_capability.py::TestAdapterCapabilityFlag::test_api_server_falseto assert webhook + msgraph flags.Verification
15 passed.