FEAT: deprecate raise in PrependedConversationConfig#1731
Merged
hannahwestra25 merged 3 commits intoMay 14, 2026
Merged
Conversation
jsong468
reviewed
May 14, 2026
jsong468
approved these changes
May 14, 2026
rlundeen2
approved these changes
May 14, 2026
Contributor
rlundeen2
left a comment
There was a problem hiding this comment.
Approved; but I also wonder if there are better ways to do the remaining functionality now. like converterConfig (for apply_converters_to_roles) and adding message normalizers to targets as we go
…ra/simplify_prepended_convo
Contributor
Author
yeah I think this piece is confusing with the target normalization and should be re-thought a bit / should be more streamlined. I created a follow up work item to fully deprecate this / rethink this class. |
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.
Simplify
PrependedConversationConfig: deprecate raise-on-non-chat-targetWhy
ConversationManageralready has a capability-driven path that normalizes a prepended conversation into the first turn when the target lacksEDITABLE_HISTORY. The legacynon_chat_target_behavior="raise"knob (and itsdefault()/for_non_chat_target()factories) are a parallel, weaker enforcement mechanism that predates that routing and doesn't compose withTargetCapabilities/CapabilityHandlingPolicy. This PR collapses that surface so non-chat targets have one consistent answer: normalize.What changes
PrependedConversationConfig(non_chat_target_behavior="raise")→ emitsDeprecationWarning(still raises this release).PrependedConversationConfig.default()→ emitsDeprecationWarning(still returns a"raise"config).PrependedConversationConfig.for_non_chat_target()→ emitsDeprecationWarning(equivalent to the default constructor).ValueErrortext on the"raise"path updated to call out the deprecation and the 0.16.0 behavior change. Misleading "configureTargetCapability" guidance removed.All three removals target 0.16.0.
Behavior changes
DeprecationWarnings added."raise"and the two factories will be removed. There is no direct replacement for"raise"— callers that need strict enforcement should pre-check the capability:CapabilityHandlingPolicywas considered but rejected:EDITABLE_HISTORYis intentionally not policy-addressable.Why
PrependedConversationConfigis keptThe class still owns two real, caller-facing knobs with no other home:
apply_converters_to_roles— selects which roles get request converters applied.message_normalizer— overrides theMessageStringNormalizerused for non-chat normalization.Both are exposed via
PromptSendingAttack,CrescendoAttack, andTreeOfAttacksAttack. Oncenon_chat_target_behaviorand the deprecated factories are gone in 0.16.0, the class will have a much smaller surface and could reasonably be renamed or folded into per-attack configs — deferred as future work.Tests and Documentation