Repository navigation
Conversation
tobocop2
force-pushed
the
feat/reset-unsets
branch
2 times, most recently
from
September 27, 2026 08:29
484dc96 to
a3f8ee7
Compare
tobocop2
force-pushed
the
feat/reset-unsets
branch
from
September 27, 2026 11:03
a3f8ee7 to
701129c
Compare
tobocop2
marked this pull request as ready for review
September 27, 2026 22:30
Reset deleted the key only for nullable settings whose default is None
and otherwise wrote the built-in value back to config.toml. A written
value counts as the user's, so it hid any profile value and outlived
the reset.
Reset now removes each key from config.toml and sets cfg from the
resolver, so the env variable, the profile or the built-in value takes
over. It validates the values the keys will resolve to before it
writes, so a reset cannot leave chunk_overlap at or above chunk_size.
A reset of a key that is not in the file writes nothing.
POST /api/config/reset takes {"keys": [...]} and answers in the
shape PATCH /api/config uses. It refuses the
keys PATCH refuses: a provider switch and the model role slots.
GET /api/config/defaults still answers the built-in values.
The TUI reset button, ctrl+r, reset-all and the list editor's restore
button all call the same reset and then show the resolved value. A
refreshed checkbox no longer emits its change event, which wrote the
reset value straight back as a user value.
A reset with the same key twice deleted it twice and raised KeyError, so the HTTP route answered 500 and the MCP tool raised. The config writer now removes each key once. A reset whose fallback is a profile value the field rejects removed the user value and left cfg on it. The reset now checks each fallback against its field first and refuses with an error that names the key, the source and the value; nothing is written. The MCP settings default is now what a reset falls back to without an env variable: the profile value, else the built-in. POST /api/config/reset answers 200 like PATCH, and the documents_dir refusal no longer tells HTTP and TUI users to call an MCP tool. New tests cover reset then blur for Select, multiline and list editors, validation against a profile value, and the list restore title and error.
tobocop2
force-pushed
the
feat/reset-unsets
branch
from
September 27, 2026 23:51
701129c to
bb121c9
Compare
tobocop2
marked this pull request as draft
September 27, 2026 23:51
A reset settles through the same step as an update, and that step reports a setting left in conflict, such as OCR off with a vision model set. The reset route answered an empty warnings list, the MCP reset result had no warnings key, and the TUI reset showed no toast. Each surface now carries the reset's warnings the way it carries an update's: the route and the MCP tool return them in warnings, and the TUI toasts each one.
Owner
Author
|
This change is now part of #1003, which collects every Profiles pull request on one branch. Review and merge happen there. The branch stays in place. |
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.
Problem
Resetting a setting wrote its default back into
config.toml. The reset value then counted as a user value: it hid any later change to the default or a profile, and the setting would show as "set by you". Resetting a checkbox in the TUI also wrote the old value straight back.Solution
A reset now deletes the key from
config.toml, and the setting takes whatever it falls back to: the environment variable, else the profile's value, else the built-in. The TUI reset keys, reset-all, the list restore button and the MCPlilbee_settings_resettool all use it. After a reset, leaving the field writes nothing.POST /api/config/resettakes{"keys": [...]}and answers like a PATCH, with a 200 and the same shape. Unknown keys,documents_dir, model roles, and a key whose fallback value fails validation are refused with a 400. The MCP settings tools reportdefaultas the value a reset falls back to.Notes
GET /api/config/defaultsis unchanged and still returns the built-in values. The Obsidian plugin moves to the reset route in its own change.This stacks on #941.