Skip to content

fix(config): honor an explicit proxy for no_proxy providers like mimo (#3635)#3714

Merged
esengine merged 2 commits into
main-v2from
fix/3635-mimo-proxy
Jun 9, 2026
Merged

fix(config): honor an explicit proxy for no_proxy providers like mimo (#3635)#3714
esengine merged 2 commits into
main-v2from
fix/3635-mimo-proxy

Conversation

@esengine

@esengine esengine commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Bug (#3635)

On an enterprise network where all egress must go through a corporate proxy, the mimo models are unreachable. Root cause (config.go:directProxyHosts): the built-in mimo presets set no_proxy=true, whose host (token-plan-cn.xiaomimimo.com) is added to the proxy's DirectHosts and always bypasses the proxy — so behind a mandatory proxy, mimo attempts a direct connection the firewall blocks.

no_proxy=true is right for an auto-detected system proxy (typically a GFW-circumvention proxy not meant for domestic endpoints), but wrong for an explicitly configured one.

Fix

Apply the provider-level no_proxy bypass only for auto/env proxy modes. When proxy_mode = "custom" the user is saying "route everything through this proxy", so honor it for every provider (including mimo). A custom-proxy user who still wants a specific host direct uses network.no_proxy (which is honored for custom proxies).

Test plan

  • internal/config: existing TestDirectProxyHostsFromNoProxyProviders still passes (auto mode keeps mimo direct); new TestExplicitProxyOverridesProviderNoProxy asserts custom mode does NOT force mimo direct.
  • go test ./internal/config green; vet + golangci-lint (0 issues) + gofmt clean.

Closes #3635

The built-in mimo presets carry no_proxy=true so their domestic endpoint
stays off an auto-detected (GFW-circumvention) system proxy. But that bypass
was applied in every mode, so behind a mandatory corporate proxy
(proxy_mode = "custom") mimo tried a direct connection the firewall blocks —
making mimo unusable on enterprise networks (#3635).

Apply the provider-level no_proxy bypass only for auto/env proxies. An explicit
custom proxy means "route everything through this", so honor it for every
provider; a custom-proxy user who still wants a host direct uses
network.no_proxy.

Closes #3635
@esengine esengine requested a review from SivanCola as a code owner June 9, 2026 13:41
@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development config Configuration & setup (internal/config) and removed v2 Go rewrite (1.x) — main-v2 branch, active development labels Jun 9, 2026
The release golangci-lint binary CI runs flags SA5011 on guarded t.Fatal
derefs in backfill_test.go and migrate_test.go (same cache-masked false
positive as #3706); this PR touches the config package so a cold lint run
surfaces them. Guard with else-if; no behavior change.
@esengine esengine merged commit 4684e93 into main-v2 Jun 9, 2026
13 checks passed
@esengine esengine deleted the fix/3635-mimo-proxy branch June 9, 2026 13:51
esengine added a commit that referenced this pull request Jun 9, 2026
The pinned golangci-lint binary's staticcheck reports SA5011 (possible nil
pointer dereference) on `if x == nil { t.Fatal(...) }`-guarded derefs in tests
— it doesn't model t.Fatal as terminating. The same code is clean under a
locally-built golangci-lint, and the finding is masked by the action cache
until a go.sum change cold-busts it, so it surfaces per-package and has failed
lint on otherwise-correct PRs (handled ad hoc in #3706, #3714).

Scope a test-only SA5011 exclusion so it stops blocking PRs while SA5011 keeps
guarding production code.

Co-authored-by: reasonix <reasonix@deepseek.com>
SuMuxi66 pushed a commit to SuMuxi66/DeepSeek-Reasonix that referenced this pull request Jun 10, 2026
…esengine#3635) (esengine#3714)

* fix(config): honor an explicit proxy for no_proxy providers (mimo)

The built-in mimo presets carry no_proxy=true so their domestic endpoint
stays off an auto-detected (GFW-circumvention) system proxy. But that bypass
was applied in every mode, so behind a mandatory corporate proxy
(proxy_mode = "custom") mimo tried a direct connection the firewall blocks —
making mimo unusable on enterprise networks (esengine#3635).

Apply the provider-level no_proxy bypass only for auto/env proxies. An explicit
custom proxy means "route everything through this", so honor it for every
provider; a custom-proxy user who still wants a host direct uses
network.no_proxy.

Closes esengine#3635

* test(config): structurally guard nil-deref (staticcheck SA5011)

The release golangci-lint binary CI runs flags SA5011 on guarded t.Fatal
derefs in backfill_test.go and migrate_test.go (same cache-masked false
positive as esengine#3706); this PR touches the config package so a cold lint run
surfaces them. Guard with else-if; no behavior change.

---------

Co-authored-by: reasonix <reasonix@deepseek.com>
SuMuxi66 pushed a commit to SuMuxi66/DeepSeek-Reasonix that referenced this pull request Jun 10, 2026
…ne#3715)

The pinned golangci-lint binary's staticcheck reports SA5011 (possible nil
pointer dereference) on `if x == nil { t.Fatal(...) }`-guarded derefs in tests
— it doesn't model t.Fatal as terminating. The same code is clean under a
locally-built golangci-lint, and the finding is masked by the action cache
until a go.sum change cold-busts it, so it surfaces per-package and has failed
lint on otherwise-correct PRs (handled ad hoc in esengine#3706, esengine#3714).

Scope a test-only SA5011 exclusion so it stops blocking PRs while SA5011 keeps
guarding production code.

Co-authored-by: reasonix <reasonix@deepseek.com>
dorokuma pushed a commit to dorokuma/DeepSeek-Reasonix that referenced this pull request Jun 10, 2026
…esengine#3635) (esengine#3714)

* fix(config): honor an explicit proxy for no_proxy providers (mimo)

The built-in mimo presets carry no_proxy=true so their domestic endpoint
stays off an auto-detected (GFW-circumvention) system proxy. But that bypass
was applied in every mode, so behind a mandatory corporate proxy
(proxy_mode = "custom") mimo tried a direct connection the firewall blocks —
making mimo unusable on enterprise networks (esengine#3635).

Apply the provider-level no_proxy bypass only for auto/env proxies. An explicit
custom proxy means "route everything through this", so honor it for every
provider; a custom-proxy user who still wants a host direct uses
network.no_proxy.

Closes esengine#3635

* test(config): structurally guard nil-deref (staticcheck SA5011)

The release golangci-lint binary CI runs flags SA5011 on guarded t.Fatal
derefs in backfill_test.go and migrate_test.go (same cache-masked false
positive as esengine#3706); this PR touches the config package so a cold lint run
surfaces them. Guard with else-if; no behavior change.

---------

Co-authored-by: reasonix <reasonix@deepseek.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Configuration & setup (internal/config)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: 企业内网网络代理环境下xiaomi-mimo系列模型无法使用

1 participant