Skip to content

Fix '+ New fleet' first-creation gap — wire manifest creation through deploy_apply (blocks #104's k8s dispatch) #111

Description

@brettchien

Context

Discovered while investigating #104 (k8s console onboarding): traced deploy_provision's call chain (deploy_provisiont_provisionprovision_from_libraryoabctl::studio_api::redeploy) and found redeploy() requires an already-stored manifest (load_manifest() → S3 GetObject at manifests/{namespace}/{name}.yaml) — it only patches an existing manifest's image/bundle_from, it never creates a manifest's first version.

The only place a manifest's first version gets written to S3 is apply.rs::apply_manifests (called via deploy_applyapply_deployment), which requires the caller to hand it a complete manifest YAML (networking, resources, secrets, runtime — everything create.rs's CLI wizard collects interactively).

The console's "+ New fleet" wizard (deploy.ts) only ever calls deploy_provision, never deploy_apply. If that's the full picture, the console currently has no way to create a genuinely new agent from scratch — it can only "redeploy" (bump image/bundle) an agent that already has a stored manifest, created some other way (today: the CLI's oabctl create wizard).

This is not k8s-specific — it's true for AWS today too. It surfaced during k8s work because adding a k8s branch to deploy_provision would just inherit the same limitation, so k8s support was blocked on deciding how to fix this properly rather than papering over it.

Decision (2026-08-27, Brett)

Of three options discussed (see #104's comment thread for the AWS-only "make K8sDriver mirror the missing behavior" and "cram creation into redeploy" alternatives, both rejected):

Go with: wire manifest creation through deploy_apply's existing create-or-update path (apply_manifests), not deploy_provision/redeploy. redeploy stays what its name says — patch-and-reapply an existing manifest. Creation is a distinct operation with its own entry point, matching the semantic boundary that already exists in the code (deploy_apply = give me an exact manifest, create-or-update; deploy_provision = compose-from-template convenience wrapper around redeploy).

Scope

  1. Confirm the trace above is right — rule out a manifest-creation path this investigation missed, before building on the finding.
  2. Manifest construction for a first deploy_provision call: compose_named/Bundle (what provision_from_library uses today) only produces files+image_tag, not a full OABServiceManifest (no networking/resources/secrets/runtime). Need either:
    • the console to collect the missing fields itself (bigger UI lift), or
    • sensible defaults ported from create.rs's wizard (same defaults an interactive CLI run would produce for a bare template), so console keeps asking only what it asks today (name/image/template) and the rest is filled in.
  3. Orchestration: the console-facing call (still one call, to keep the wizard a single step) needs to branch — no stored manifest yet → build one (via the above) and persist+apply through the same path deploy_apply uses (apply_manifests), not a parallel mechanism; manifest already exists → today's redeploy patch-and-reapply, unchanged.
  4. This is the prerequisite for K8s fleet onboarding — console UX for provider selection ('+ New fleet') #104's deploy_provision k8s dispatch — once this lands with a clean AWS-side "create" path through deploy_apply, adding k8s's provider dispatch happens at that same entry point, not redeploy.

Explicit non-goals

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions