fix(wrap): set ANTHROPIC_HOST so wrap goose actually proxies Anthropic - #2619
Open
filipkujawa wants to merge 1 commit into
Open
fix(wrap): set ANTHROPIC_HOST so wrap goose actually proxies Anthropic#2619filipkujawa wants to merge 1 commit into
wrap goose actually proxies Anthropic#2619filipkujawa wants to merge 1 commit into
Conversation
Goose's Anthropic provider reads ANTHROPIC_HOST, not ANTHROPIC_BASE_URL, so `headroom wrap goose` started the proxy, printed the banner, and then sent every request straight to api.anthropic.com. The bypass was silent: no error, no warning, and zero compression.
filipkujawa
requested review from
DevanshiVyas,
JerrettDavis and
chopratejas
as code owners
July 27, 2026 19:24
Contributor
PR governanceThis PR follows the template and is marked ready for human review. |
JerrettDavis
approved these changes
Jul 27, 2026
JerrettDavis
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed the latest commit 6e85f45. The fix correctly adds ANTHROPIC_HOST using the Anthropic proxy base (without the OpenAI /v1 suffix) while preserving the existing OpenAI envs, and the test now locks that behavior. I ran the focused Goose wrapper tests on the PR worktree: tests/test_cli/test_wrap_goose.py passed (2 passed).
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.
Description
headroom wrap goosenever proxied Anthropic traffic. Goose's Anthropic provider readsANTHROPIC_HOST, notANTHROPIC_BASE_URL, so the wrapper started the proxy, printed the banner, and then sent every request straight toapi.anthropic.com— silently, with no error and zero compression.ANTHROPIC_BASE_URLappears in no.rsfile in the goose repo. The provider readsANTHROPIC_HOSTatcrates/goose/src/providers/anthropic_def.rs#L38-L40and appends/v1/messagesitself, so_claude_proxy_base_url(port)is already the correct value.Note the README currently advertises
headroom wrap goose -- --provider anthropicas an example — that is the exact invocation that bypasses the proxy. The OpenAI path was unaffected: goose does honourOPENAI_BASE_URL.Type of Change
Changes Made
ANTHROPIC_HOSTalongside the existing vars inwrap goose(headroom/cli/wrap.py), and show it in the launch banner.test_wrap_goose_sets_provider_envsto assert the value. This test fails before the change with aKeyError.Testing
pytest)ruff check .)mypy headroom)Test Output
Real Behavior Proof
goose run --no-session -t "Reply with exactly: PONG"three times against the stub listener — (A) with the env varswrap goosesets today and ANTHROPIC_HOST explicitly unset, (B) identical but with ANTHROPIC_HOST added, (C) OpenAI provider with unchanged env. Full commands and output in the Test Output block above.anthropic_basevalue.Review Readiness
Checklist
CHANGELOG.mdAdditional Notes
_launch_toolrewrites the child environment (including the new var) but notenv_vars_display, so the printed value can show the requested port. Pre-existing for the other displayed URLs; not addressed here.wrap aidersetsOPENAI_API_BASEbut notOPENAI_BASE_URL; andwrap goosedoes not callwith_project_prefix(), so goose traffic isn't attributed per project.