Skip to content

fix(cli): prevent welcome() from re-triggering setup when a global config exists#2906

Merged
esengine merged 1 commit into
main-v2from
fix-welcome-global-config
Jun 3, 2026
Merged

fix(cli): prevent welcome() from re-triggering setup when a global config exists#2906
esengine merged 1 commit into
main-v2from
fix-welcome-global-config

Conversation

@esengine
Copy link
Copy Markdown
Owner

@esengine esengine commented Jun 3, 2026

reasonix with no args, run from a directory without a local reasonix.toml, re-ran the setup wizard even though a valid user-global config (~/.config/reasonix/config.toml) loads fine — because the trigger keyed on config.SourcePath() == "" (no cwd-local file) rather than on whether any config loads.

Load early and gate the wizard on cfgErr != nil, so it only runs when no config resolves from any source; drop the now-redundant src != "" guard on the chat-entry path.

Supersedes #2859 by @Bernardxu123 (authorship preserved), reapplied onto current main-v2 to resolve the conflict with the evolved interactiveSetup signature.

Validation

  • go build ./..., go vet ./internal/cli, go test ./internal/cli ./internal/config — pass.

Closes #2856

welcome() triggered the setup wizard whenever the cwd lacked a reasonix.toml
(SourcePath==""), even though config.Load() succeeds from the user-global
config. Load early and gate the wizard on cfgErr != nil so it only runs when no
config resolves from any source; drop the redundant src != "" guard on the
chat-entry path for the same reason.
@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label Jun 3, 2026
@esengine esengine merged commit da01d3c into main-v2 Jun 3, 2026
6 checks passed
@esengine esengine deleted the fix-welcome-global-config branch June 3, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]:reasonix 无参数运行会在某些情况下重新触发设置向导

2 participants