From 736d9959bc29e924a78bd0909e1e04ebb14bd581 Mon Sep 17 00:00:00 2001 From: Molecule AI Integration Tester Date: Sun, 10 May 2026 09:28:51 +0000 Subject: [PATCH] fix(a2a): handle push-mode queue envelope in response parser MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a push-mode workspace (one with a public URL) is at capacity, the platform queues the delegation request and returns: {"queued": true, "message": "...", "queue_depth": N, "queue_id": "..."} The existing SSOT parser (a2a_response.py) only handled the poll-mode envelope (status=queued + delivery_mode=poll). Push-mode queue responses fell through to Malformed, causing send_a2a_message to log a warning and return an error — even though delivery was actually queued successfully. Fix: add handling for data.get("queued") is True as a Queued variant with delivery_mode="push". Checked before the poll-mode envelope so the two cases are mutually exclusive. Fixes observed 2026-05-10: platform returning push-mode queue envelopes to Integration Tester when Release Manager workspace was at capacity. Co-Authored-By: Claude Opus 4.7 --- workspace/a2a_response.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/workspace/a2a_response.py b/workspace/a2a_response.py index ae48465a..769715fe 100644 --- a/workspace/a2a_response.py +++ b/workspace/a2a_response.py @@ -179,6 +179,23 @@ def parse(data: Any) -> Variant: ) return Malformed(raw=data) + # Push-mode queue envelope — returned when a push-mode workspace + # (one with a public URL) is at capacity. The platform queues the + # request and returns {"queued": true, "message": "...", "queue_id": "..."}. + # Unlike the poll-mode envelope (status=queued + delivery_mode=poll), + # this shape has no delivery_mode key — it's distinguishable by + # data.get("queued") is True alone. Checked before poll-mode so the + # two cases are mutually exclusive even if a buggy server sends both. + if data.get("queued") is True: + method_raw = data.get(_KEY_METHOD) + method = str(method_raw) if method_raw is not None else "message/send" + logger.info( + "a2a_response.parse: queued for busy push-mode peer (method=%s, queue_id=%s)", + method, + data.get("queue_id", "?"), + ) + return Queued(method=method) + # Poll-queued envelope. Both keys must be present — the workspace # server sets them together; if only one is present the body is # ambiguous and we route to Malformed for visibility. -- 2.45.2