Conversation
The relay reads only RELAY_URL (config.rs); BUZZ_RELAY_URL is the agent-side connection target used by buzz-acp, docs/remote-agents.md, and .env.example. Most relay-facing variables are BUZZ_-prefixed, so an operator setting BUZZ_RELAY_URL for the relay too is a reasonable mistake: relay_url then silently falls back to ws://localhost:3000, the deployment community is provisioned bound to that host, and every real request 404s with no signal beyond the startup log line for relay_url. Warn once at startup when this mismatch is detected, following the existing inert_env_vars pattern: a pure helper takes an injected env lookup, covered by four unit tests over the input space plus two tests that drive the real Config::from_env() path with captured tracing output (one per direction: warns, stays quiet). Also fixes the startup error at main.rs that names BUZZ_RELAY_URL when the value it prints (config.relay_url) actually comes from RELAY_URL, sending an operator debugging a failed boot to the wrong variable. Fixes block#6764 Signed-off-by: Yyunozor <yyunozor@icloud.com>
🔐 Codex Security Review
|
…rl-misnamed-env-warn Signed-off-by: Yyunozor <yyunozor@icloud.com> # Conflicts: # crates/buzz-relay/src/config.rs
This branch has not been deployed
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.
Summary
The relay reads only
RELAY_URL, butBUZZ_RELAY_URLis the name agents use (buzz-acp,docs/remote-agents.md,.env.example). When an operator setsBUZZ_RELAY_URLfor the relay,relay_urlfalls back tows://localhost:3000, the community is bound to that host, and every real request returns 404 (#6764).This adds one startup warning when
BUZZ_RELAY_URLis set andRELAY_URLis not, following theinert_env_varspattern (a pure helper with an injected env lookup). It also fixes the startup error inmain.rs, which namedBUZZ_RELAY_URLwhile printing the value ofRELAY_URL.No alias is added (option 2 in the issue): that changes behaviour and is the maintainers' call.
Related issue
Fixes #6764. Thanks to @morven-ai for the diagnosis. They offered a PR for option 1, so I'm happy to close this one if they prefer to send theirs.
mainis merged in after #7793 and #7933 landed (a test helper was added next to ours; both are kept).Testing
87 passed, 2 ignored (Postgres). Two tests drive the real
Config::from_env()path with captured logs.--test-threads=1is needed for an existing env race in this module, andconfig::testsis in no CI selector today.Manual run of the release binary with
BUZZ_RELAY_URLset andRELAY_URLunset: the warning appears once, then the process stops at key load (no key configured). WithRELAY_URLset: no warning. An end-to-end run on a full local relay is still to do, so this stays a draft until then.