From 483724e63662967d207fd4e6c95bbac0b61f16a9 Mon Sep 17 00:00:00 2001 From: zak Date: Fri, 15 May 2026 15:01:26 +0100 Subject: [PATCH 1/2] Add AI Transport SDK error codes (104000-104011) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Register the AI Transport SDK's 104xxx custom error codes so SDK validation against this registry passes. The codes cover SDK-specific scenarios that don't map cleanly to existing entries: - 104000-104008 — encoder recovery, transport lifecycle, channel continuity, stream piping (added with earlier branches). - 104010 "run start deadline exceeded" — client send() did not observe x-ably-run-start within the configured deadline. - 104011 "user prompt not found within lookup deadline" — agent's channel-rewind lookup for the client-published user message lapsed without a match. Capability failures reuse Ably's existing 40160 ("operation not permitted with provided capability") rather than coining a new code. --- protocol/errors.json | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/protocol/errors.json b/protocol/errors.json index 3c432ec9..5d6be3a9 100644 --- a/protocol/errors.json +++ b/protocol/errors.json @@ -254,5 +254,17 @@ "103000": "unable to publish push notification", "103001": "unable to publish push notification, retries exhausted", "103002": "unable to publish push notification, no recipient for direct publish", - "103003": "unable to publish push notification, cannot handle body" + "103003": "unable to publish push notification, cannot handle body", + + "104000": "encoder recovery failed after flush", + "104001": "transport subscription callback error", + "104002": "cancel listener error", + "104003": "turn lifecycle event publish failed", + "104004": "transport is closed", + "104005": "transport send failed", + "104006": "channel continuity lost", + "104007": "channel is not ready", + "104008": "source event stream failed during piping", + "104009": "run start deadline exceeded", + "104010": "user prompt not found within lookup deadline" } From a78f596baa86f170a07c7b53910b213c54a0898d Mon Sep 17 00:00:00 2001 From: zak Date: Tue, 9 Jun 2026 15:33:58 +0100 Subject: [PATCH 2/2] Reserve 104011: channel history fetch failed Used by @ably/ai-transport when channel.history() pagination exhausts its bounded retry budget during conversation hydration. --- protocol/errors.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/protocol/errors.json b/protocol/errors.json index 5d6be3a9..6c58dbf6 100644 --- a/protocol/errors.json +++ b/protocol/errors.json @@ -266,5 +266,6 @@ "104007": "channel is not ready", "104008": "source event stream failed during piping", "104009": "run start deadline exceeded", - "104010": "user prompt not found within lookup deadline" + "104010": "user prompt not found within lookup deadline", + "104011": "channel history fetch failed" }