Skip to content

FIX: include filter content in ImagePromptStyleConverter identifier - #3398

Open
Pushpak Siva Sai (Pushpak731) wants to merge 1 commit into
microsoft:mainfrom
Pushpak731:fix/image-prompt-style-converter-identifier
Open

Pushpak Siva Sai (Pushpak731) wants to merge 1 commit into
microsoft:mainfrom
Pushpak731:fix/image-prompt-style-converter-identifier

Conversation

@Pushpak731

Copy link
Copy Markdown
Contributor

Closes #3386

Problem

ImagePromptStyleConverter resolves a custom filter to its file stem and _build_identifier() recorded only filter_name and variation. The filter's style_instructions and variations — the content actually sent to the LLM — were not part of the identifier, so:

  • two custom files with the same stem in different folders (team_a/noir.yaml vs team_b/noir.yaml) shared one identifier,
  • a custom file sharing a built-in filter's name (gritty_documentary.yaml) collided with the built-in,
  • the second ConverterRegistry registration raised a duplicate-name error and analytics attributed prompts to the wrong filter.

Fix

style_instructions and variations ride the identifier params alongside filter_name/variation. Identical content still yields the identical identifier (same behavior = same identity); only genuinely different filters are told apart.

Tests (6 new)

  • same-stem custom filters with different content → different hash and unique_name
  • custom filter vs same-named built-in → different hash
  • identical content in different folders → stable, equal hash
  • params expose filter_name, style_instructions, and variations
  • pinned vs unpinned variation still distinguished
  • the issue's registry failure mode: two same-named custom filters both register

Verified the new tests fail on the unfixed identifier (mutation-checked).

Verification

  • tests/unit/converter/ + tests/unit/registry/ + identifier suites — 3883 passed, 74 skipped
  • ruff check + format clean

I used AI to assist me with this change.

The converter names a custom filter after its file stem and its
identifier recorded only that stem and the variation, so two custom
filter files with the same name in different folders - or a custom file
sharing a built-in filter's name - got the same identifier when their
content differed. Registering the second converter raised a
duplicate-name error, and memory and analytics attributed converted
prompts to the wrong filter (microsoft#3386).

The loaded style_instructions and variations, which are what the
converter actually sends to the LLM, now ride the identifier params
alongside filter_name and variation.

Closes microsoft#3386
Copilot AI balanced review requested due to automatic review settings October 20, 2026 14:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
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.

BUG: ImagePromptStyleConverter identifies a custom filter_path only by its file name

2 participants