fix: resolve provider env vars not being applied (#66)#270
Open
boengai wants to merge 2 commits intosipeed:mainfrom
Open
fix: resolve provider env vars not being applied (#66)#270boengai wants to merge 2 commits intosipeed:mainfrom
boengai wants to merge 2 commits intosipeed:mainfrom
Conversation
Replace unsupported {{.Name}} template syntax in ProviderConfig env tags
with envPrefix on each provider field in ProvidersConfig, so that
environment variables like PICOCLAW_PROVIDERS_ANTHROPIC_API_KEY are
correctly parsed by caarlos0/env.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Great fix for those env-var tags! This correction is essential for anyone running without a static config. In PR #239, I've implemented a related dynamic provider discovery system using reflection that relies on these exact fields. Your fix will help ensure those providers are detected correctly. Looking forward to getting these consistent! |
Keep both TestProviderConfig_EnvVars (from sipeed#66) and TestSaveConfig_FilePermissions (from sipeed#186). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
|
@Zepan Fixes provider environment variables not being applied when config.json exists — this means Recommendation: Merge. +46/-18, fixes a configuration precedence issue that affects Docker/container deployments where env vars are the standard config mechanism. |
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
PICOCLAW_PROVIDERS_*env vars (e.g.PICOCLAW_PROVIDERS_ANTHROPIC_API_KEY) were not being read becausecaarlos0/envdoes not support{{.Name}}template syntax in env tagsenvPrefixon each provider field inProvidersConfig, which correctly prepends the provider name to each env keyTest plan
go fmt— no formatting changes neededgo vet ./...— no issuesgo test ./...— all packages passTestProviderConfig_EnvVarstest confirms env vars likePICOCLAW_PROVIDERS_ANTHROPIC_API_KEYare correctly read🤖 Generated with Claude Code