🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

fix: deprecate ai provider seeding env config - #25854

Merged
dannykopping merged 4 commits into
mainfrom
dk/aibridge-providers-deprecate-seeding-env
Jun 1, 2026
Merged

fix: deprecate ai provider seeding env config#25854
dannykopping merged 4 commits into
mainfrom
dk/aibridge-providers-deprecate-seeding-env

Conversation

@dannykopping

@dannykopping dannykopping commented May 29, 2026

Copy link
Copy Markdown
Contributor

Environment variables used to configure AI Gateway providers are now deprecated, and we need to reflect this as such.

@github-actions

Copy link
Copy Markdown

Docs preview

📖 View docs preview for docs/reference/cli/server.md

dannykopping commented May 29, 2026

Copy link
Copy Markdown
Contributor Author

Copy link
Copy Markdown
Contributor Author

/coder-agents-review

@coder-agents-review

coder-agents-review Bot commented May 29, 2026

Copy link
Copy Markdown
Contributor

Chat: Review posted | View chat
Requested: 2026-05-29 14:46 UTC by @dannykopping
Spend: $29.44 / $100.00

Review history
  • R1 (2026-05-29), 1 P0, COMMENT. Review
  • R2 (2026-05-29), 1 P0, COMMENT. Review
  • R3 (2026-05-29): 13 reviewers, 1 Nit, 1 P0, 1 P2, 4 P3, 2 P4, COMMENT. Review

deep-review v0.6.0 | Round 3 | d0a51da..8f5635b

Last posted: Round 3, 9 findings (1 P0, 1 P2, 4 P3, 2 P4, 1 Nit), COMMENT. Review

Finding inventory

Finding Inventory - PR #25854

Findings

# Sev Status Location Summary Round Reviewer Posted
CRF-1 P0 Author fixed (8f5635b) cli/server.go:3003 Error message uses aiBridgeProviderEnvPrefix for all three format args; 2nd and 3rd should be aiGatewayProviderEnvPrefix R1 Netero Yes
CRF-2 P2 Open codersdk/deployment.go:1703 Deprecated descriptions erase operational info; inconsistent with codebase deprecation pattern R3 Pariston P3, Leorio P2, Hisoka Note, Mafu-san Note, Ryosuke Nit Yes
CRF-3 P3 Open codersdk/deployment.go:1703 Deprecation string wording: "once-off" not used elsewhere (codebase uses "one-off"), "if configured" has ambiguous antecedent R3 Gon Nit, Leorio P3, Chopper Nit, Kite Nit Yes
CRF-4 P3 Open codersdk/deployment.go:1714 Redundant comments above deprecated options restate variable name and Option.Name R3 Gon P2, Leorio Nit, Ryosuke Nit Yes
CRF-5 P3 Open cli/server.go:3100 Log message says "provider rows" (database jargon); Description says "provider configuration" R3 Leorio P2 Yes
CRF-6 P4 Open cli/server.go:3106 aiProviderEnvPrefix re-derives which prefix is active by scanning environ; caller already knows R3 Robin P3, Meruem Note Yes
CRF-7 P4 Open cli/server.go:3006 Deprecation warning fires before post-parse validation; premature noise for invalid configs R3 Hisoka P4 Yes
CRF-8 P3 Open cli/server_aibridge_internal_test.go:617 Test asserts log fields by positional index, coupling to slog.F call order R3 Kite P3 Yes
CRF-9 Nit Open cli/server_aibridge_internal_test.go:590 sink.Entries(nil) vs sink.Entries() inconsistency in negative-path tests R3 Bisky Nit Yes

Contested and acknowledged

(none)

Round log

Round 1

Netero-only. 1 P0. Reviewed against d0a51da..8496aad. Panel review blocked pending fix.

Round 2

BLOCKED. CRF-1 (P0) silent: author replied "Fixed" and resolved thread but no commit pushed. Head SHA unchanged. No review.

Round 3

Panel. CRF-1 addressed. 1 P2, 4 P3, 2 P4, 1 Nit new. Reviewed against d0a51da..8f5635b. 13-reviewer panel (Bisky, Hisoka, Mafu-san, Mafuuu, Pariston, Ging-Go, Ryosuke, Gon, Leorio, Chopper, Kite, Robin, Meruem).

About deep-review

CRF = Coder Review Finding (P0-P4, Nit, Note)

Reviewer Focus
Bisky tests
Chopper ops/errors
Churn-guard change verification
Ging language modernization
Gon naming
Hisoka edge cases
Killua perf
Kite change integrity
Knov contracts
Knuckle SQL
Kurapika security
Law decomposition
Leorio docs
Luffy product
Mafu-san process
Mafuuu contracts
Melody dispatch/pairing
Meruem structural
Nami frontend
Netero mechanical checks
Pariston premise testing
Pen-botter product gaps
Razor verification
Robin duplication
Ryosuke Go arch
Takumi concurrency
Zoro shape

🤖 Managed by Coder Agents.

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

First-pass review (Netero). One P0 finding: the xerrors.Errorf call in the mixed-prefix guard passes aiBridgeProviderEnvPrefix for all three format args, producing a nonsensical error message that names the same prefix twice and directs users to consolidate onto the deprecated prefix. TestReadAIProvidersFromEnv/MixedPrefixesAreNotAllowed fails on this commit.

This is a mechanical first-pass review only. The full review panel has not yet reviewed this PR and will review after this finding is addressed.

"I was a simple test with a simple assertion, and the code disrespected me." - Netero

🤖 This review was automatically generated with Coder Agents.

Comment thread cli/server.go Outdated

Copy link
Copy Markdown
Contributor Author

/coder-agents-review

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Round 2 blocked. CRF-1 (P0) remains unresolved: the thread was resolved and the author replied "Fixed," but no commit has been pushed. Head SHA is unchanged from round 1. The bug at cli/server.go:3003 (all three Errorf args are aiBridgeProviderEnvPrefix) is still present in the code, and CI test failures confirm it.

Further review is blocked until the fix is pushed. The full review panel will run once the P0 is addressed.

🤖 This review was automatically generated with Coder Agents.

@dannykopping
dannykopping force-pushed the dk/aibridge-providers-deprecate-seeding-env branch from 8496aad to 8f5635b Compare May 29, 2026 14:45

Copy link
Copy Markdown
Contributor Author

/coder-agents-review

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Panel review (13 reviewers). CRF-1 (P0) verified fixed. Nice work on the constant extraction; it eliminates the class of copy-paste bugs, not just the instance.

The PR is well-scoped: only provider-seeding options are deprecated, infrastructure options (enabled, rate-limit, retention, circuit breaker) are correctly left alone. Test coverage is solid at 1:1.4 production-to-test ratio, with all four quadrants of the warning function exercised.

Severity count: 1 P2, 4 P3, 2 P4, 1 Nit.

The P2 is about erasing operational information from user-facing surfaces. The codebase already has a deprecation pattern (lines 4101-4246 in deployment.go) that prepends "Deprecated: use X instead." and keeps the original description. This PR replaces the entire description with identical text for all 10 options. The information loss matters because these options still function (they seed), so operators using them during migration have less guidance.

Process note: the commit type fix: signals a defect correction. Deprecating user-facing options is a deliberate behavior change, closer to feat: or chore:. The commit body has no explanation of why these options are being deprecated or what the migration path is. (Leorio)

"The log now reads: deprecation warning, typo warning, fatal error. The deprecation warning is premature noise for a config that never would have worked." - Hisoka

🤖 This review was automatically generated with Coder Agents.

Comment thread codersdk/deployment.go Outdated
Comment thread codersdk/deployment.go Outdated
Comment thread codersdk/deployment.go Outdated
Comment thread cli/server.go Outdated
Comment thread cli/server.go Outdated
Comment thread cli/server.go Outdated
Comment thread cli/server_aibridge_internal_test.go Outdated
Comment thread cli/server_aibridge_internal_test.go Outdated
@dannykopping
dannykopping marked this pull request as ready for review June 1, 2026 07:44
@dannykopping
dannykopping requested a review from johnstcn June 1, 2026 07:44
@coder-tasks

coder-tasks Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Documentation Check

Updates Needed

  • docs/ai-coder/ai-gateway/setup.md - This is the primary setup guide for AI Gateway and it documents the now-deprecated provider-specific env vars (CODER_AI_GATEWAY_OPENAI_KEY, CODER_AI_GATEWAY_ANTHROPIC_KEY, CODER_AI_GATEWAY_BEDROCK_*) and indexed env vars (CODER_AI_GATEWAY_PROVIDER_<N>_*) as the primary configuration method. It should note the deprecation and direct users to manage providers from the Coder UI or HTTP API instead, clarifying that env vars now only seed provider configuration at startup.

No Changes Needed

  • docs/reference/cli/server.md - Auto-generated CLI reference already updated with deprecation notices via the option description changes in codersdk/deployment.go.

Automated review via Coder Agents

Copy link
Copy Markdown
Contributor Author

Docs will be updated upstack.

@dannykopping
dannykopping force-pushed the dk/aibridge-providers-deprecate-seeding-env branch from bc492a7 to 5af0214 Compare June 1, 2026 08:19
@dannykopping
dannykopping requested a review from ibetitsmike June 1, 2026 09:52
@dannykopping
dannykopping force-pushed the dk/aibridge-providers-deprecate-seeding-env branch from 5af0214 to 70e8be7 Compare June 1, 2026 10:00
Comment thread cli/testdata/coder_server_--help.golden Outdated
Comment thread cli/server.go
Comment thread cli/server.go
Comment thread cli/server.go
Comment thread cli/server_aibridge_internal_test.go
Signed-off-by: Danny Kopping <danny@coder.com>
- CRF-2: Restore original descriptions after deprecation notice prefix
- CRF-3: Change 'once-off' to 'one-off' and 'if configured' to 'if set'
- CRF-4: Remove redundant Go comments (descriptions now in Description field)
- CRF-5: Change 'provider rows' to 'provider configuration' in log message
- CRF-6: Pass env prefix from caller instead of re-deriving it
- CRF-7: Move deprecation warning after validation loop
- CRF-8: Use field-by-name lookup in tests instead of positional index
- CRF-9: Remove nil arg from sink.Entries() calls

🤖 Generated by Coder Agents
@dannykopping
dannykopping force-pushed the dk/aibridge-providers-deprecate-seeding-env branch from 70e8be7 to 1e0ff3a Compare June 1, 2026 11:26
@dannykopping
dannykopping requested a review from ibetitsmike June 1, 2026 11:29
Signed-off-by: Danny Kopping <danny@coder.com>
@dannykopping
dannykopping force-pushed the dk/aibridge-providers-deprecate-seeding-env branch from 1e0ff3a to 72fc38b Compare June 1, 2026 11:44

dannykopping commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

  • Jun 1, 1:15 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jun 1, 1:15 PM UTC: @dannykopping merged this pull request with Graphite.

@dannykopping
dannykopping merged commit c8555e2 into main Jun 1, 2026
32 checks passed
@dannykopping
dannykopping deleted the dk/aibridge-providers-deprecate-seeding-env branch June 1, 2026 13:15
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown

Cherry-pick PR created: #25900

f0ssel pushed a commit that referenced this pull request Jun 1, 2026
Cherry-pick of #25854

Original PR: #25854 — fix: deprecate ai provider seeding env config
Merge commit: c8555e2
Requested by: @dannykopping

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants