You are working on the hyperswitch repository (Rust payment processing system).…
- User
You are working on the hyperswitch repository (Rust payment processing system).
REPOSITORY SETUP:
- Repository: juspay/hyperswitch
- Working directory: ./repos/hyperswitch_pool_1 (already cloned)
- Base commit: 67a42f0c27157f876698982a6b5f0a1cd3e15ffb
- Task ID: juspay__hyperswitch-8240
- Version: v1.114.0
TASK DESCRIPTION: Bug: refactor(dynamic_routing): add support for shuffle on tie flag to success_based routing
DETAILED CONTEXT & HINTS:
Type of Change
- Bugfix
- New feature
- Enhancement
- Refactoring
- Dependency updates
- Documentation
- CI/CD
Description
This pull request introduces a new feature to the routing configuration: the ability to shuffle results on a tie during exploitation. This feature is implemented across multiple files, including API specifications, Rust models, and protocol buffer definitions. Below is a summary of the most important changes grouped by theme.
Feature Addition: Shuffle on Tie During Exploitation
- API Specification Update: Added
shuffle_on_tie_during_exploitationto the routing configuration inapi-reference/hyperswitch_intelligent_router_open_api_spec.yml. This parameter enhances routing behavior during exploitation when multiple options have equal success rates. - Rust Model Updates:
- Updated the
SuccessBasedRoutingConfigdefault implementation incrates/api_models/src/routing.rsto includeshuffle_on_tie_during_exploitationwith a default value offalse. - Added
shuffle_on_tie_during_exploitationas an optional field in theSuccessBasedRoutingConfigBodystruct to allow API clients to configure this behavior. - Modified the
update_frommethod inSuccessBasedRoutingConfigBodyto handle updates to theshuffle_on_tie_during_exploitationfield.
- Updated the
- Protocol Buffer Update: Added as an optional field in the message definition in . This ensures compatibility with external services using gRPC.
Assistant
I'll help you implement the shuffle on tie flag for success-based routing in the hyperswitch repository. Let me start by creating a plan and then examine the relevant files to understand what needs to be changed.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.