Skip to content

Preserve empty responses in prompt normalizer batches#1506

Open
biefan wants to merge 1 commit intoAzure:mainfrom
biefan:preserve-batch-response-alignment
Open

Preserve empty responses in prompt normalizer batches#1506
biefan wants to merge 1 commit intoAzure:mainfrom
biefan:preserve-batch-response-alignment

Conversation

@biefan
Copy link
Contributor

@biefan biefan commented Mar 17, 2026

Summary

  • turn None / empty target responses into explicit empty response messages in PromptNormalizer.send_prompt_async()
  • preserve one result per request in send_prompt_batch_to_target_async() instead of filtering empty responses away
  • add regression coverage for single-request empty responses and batch response alignment

Problem

PromptNormalizer.send_prompt_async() currently returns None when a target returns no messages, and the batch helper filters those None entries out. That breaks the one-request-to-one-response contract for batch callers and can misalign downstream consumers that pair responses with their original prompt list.

Validation

  • .venv/bin/pytest tests/unit/prompt_normalizer tests/unit/executor/promptgen/fuzzer -q
  • .venv/bin/ruff check pyrit/prompt_normalizer/prompt_normalizer.py tests/unit/prompt_normalizer/test_prompt_normalizer.py

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