Skip to content

fix(config): treat GOCLAW_PROVIDER/MODEL env vars as fallback, not override#119

Merged
viettranx merged 1 commit intonextlevelbuilder:mainfrom
Luvu182:fix/env-provider-fallback
Mar 10, 2026
Merged

fix(config): treat GOCLAW_PROVIDER/MODEL env vars as fallback, not override#119
viettranx merged 1 commit intonextlevelbuilder:mainfrom
Luvu182:fix/env-provider-fallback

Conversation

@Luvu182
Copy link
Contributor

@Luvu182 Luvu182 commented Mar 10, 2026

Summary

  • The onboard wizard sets GOCLAW_PROVIDER and GOCLAW_MODEL in .env for initial bootstrap
  • Previously these env vars always overrode the config-file value via envStr(), making it impossible to change the default provider/model through the Dashboard — every save was silently reverted by ApplyEnvOverrides()
  • Change envStrenvFallback for these two fields: the env var is only applied when the config file has no value (empty string). Once the user saves a provider/model via the Dashboard, the config-file value wins
  • Stabilize ProviderModelSelect auto-select effect with useRef + useMemo to prevent unnecessary re-fires
  • Add toast feedback on config save success/failure

Test plan

  • Set GOCLAW_PROVIDER=foo and GOCLAW_MODEL=bar in .env
  • Start gateway with no provider/model in config.json → verify defaults to foo/bar from env
  • Save a different provider/model via Dashboard → verify config.json updated
  • Restart gateway → verify Dashboard shows the saved value, not the env value
  • Verify toast appears on save success and on save failure

🤖 Generated with Claude Code

…erride

The onboard wizard sets GOCLAW_PROVIDER and GOCLAW_MODEL in .env for
initial bootstrap. Previously these env vars always overrode the config
file value via envStr(), making it impossible to change the default
provider/model through the Dashboard — every save was silently reverted
by ApplyEnvOverrides().

Change envStr to envFallback for these two fields: the env var is only
applied when the config file has no value (empty string). Once the user
saves a provider/model via the Dashboard, the config-file value wins.

Also:
- Stabilize ProviderModelSelect auto-select effect (useRef + useMemo)
- Add toast feedback on config save success/failure
@Luvu182 Luvu182 force-pushed the fix/env-provider-fallback branch from 15d5797 to 3224da9 Compare March 10, 2026 11:25
@viettranx viettranx merged commit 456e594 into nextlevelbuilder:main Mar 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants