Skip to content

test: fix staticcheck SA5011 false-positive failing lint on all PRs#3706

Merged
esengine merged 1 commit into
main-v2from
fix/lint-action-revert-v7
Jun 9, 2026
Merged

test: fix staticcheck SA5011 false-positive failing lint on all PRs#3706
esengine merged 1 commit into
main-v2from
fix/lint-action-revert-v7

Conversation

@esengine

@esengine esengine commented Jun 9, 2026

Copy link
Copy Markdown
Owner

What broke

Since the Dependabot cluster landed (~11:51 today), lint fails on main-v2's PRs and every open PR with staticcheck SA5011 (possible nil pointer dereference):

internal/control/shell_test.go:136/139
internal/provider/anthropic/anthropic_test.go:189/192

Both sites are correctly guarded (if x == nil { t.Fatal(...) } then deref).

Root cause

The release golangci-lint v2.12.2 binary that CI runs flags SA5011 on these guarded derefs — a staticcheck quirk in that prebuilt binary. The finding was masked by the golangci-lint-action cache until #3678 changed go.sum and invalidated it, after which it surfaced on main-v2 and every PR. A locally-built golangci-lint v2.12.2 (whole module, GOOS=linux, fresh GOCACHE + lint cache) does not reproduce it, so this is not a real defect.

The golangci-lint-action v7→v9 bump in #3688 is not the cause — v7 fails identically once the cache is cold.

Fix

Restructure both sites with flow-based guards (else if / switch) that staticcheck always respects. No behaviour change (both were fatal — first failure stops the test) and no unreachable return (which a Fatal-aware analyzer would flag locally). Source/action versions untouched.

Note

Each PR runs ci.yml from its own branch, so open PRs only need a rebase onto this once merged to go green — they don't carry these test files' fix until then. (The two files are unrelated to most PRs' changes.)

@esengine esengine requested a review from SivanCola as a code owner June 9, 2026 12:34
@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label Jun 9, 2026
The release golangci-lint v2.12.2 binary CI runs flags SA5011 (possible nil
pointer dereference) on two `if x == nil { t.Fatal(...) }`-guarded derefs,
even though they are correct (Fatal stops the test). The finding was masked by
the golangci-lint-action cache until #3678 changed go.sum and invalidated it,
then surfaced on main-v2 and every open PR. A locally-built golangci-lint does
not reproduce it, so this is a staticcheck quirk in the pinned binary, not a
real defect.

Restructure both sites with flow-based guards (else-if / switch) the analyzer
always respects — no behaviour change, no unreachable `return` (which a
Fatal-aware analyzer would flag locally).
@esengine esengine force-pushed the fix/lint-action-revert-v7 branch from 6d1ddec to 1cc9289 Compare June 9, 2026 12:42
@github-actions github-actions Bot added agent Core agent loop (internal/agent, internal/control) provider Model providers & selection (internal/provider) labels Jun 9, 2026
@esengine esengine changed the title ci: pin golangci-lint-action back to v7 (fixes lint on all PRs) test: fix staticcheck SA5011 false-positive failing lint on all PRs Jun 9, 2026
@esengine esengine merged commit e904766 into main-v2 Jun 9, 2026
15 checks passed
@esengine esengine deleted the fix/lint-action-revert-v7 branch June 9, 2026 12:47
esengine pushed a commit that referenced this pull request 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 added a commit that referenced this pull request Jun 9, 2026
…#3635) (#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 (#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

* 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 #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>
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#3706)

The release golangci-lint v2.12.2 binary CI runs flags SA5011 (possible nil
pointer dereference) on two `if x == nil { t.Fatal(...) }`-guarded derefs,
even though they are correct (Fatal stops the test). The finding was masked by
the golangci-lint-action cache until esengine#3678 changed go.sum and invalidated it,
then surfaced on main-v2 and every open PR. A locally-built golangci-lint does
not reproduce it, so this is a staticcheck quirk in the pinned binary, not a
real defect.

Restructure both sites with flow-based guards (else-if / switch) the analyzer
always respects — no behaviour change, no unreachable `return` (which a
Fatal-aware analyzer would flag locally).

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

agent Core agent loop (internal/agent, internal/control) provider Model providers & selection (internal/provider) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant