Skip to content

fix(config): Inherit tool style from '*' field by field - #990

Open
JeanMertz wants to merge 1 commit into
mainfrom
inherit-tool-style
Open

fix(config): Inherit tool style from '*' field by field#990
JeanMertz wants to merge 1 commit into
mainfrom
inherit-tool-style

Conversation

@JeanMertz

Copy link
Copy Markdown
Collaborator

[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.

`[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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant