Skip to content

Each call re-sends the whole bundle to the supervisor #751

Closed

Description

@allisonmahmood

Every top-level call sends the full server bundle (~216 KB) in POST /bind (Invocation.ts → the task provider → supervisor.ts). When that version is already resident with the same hash, the supervisor returns the existing process without using the bytes. On a warm path the upload is pure waste.

Fix

Add a bind that carries the binding and hash without the bundle.

  • Same checks as a full bind: company, binding epoch, config and callback URLs. Wait for a resident that is still loading, and re-check the epoch after the wait. Return the current process generation.
  • Not resident: reply that the bundle is needed; the host then sends a full bind, using Each call re-reads its server bundle from object storage #747's cache.
  • Keep the existing checks: the host's binding verification and invoke's generation/hash checks stay.
  • Eviction between bind and invoke: today bundle_required/stale_generation surface as handler_failed. Add a bounded recovery that rebinds and retries only when dispatch provably didn't happen. Never replay an invocation after uncertain transport loss, and never reuse a stale generation.
  • Rolling deploy compatibility: the management schemas are strict, so a new host can't send new fields to an old supervisor. Version or negotiate the request before sending them.
  • Local execution (packages/execution/src/local.ts) gets the same seam.

Tests:

  • a hash-only bind to a resident version;
  • a hash-only bind to a loading version;
  • a hash-only bind that needs the bundle;
  • eviction between bind and invoke recovers before dispatch;
  • a new host against an old supervisor.

Land after #747: the full-bind fallback uses its cache.

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:serverenhancementready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions