fix(config): Inherit tool style from '*' field by field - #990
Open
JeanMertz wants to merge 1 commit into
Open
Conversation
`[conversation.tools.'*'.style]` was silently ignored by any tool that
set a style field of its own. `ToolConfig::style` is an
`Option<DisplayStyleConfig>`, so the moment a tool declares one key the
option is `Some` and every other field reads as deliberately set. Every
neighbouring accessor fills from the defaults per field; only `style`
fell back as a unit.
The practical effect was that a one-line default did nothing:
[conversation.tools.'*'.style]
hidden = true
Every tool that already set `style.inline_results` took its own style
wholesale and dropped the default, with no error and no warning. Hiding
read-only tool calls across a persona meant naming each tool by hand.
`PartialToolsConfig::fill_from` now fills each tool's style from the
resolved `*` block. Doing that at partial-merge time rather than in
`ToolConfigWithDefaults::style` is what makes it possible: the partial
still records which keys the tool asked for, so the gaps are
identifiable. Once the config is resolved that information is gone.
Signed-off-by: Jean Mertz <git@jeanmertz.com>
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.
[conversation.tools.'*'.style]was silently ignored by any tool that set a style field of its own.ToolConfig::styleis anOption<DisplayStyleConfig>, so the moment a tool declares one key the option isSomeand every other field reads as deliberately set. Every neighbouring accessor fills from the defaults per field; onlystylefell back as a unit.The practical effect was that a one-line default did nothing:
Every tool that already set
style.inline_resultstook its own style wholesale and dropped the default, with no error and no warning. Hiding read-only tool calls across a persona meant naming each tool by hand.PartialToolsConfig::fill_fromnow fills each tool's style from the resolved*block. Doing that at partial-merge time rather than inToolConfigWithDefaults::styleis what makes it possible: the partial still records which keys the tool asked for, so the gaps are identifiable. Once the config is resolved that information is gone.