feat: support loading config from remote URL#87
Open
neilkuan wants to merge 3 commits intoopenabdev:mainfrom
Open
feat: support loading config from remote URL#87neilkuan wants to merge 3 commits intoopenabdev:mainfrom
neilkuan wants to merge 3 commits intoopenabdev:mainfrom
Conversation
Auto-detect URL in the positional config argument — if it starts with http:// or https://, fetch the TOML via HTTP GET (10s timeout) instead of reading a local file. Env-var expansion and parsing pipeline remain the same for both paths. Closes openabdev#80
Cover parse_config, expand_env_vars, load_config (file & missing file), load_config_from_url (unreachable host), and env-var substitution in TOML content.
thepagent
previously approved these changes
Apr 6, 2026
Collaborator
thepagent
left a comment
There was a problem hiding this comment.
LGTM! 🙌 Clean and minimal implementation.
What I like:
- Auto-detect URL approach (no new flag needed) — exactly the kubectl-like UX we discussed in #80
parse_config(raw, source)extraction is a nice refactor, avoids duplication between local and remote pathsreqwestwithrustls-tls— consistent with serenity's TLS backend- 10s timeout + separate error messages for network failure / non-2xx / invalid TOML ✅
- Env-var expansion works on remote content — verified in tests
main.rschange is only 8 lines — surgical
One minor nit (non-blocking):
std::env::set_var/remove_varin tests can race in multi-threaded test runs. Not a real issue at this scale, but if you ever want to harden it,temp_envcrate orserial_testcan help. Totally fine to leave as-is for now.
Ship it! 🚀
4 tasks
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #80
What
Auto-detect URL in the existing positional config argument. If it starts with
http://orhttps://, fetch the TOML content via HTTP GET; otherwise treat it as a local file path (existing behavior unchanged).Implementation
reqwestdependency withrustls-tlsbackend (consistent with serenity's rustls)parse_config(raw, source)fromload_configto avoid duplicationload_config_from_url(url)async function with 10s timeout and clear error messages for network failure / non-2xx / invalid TOMLmain.rschecks if the first positional arg starts withhttp://orhttps://to decide the code path${VAR}) works identically on both local and remote config contentTest plan
cargo buildpassesagent-broker https://raw.githubusercontent.com/.../config.tomlfetches and parses correctly