Skip to content

Pluggable ConfigSource: FileSource (default) + RemoteSource + --config-source #163

Description

@rshade

Context

The control plane stores per-tenant fleet config and serves it over an API. The
OSS CLI must be able to pull its config from a remote control plane (e.g.
api.agentic-fleet.ai) or read a local file — without the engine depending on
the control plane. This is the key binding point (open client, swappable
control plane).

Problem

Config loading is currently hard-wired to local file probing in
internal/fleet/load.go (LoadConfig/probeConfigPath). There is no seam to
load config from anywhere else, and no way for a hosted control plane to be the
source of truth.

Proposed approach

Introduce a pluggable source in the public pkg/ (depends on the pkg/fleet
extraction):

ConfigSource interface { Load(ctx) (*Config, error) }
  ├─ FileSource    // wraps today's local probe/load — the DEFAULT
  └─ RemoteSource  // GET <url> (+ bearer token) → fleet.SchemaVersion JSON
  • FileSource is the default; the CLI stays fully standalone with no
    network, token, or SaaS required.
  • RemoteSource: HTTP GET a configurable URL returning the fleet-config
    JSON contract; bearer token from env/config; optional ?version=N for
    reproducible pins; local cache with offline fallback (keep working when
    the control plane is unreachable — offline-tolerant cached-config behavior).
  • CLI wiring: --config-source <url> flag + env var + config stanza.
    Default remains local file. Do not hardcode any domain — vendor-neutral;
    any conformant URL (incl. self-hosted) works.

Affected files

  • internal/fleet/load.go (refactor loading behind the interface)
  • cmd/root.go (persistent flag), relevant subcommands
  • New pkg/…/configsource.go

Acceptance criteria

  • ConfigSource interface + FileSource (default) + RemoteSource in
    pkg/.
  • gh-aw-fleet list --config-source https://… loads config from a remote
    endpoint using a bearer token from env/config.
  • No domain hardcoded anywhere; default behavior (local file) unchanged when
    no source is specified.
  • RemoteSource caches the last good response and falls back to it offline.
  • ?version=N honored for reproducible pulls.
  • godoc on exported identifiers; make ci green.

Dependencies

  • Depends on the public pkg/fleet extraction (foundational issue).
  • Implements the client side of the wire contract (separate contract issue).

References

  • agentic-fleet/control-plane/docs/architecture.md — "The binding point".

Metadata

Metadata

Assignees

No one assigned

    Labels

    cross-repoRequires changes in multiple reposeffort/largeLarge effort - multi-dayenhancementNew feature or requestroadmap/futureFuture milestones - Future Vision

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions