Skip to content

core: relay the Gemini Files video lifecycle for brain video watch in keyless workers #2738

Closed

Description

@schlessera

Blocked by #1673

Context

#1673 relays the brain CLI's paid providers from governed and strict workers through a metered host relay (startProviderRelay, packages/ui-sdk/src/server/provider-relay.ts). Under the maintainer's 2026-10-23 ruling on #1673 (D5), video is not relayed in the first slice: a relayed Gemini completion refuses a video part before any upload, with the [provider_unavailable … capability=video …] notice (packages/core/src/providers/completions/gemini.ts:106). brain video watch therefore stays unavailable in a relayed worker.

Video needs more than the relay's fixed POST routes. The Files lifecycle starts an upload session, sends the bytes to a provider-chosen upload URL, polls the file handle and deletes it with a fresh cleanup deadline (withVideoFiles, packages/core/src/providers/completions/video.ts:16-76). The qualification (docs/hosting/paid-cli-provider-qualification.md, "Admit each physical operation and retain native lifecycle") requires the host to validate upload destinations and keep a private registry of the handles a turn created. It must not accept worker-selected upload URLs or grant general GET/DELETE access.

Scope

  • Relay the Gemini Files lifecycle for a relayed brain video watch: the upload start, the byte upload to a host-validated upload URL, the poll and delete of the handles that turn's relay created, and the generation request.
  • Meter the generation and record the upload and cleanup attempts. Use the same budget admission and per-attempt receipts as the other relayed requests.
  • Cancellation still deletes the owned files.

Out of scope

  • JeV reranking, which is unrelayed by the same ruling.
  • Vertex or enterprise endpoints and async batch embeddings.
  • A general GET or DELETE route through the relay.

Acceptance criteria

  • In a relayed governed worker with no key, brain video watch runs against a fictional loopback Gemini endpoint the operator lists. The upstream sees the host key on every lifecycle request, and the worker sees none.
  • A worker-chosen upload URL, or a poll or delete for a handle the turn's relay did not create, is refused before contact. Each has a test.
  • A cancelled request deletes its uploaded files, shown by a test.
  • A blocked budget refuses the upload before any byte is sent.
  • Mutation receipt: drop the handle-ownership check, and the foreign-handle test fails.

Verification

ui-sdk and core tests under real bubblewrap, then bun run check:pr --base origin/main and the native hosted-app proof.

Contract impact

Additive. The CLI contract's video provider_unavailable capability stops appearing for relayed workers.

2026-10-24 triage at main dc5d3c73282c29a3f0098306d398743ee18ec791: made the still-open first-slice relay prerequisite #1673 canonical. Priority p2 reflects deferred, unscheduled D5 follow-up work, not a current-release commitment. The additive contract and offline ownership/budget/cancellation proof are explicit; no live provider call was made.

Activity

  1. added
    type: feat
    area: core
    area: ui-sdk
    security
    on Oct 23, 2026
  2. schlessera commented on Oct 23, 2026

    @schlessera
    OwnerAuthor

    Triage (maintainer, 2026-10-24): not in 0.44.0. Video was excluded from #1673's first slice (ruling D5), so this belongs to a later milestone. It stays on epic #1646 without a milestone until that milestone exists.

  3. added
    priority: p2
    contract
    blocked
    agent-ready
    on Oct 24, 2026
  4. schlessera commented on Oct 24, 2026

    @schlessera
    OwnerAuthor

    2026-10-24 triage: #1673 remains open and supplies the relay/accounting path this extension consumes. Added blocked plus its canonical declaration, contract and priority: p2. The complete ordinary brief has no unresolved needs, so it may carry agent-ready alongside blocked; it remains unpickable until the relay output is delivered. The maintainer’s no-0.44.0 ruling and existing parent are preserved.

  5. schlessera commented on Oct 24, 2026

    @schlessera
    OwnerAuthor

    Unblocked: #1673 is closed, so scripts/sync-project.ts is removing the blocked label.

  6. removed
    blocked
    on Oct 24, 2026
  7. self-assigned this
    on Nov 2, 2026
  8. schlessera commented on Nov 2, 2026

    @schlessera
    OwnerAuthor

    Claimed (token wi-2738-a411). Branch feat/2738-relay-video-files from epic/1646-cost-limits @ a62db8f27; the PR targets that epic integration branch.

  9. added this to the 0.45.0 milestone on Nov 2, 2026
  10. schlessera commented on Nov 2, 2026

    @schlessera
    OwnerAuthor

    Implementation is in #3312 (base epic/1646-cost-limits @ a62db8f27, head 4016e1970). It covers every acceptance criterion with keyless, offline tests, including a real-bubblewrap governed and strict brain video watch. It also has failing-first receipts and the required handle-ownership mutation receipt. Local check:pr passed. The PR is marked ready and hosted ready-candidate proof has been requested. This issue closes when the epic batch lands on main. The video.ts:16-76 and gemini.ts:106 citations above describe the pre-change tree; the docs carry updated ones.

  11. schlessera commented on Nov 2, 2026

    @schlessera
    OwnerAuthor

    Delivered to the epic integration branch epic/1646-cost-limits as 7e69bfd63 via #3312, after ready-candidate proof passed against the exact epic base. This issue closes when the epic batch lands on main.

  12. removed their assignment
    on Nov 2, 2026
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

    agent-readyarea: corearea: ui-sdkcontractpriority: p2securitytype: feat

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions