picoclaw/pkg/config
I Putu Eddy Irawan 84ded81a8c Address Copilot review feedback for .env loading
- Add migrateChannelConfigs() and ValidateModelList() to the fresh-
  install path (no config.json) so legacy env vars are migrated and
  model list is validated consistently with the normal loading path
- Use os.LookupEnv instead of os.Getenv in loadProviderEnvOverrides
  so explicitly empty env vars (e.g. PICOCLAW_PROVIDERS_X_API_BASE=)
  can clear values from config.json
- Guard .env loading with sync.Once to avoid repeated disk I/O and
  noisy log messages when LoadConfig is called from polling handlers
- Add tests: .env file loading, missing config.json with env vars,
  malformed .env non-fatal behavior, and LookupEnv empty-override

Note: go.mod tcell/v2 and tview are correctly listed as direct deps
(they are imported by the launcher TUI); upstream go.mod was stale.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 22:50:59 +07:00
..
config.go Address Copilot review feedback for .env loading 2026-03-02 22:50:59 +07:00
config_test.go Address Copilot review feedback for .env loading 2026-03-02 22:50:59 +07:00
defaults.go refactor(config): remove WebhookHost and WebhookPort from WeComAIBotConfig 2026-03-02 17:42:54 +08:00
migration.go fix(providers): support per-model request_timeout in model_list (#733) 2026-02-26 19:08:19 +11:00
migration_test.go fix(providers): support per-model request_timeout in model_list (#733) 2026-02-26 19:08:19 +11:00
model_config_test.go refactor(modernize): apply safe modernize fixes 2026-02-27 16:35:07 +08:00