Skip to content

fix(runtime): tier 2 Postgres calls skip the Postgres argument size limit #663

Closed

Description

@allisonmahmood

Problem

runtime.postgres.bytes caps the size of a Postgres operation's arguments, such as a raw query's SQL and parameters. Only the browser runtime path enforces it: tier 1 calls through the broker go through Runtime.ts. Tier 2 handlers reach Postgres through the callback gateway (packages/runtime/src/CallbackGateway.ts), which never checks that limit. A tier 2 action can therefore send Postgres arguments larger than the documented contract limit, bounded only by the gateway's general per-call byte cap.

Found while building the PostHog integration. That PR (#662) enforces the equivalent runtime.posthog.bytes on both paths; Postgres was left as it was, to keep that PR to one concern.

Fix

Apply runtime.postgres.bytes to postgres.* callbacks in the gateway, refusing with the same too_large refusal tier 1 gives. Add a tier 2 test beside the existing tier 1 one.

Activity

  1. added
    bug
    ready-for-agent
    area:server
    area:integrations
    on Oct 13, 2026
  2. added a commit that references this issue on Oct 15, 2026
    1ccd521
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:integrationsarea:serverbugready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions