Skip to content

feat(config): Add dedup option to MergedVec#537

Merged
JeanMertz merged 2 commits intomainfrom
prr104
Apr 11, 2026
Merged

feat(config): Add dedup option to MergedVec#537
JeanMertz merged 2 commits intomainfrom
prr104

Conversation

@JeanMertz
Copy link
Copy Markdown
Collaborator

A new dedup field on MergedVec<T> removes duplicate items after merging, using order-preserving dedup.

The flag accepts true, false, or "inherit". Omitting the field (or using "inherit") means "no opinion" — the flag propagates from the previous merge in the chain. Once any config in the chain enables it, all subsequent merges deduplicate unless a later config explicitly sets it to false.

conversation.attachments now defaults to dedup = true, preventing the same attachment from appearing more than once when multiple config layers are merged. To opt out:

[conversation.attachments]
dedup = false

Several related fixes are also included: FillDefaults now propagates correctly for system_prompt_sections, instructions, attachments, and PartialReasoningConfig; is_empty() on MergeableVec and MergeableMap now accounts for metadata so a Merged with no items but active flags is no longer treated as empty; and vec_dedup is now order-preserving instead of sorting before deduplicating.

A new `dedup` field on `MergedVec<T>` removes duplicate items after
merging, using order-preserving dedup.

The flag accepts `true`, `false`, or `"inherit"`. Omitting the field (or
using `"inherit"`) means "no opinion" — the flag propagates from the
previous merge in the chain. Once any config in the chain enables it,
all subsequent merges deduplicate unless a later config explicitly sets
it to `false`.

`conversation.attachments` now defaults to `dedup = true`, preventing
the same attachment from appearing more than once when multiple config
layers are merged. To opt out:

    [conversation.attachments]
    dedup = false

Several related fixes are also included: `FillDefaults` now propagates
correctly for `system_prompt_sections`, `instructions`, `attachments`,
and `PartialReasoningConfig`; `is_empty()` on `MergeableVec` and
`MergeableMap` now accounts for metadata so a `Merged` with no items but
active flags is no longer treated as empty; and `vec_dedup` is now
order-preserving instead of sorting before deduplicating.

Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
@JeanMertz JeanMertz merged commit d15e902 into main Apr 11, 2026
13 checks passed
@JeanMertz JeanMertz deleted the prr104 branch April 11, 2026 00:36
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