fix(model): persist /model selection to user config.toml#3671
Merged
Conversation
… paragraph in SetDefaultModel gofmt on Linux/macOS CI legs reorders the doc comment when a list is followed directly by another paragraph without a separating '//' line, causing PR esengine#3671 to fail gofmt -l even though the original test suite still passes. Add the canonical godoc separator so the file is gofmt-clean on every runner.
esengine
approved these changes
Jun 9, 2026
esengine
left a comment
Owner
There was a problem hiding this comment.
Verified end-to-end. On base the /model path writes nothing to config, so the choice was lost on the next launch. With the fix, persistModel writes default_model and a fresh config.Load() (next-launch simulation) resolves the default to the persisted provider/model ref. SetDefaultModel broadening to the provider/model form is covered by the config tests, including empty and unknown-model cases. Thanks.
SuMuxi66
pushed a commit
to SuMuxi66/DeepSeek-Reasonix
that referenced
this pull request
Jun 10, 2026
C:/Program Files/Git/model now writes the chosen provider/model to default_model in the user config so the next session starts on it instead of the global default. SetDefaultModel accepts the provider/model form (validated via ResolveModel).
dorokuma
pushed a commit
to dorokuma/DeepSeek-Reasonix
that referenced
this pull request
Jun 10, 2026
C:/Program Files/Git/model now writes the chosen provider/model to default_model in the user config so the next session starts on it instead of the global default. SetDefaultModel accepts the provider/model form (validated via ResolveModel).
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.
🤖 Generated by AI (CnsMaple + Reasonix)
Problem
/modelpicked a runtime model but the choice was lost on the nextreasonix chat— there was no plumbing from the slash command back to~/.config/reasonix/config.toml, so users had to re-/modeleverysession.
Fix
The
/modelslash command now writes the chosen provider into the userconfig via
config.LoadForEdit(...).SaveTo(...)(the same edit primitiveused by the
/themePR, #3043). Persist failures stay onslog(operatorvisibility) while user-visible status — including the "kept previous
model on save failure" path — goes through the TUI notice channel so the
chat line shows it, not the operator log.
Changes
internal/cli/model.go(+33/-2):/modelsubcommand persists to userconfig and routes feedback through the TUI notice.
internal/cli/model_test.go(+43): coverage for the persistence path.internal/config/edit.go(+17/-5): edit helper now exposes the fieldneeded by
/model.internal/config/edit_test.go(+15): edit-helper regression tests.Tests
go test ./internal/cli/ -count=1 -run 'TestModel'go test ./internal/config/ -count=1 -run 'TestPersistModel|TestLoadForEdit|TestEdit'→ all pass.
esengine:main-v2 @ 90c24655.Mirrors
/theme).