Skip to content

Refreshing a connection no longer crashes the session with large catalogs - #9

Merged
fforres merged 1 commit into
skywardfrom
fix/openapi-scoped-operation-list
Sep 26, 2026
Merged

fforres merged 1 commit into
skywardfrom
fix/openapi-scoped-operation-list

Conversation

@fforres

@fforres fforres commented Sep 26, 2026

Copy link
Copy Markdown

What users saw

Refreshing a connection (for example Google Sheets) failed about every second time with "Execution lost: the session was reset". The session Durable Object was hitting its memory limit (exceededMemory in Workers telemetry).

Cause

listOperations(integration) in the OpenAPI store read every stored operation row for every integration in the org, and schema-decoded each binding only to read its integration. With the Cloudflare API connection (about 2,700 operations) that allocated over 200 MB per refresh of an unrelated 17-operation connection. The second refresh in a session isolate crossed the 128 MB limit.

Change

  • Plugin storage list pushes keyPrefix into SQL (starts with) instead of loading the whole collection and filtering in JS. The JS prefix check stays as the exact filter.
  • The OpenAPI store lists only the integration's current key prefix and its legacy prefix, checks membership from the stored integration field, and decodes bindings of matching rows once.
  • New store test: listing one integration returns its current and legacy rows and never reads other integrations' rows (a malformed row from another integration used to make the call fail).

Verified in production

Deployed from the diagnostic branch. Four consecutive Sheets refreshes in the same isolate all succeeded (before: the second always failed). CPU per refresh dropped from about 1.2 to 2.9 s to 250 to 400 ms.

https://claude.ai/code/session_01VMqJkxznzTQaFVHHcttxpJ

…on in the org

listOperations read every stored OpenAPI operation row for all integrations and
schema-decoded each binding just to read its integration. With a large catalog
such as the Cloudflare API (about 2,700 operations) that allocated over 200 MB
per refresh, and the second refresh in a session isolate crossed the Durable
Object memory limit, surfacing as "Execution lost: the session was reset".

Plugin storage list now pushes keyPrefix into SQL, and the store lists only the
current and legacy key prefixes for the integration, decoding bindings of
matching rows once.

Claude-Session: https://claude.ai/code/session_01VMqJkxznzTQaFVHHcttxpJ
@fforres
fforres merged commit 9d0f7c2 into skyward Sep 26, 2026
4 of 40 checks passed
@fforres
fforres deleted the fix/openapi-scoped-operation-list branch September 26, 2026 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant