Skip to content

Proper proxy support on windows & mac#6840

Merged
DOsinga merged 4 commits intomainfrom
enabled-proxy
Feb 5, 2026
Merged

Proper proxy support on windows & mac#6840
DOsinga merged 4 commits intomainfrom
enabled-proxy

Conversation

@DOsinga
Copy link
Collaborator

@DOsinga DOsinga commented Jan 30, 2026

Summary

Fixes: #6835

@DOsinga DOsinga requested review from codefromthecrypt and Copilot and removed request for Copilot January 30, 2026 15:53
@DOsinga
Copy link
Collaborator Author

DOsinga commented Jan 30, 2026

goose tells me we need these in the cargo files to make it work. it does work for me on mac this way and before did not.

Copilot AI review requested due to automatic review settings February 2, 2026 18:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the reqwest system-proxy feature across Rust crates to support honoring OS/system proxy settings (intended to address issue #6835: proxy env vars not honored in the Rust backend).

Changes:

  • Enable reqwest’s system-proxy feature in goose, goose-server, and goose-mcp.
  • Update Cargo.lock to include new transitive dependencies required for system proxy support on macOS/Windows.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.

File Description
crates/goose/Cargo.toml Adds reqwest system-proxy feature for the main backend crate.
crates/goose-server/Cargo.toml Adds reqwest system-proxy feature for the server crate.
crates/goose-mcp/Cargo.toml Adds reqwest system-proxy feature for the MCP crate.
Cargo.lock Updates dependency graph for the new reqwest feature.

[build-dependencies]
tokio = { workspace = true }
reqwest = { workspace = true, features = ["json", "rustls-tls-native-roots"], default-features = false }
reqwest = { workspace = true, features = ["json", "rustls-tls-native-roots", "system-proxy"], default-features = false }
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enabling reqwest's "system-proxy" feature here won’t have any effect unless the code opts in when building clients (e.g., via ClientBuilder::use_system_proxy()/system proxy configuration), so this PR as-is likely won’t fix #6835.

Copilot uses AI. Check for mistakes.
serde_yaml = "0.9.34"
utoipa = { version = "4.1", features = ["axum_extras", "chrono"] }
reqwest = { workspace = true, features = ["json", "rustls-tls", "blocking", "multipart"], default-features = false }
reqwest = { workspace = true, features = ["json", "rustls-tls", "blocking", "multipart", "system-proxy"], default-features = false }
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as in goose: adding the "system-proxy" feature alone doesn’t enable proxy usage unless the runtime code opts in when constructing reqwest::Clients, so this change likely doesn’t achieve the PR goal by itself.

Copilot uses AI. Check for mistakes.
indoc = "2.0.5"
xcap = "=0.4.0"
reqwest = { workspace = true, features = ["json", "rustls-tls-native-roots"], default-features = false }
reqwest = { workspace = true, features = ["json", "rustls-tls-native-roots", "system-proxy"], default-features = false }
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as in goose: adding the "system-proxy" feature alone doesn’t enable proxy usage unless the runtime code opts in when constructing reqwest::Clients, so this change likely doesn’t achieve the PR goal by itself.

Copilot uses AI. Check for mistakes.
@jh-block
Copy link
Collaborator

jh-block commented Feb 3, 2026

Copilot seems to be wrong; system proxies are enabled by default so building with the feature should be enough: https://docs.rs/reqwest/latest/reqwest/#proxies

Copy link
Collaborator

@jamadeo jamadeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting to see the other default features that we're not enabling (default-features = false): https://docs.rs/crate/reqwest/0.12.28/features#default / https://docs.rs/reqwest/latest/reqwest/#optional-features

http2 and charset seem like features we should probably also add?

Copilot AI review requested due to automatic review settings February 5, 2026 16:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

reqwest = { workspace = true, features = [
"json",
"rustls-tls-native-roots",
"system-proxy",
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enabling the system-proxy feature alone doesn't fix the proxy issue. The code must also call .use_system_proxy() on each Client::builder() instance. Based on the issue description, at minimum these files need the actual implementation:

  • crates/goose/src/providers/api_client.rs (lines 211 and 233)
  • crates/goose/src/providers/githubcopilot.rs (line 161)
  • crates/goose/src/providers/gcpvertexai.rs (line 166)
  • crates/goose/src/providers/toolshim.rs (line 73)

Copilot uses AI. Check for mistakes.
@DOsinga DOsinga added this pull request to the merge queue Feb 5, 2026
Merged via the queue into main with commit d78c69f Feb 5, 2026
24 checks passed
@DOsinga DOsinga deleted the enabled-proxy branch February 5, 2026 19:08
kuccello pushed a commit to kuccello/goose that referenced this pull request Feb 7, 2026
Co-authored-by: Douwe Osinga <douwe@squareup.com>
@jh-block
Copy link
Collaborator

jh-block commented Feb 9, 2026

Interesting to see the other default features that we're not enabling (default-features = false): https://docs.rs/crate/reqwest/0.12.28/features#default / https://docs.rs/reqwest/latest/reqwest/#optional-features

http2 and charset seem like features we should probably also add?

Because of feature unification across the workspace, I think they do end up enabled, because the crates/goose/Cargo.toml has:

reqwest = { workspace = true, features = ["rustls-tls-native-roots", "json", "cookies", "gzip", "brotli", "deflate", "zstd", "charset", "http2", "stream", "blocking", "multipart"], default-features = false }

@jamadeo
Copy link
Collaborator

jamadeo commented Feb 9, 2026

aha, got it, thanks @jh-block

Tyler-Hardin pushed a commit to Tyler-Hardin/goose that referenced this pull request Feb 11, 2026
Co-authored-by: Douwe Osinga <douwe@squareup.com>
Tyler-Hardin pushed a commit to Tyler-Hardin/goose that referenced this pull request Feb 11, 2026
Co-authored-by: Douwe Osinga <douwe@squareup.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HTTP Proxy Environment Variables Not Honored by Rust Backend

3 participants