feat: add global HTTP/HTTPS proxy for agent child processes#519
Open
0xtresser wants to merge 1 commit into
Open
feat: add global HTTP/HTTPS proxy for agent child processes#5190xtresser wants to merge 1 commit into
0xtresser wants to merge 1 commit into
Conversation
Adds a per-host Network → Agent proxy setting. The daemon injects HTTPS_PROXY / HTTP_PROXY / ALL_PROXY / NO_PROXY (and lower-case variants) into every spawned agent process (Claude, Codex, OpenCode, ACP) so users behind a proxy can reach provider APIs without editing config.json for each provider. - MutableDaemonConfigSchema gains optional network.proxy — backward- compatible with older clients (all new fields optional, passthrough). - applyProviderEnv merges a process-wide globalAgentEnv layer between baseEnv and per-provider env. Precedence remains: process.env < global proxy < per-provider env override. - bootstrap seeds globalAgentEnv from persisted config and re-applies on network.proxy changes — no daemon restart needed (new agents pick up immediately; running agents inherit env at spawn time). - UI: new Network section on the Host settings page with a ProxyCard (on/off toggle + HTTPS / HTTP / NoProxy fields + Save). Only renders when the daemon is connected. Closes getpaseo#253 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
7ec394c to
5c90449
Compare
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
Adds a per-host Network → Agent proxy setting. The daemon injects
HTTPS_PROXY/HTTP_PROXY/ALL_PROXY/NO_PROXY(and lower-case variants) into every spawned agent process (Claude, Codex, OpenCode, ACP), so users behind a proxy can reach provider APIs without editingconfig.jsonfor each provider.Closes #253
Motivation
Agents like Claude Code / Codex call provider APIs over HTTPS. Users in regions where those APIs are hard to reach directly (e.g. mainland China) need a proxy. Today the only way to set one is manually editing
agents.providers.<id>.envinconfig.jsonper provider — no UI, easy to forget, easy to get wrong. #253 asks for proper proxy support. This PR adds it as a first-class setting.How it works
MutableDaemonConfigSchemagains an optionalnetwork.proxyfield (enabled,httpUrl?,httpsUrl?,noProxy?).applyProviderEnvnow merges a process-wideglobalAgentEnvlayer betweenbaseEnvandruntimeSettings.env. Precedence stays:process.env< global proxy config < per-provider env override, so users who already set per-provider env keep winning.bootstrapseedsglobalAgentEnvfrom the persisted config on startup and re-applies onnetwork.proxychanges viadaemonConfigStore.onFieldChange. No daemon restart needed — new agents pick up the change immediately. (Already-running agents keep the env they were spawned with — this is an intentional no-surprise choice.)Backward compatibility
All new schema fields are `.optional()` with `.passthrough()`, following the project's "does a 6-month-old client still parse this?" rule:
Scope — what this PR does not do
Testing
Test plan
🤖 Generated with Claude Code