Skip to content

fix(desktop): save provider/config to global user config, surviving workspace switch#2516

Merged
esengine merged 1 commit into
main-v2from
fix/desktop-global-provider-config
Jun 1, 2026
Merged

fix(desktop): save provider/config to global user config, surviving workspace switch#2516
esengine merged 1 commit into
main-v2from
fix/desktop-global-provider-config

Conversation

@esengine
Copy link
Copy Markdown
Owner

@esengine esengine commented Jun 1, 2026

Problem

Providers configured in the desktop app disappear after switching the working folder.

Root cause: desktop settings flow through applyConfigChangeconfig.Load()cfg.Save(), and Save() writes to SourcePath() — the cwd's reasonix.toml if present, otherwise it creates a project-level reasonix.toml. So providers were written per-project. PickWorkspace then does os.Chdir(newDir) + config.Load(), and the new directory has no such reasonix.toml, so the providers are gone.

Fix

Providers, API keys, and language are account-level, not per-project. applyConfigChange now loads and saves the user-global config (~/.config/reasonix/config.toml) directly via LoadForEdit + SaveTo, instead of the cwd-dependent Save(). Added config.UserConfigPath() for this.

config.Save()'s project-level semantics are left intact for the CLI (reasonix setup).

Note

Providers already written into a project reasonix.toml won't auto-migrate — re-saving them once in the desktop app now writes them to the global config.

Verification

go build + go vet pass for both the main module (internal/config) and the desktop module (settings_app typechecks against the new UserConfigPath).

…orkspace switch

Desktop settings went through applyConfigChange -> cfg.Save(), and Save() targets SourcePath(): the cwd reasonix.toml when present, otherwise it creates a project-level one. So providers configured in the desktop app were written per-project and vanished after switching the working folder. Providers/keys/language are account-level: load and save the user-global config (~/.config/reasonix/config.toml) directly via LoadForEdit + SaveTo, exposing config.UserConfigPath(). The CLI-facing project semantics of config.Save() are unchanged.
@esengine esengine merged commit 4cb0690 into main-v2 Jun 1, 2026
@esengine esengine deleted the fix/desktop-global-provider-config branch June 1, 2026 03:59
@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label Jun 1, 2026
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.

1 participant