From 47f8cd1796774b5f641446e77b47f8a751109a5c Mon Sep 17 00:00:00 2001 From: joshavant <830519+joshavant@users.noreply.github.com> Date: Wed, 12 Aug 2026 16:02:26 -0500 Subject: [PATCH] fix(gateway): keep attachment capability reads prepared --- src/gateway/session-utils-model.ts | 4 +++- src/gateway/session-utils.test.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gateway/session-utils-model.ts b/src/gateway/session-utils-model.ts index ec3bbaae00ee..963868465a5a 100644 --- a/src/gateway/session-utils-model.ts +++ b/src/gateway/session-utils-model.ts @@ -407,9 +407,11 @@ export async function resolveGatewayModelSupportsImages(params: { } try { + // Attachment admission is a turn hot path. Consume lifecycle-prepared capabilities so a + // user send never starts full provider discovery before it can be acknowledged. const loadParams = { ...(params.agentId ? { agentId: params.agentId } : {}), - readOnly: false, + readOnly: true, }; const snapshot = params.loadGatewayModelCatalogSnapshot ? await params.loadGatewayModelCatalogSnapshot(loadParams) diff --git a/src/gateway/session-utils.test.ts b/src/gateway/session-utils.test.ts index a8093f98c334..21d65ba493f2 100644 --- a/src/gateway/session-utils.test.ts +++ b/src/gateway/session-utils.test.ts @@ -3650,7 +3650,7 @@ describe("resolveGatewayModelSupportsImages", () => { ).resolves.toBe(true); expect(loadGatewayModelCatalogSnapshot).toHaveBeenCalledWith({ agentId: "qa", - readOnly: false, + readOnly: true, }); expect(loadGatewayModelCatalog).not.toHaveBeenCalled(); });