Summary
Support loading config from a remote URL by auto-detecting URL in the existing positional argument:
# local (existing behavior, unchanged)
agent-broker config.toml
# remote (new — auto-detected by http:// or https:// prefix)
agent-broker https://example.com/config.toml
Motivation
Currently the broker only reads config from a local file path (defaults to ./config.toml). In containerized or multi-node deployments, it's common to host a shared config on a central server (e.g. S3, internal HTTP service, Git raw URL). Auto-detecting URLs in the existing positional arg removes the need to pre-download or mount the file manually, while keeping the CLI simple — no extra flags needed.
Proposed Behavior
- If the positional config arg starts with
http:// or https://, fetch the TOML content via HTTP(S) GET before parsing.
- Otherwise, treat the arg as a local file path (existing behavior, unchanged).
- No separate
--remote-config flag — the daemon just takes one config source and it can be either a path or a URL.
- Existing env-var expansion (
${VAR}) should still work on the fetched content.
- Reasonable timeout (e.g. 10s) and clear error message on fetch failure.
Design Rationale
agent-broker is a daemon (starts and stays running), not a client CLI. This is more like dockerd / kubelet — it starts up with a config and runs. A kubectl apply -f-style subcommand structure fits client tools better. Future client-side subcommands (e.g. session management) would be a separate concern (agent-broker-ctl or similar).
Implementation Notes
- Add
reqwest dependency
- In
main.rs, check if the arg starts with http:// / https:// → fetch, otherwise → read_to_string
- Same
expand_env_vars + toml::from_str pipeline either way
- 10s timeout + clear error on fetch failure
- Works with S3 pre-signed URLs, raw GitHub URLs, etc. — anything that returns TOML over HTTP(S)
Acceptance Criteria
Summary
Support loading config from a remote URL by auto-detecting URL in the existing positional argument:
Motivation
Currently the broker only reads config from a local file path (defaults to
./config.toml). In containerized or multi-node deployments, it's common to host a shared config on a central server (e.g. S3, internal HTTP service, Git raw URL). Auto-detecting URLs in the existing positional arg removes the need to pre-download or mount the file manually, while keeping the CLI simple — no extra flags needed.Proposed Behavior
http://orhttps://, fetch the TOML content via HTTP(S) GET before parsing.--remote-configflag — the daemon just takes one config source and it can be either a path or a URL.${VAR}) should still work on the fetched content.Design Rationale
agent-brokeris a daemon (starts and stays running), not a client CLI. This is more likedockerd/kubelet— it starts up with a config and runs. Akubectl apply -f-style subcommand structure fits client tools better. Future client-side subcommands (e.g. session management) would be a separate concern (agent-broker-ctlor similar).Implementation Notes
reqwestdependencymain.rs, check if the arg starts withhttp:///https://→ fetch, otherwise →read_to_stringexpand_env_vars+toml::from_strpipeline either wayAcceptance Criteria
agent-broker https://...fetches and uses remote config via auto-detection