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_0 (already cloned)
- Base commit: e637b214e348216d30c9af59cce85a1264badebf
- Task ID: juspay__hyperswitch-8157
- Version: v1.114.0
TASK DESCRIPTION: Bug: refactor(success_based): add support for exploration
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 support an "exploration percentage" parameter in success-based routing configurations and adds a "RoutingApproach" enum to define routing strategies. These changes span multiple files, including API specifications, Rust models, and protocol buffer definitions, ensuring end-to-end support for the new functionality.
New Feature: Exploration Percentage in Routing Configurations
- Added
exploration_percentparameter to theSuccessBasedRoutingConfigstruct in Rust models (crates/api_models/src/routing.rs) and updated its default implementation. [1] [2] - Modified the
updatemethod inSuccessBasedRoutingConfigBodyto handle updates to theexploration_percentfield. - Updated the gRPC client (
crates/external_services/src/grpc_client/dynamic_routing/success_rate_client.rs) to include theexploration_percentfield in theCalSuccessRateConfigmapping. - Enhanced the protocol buffer definition (
proto/success_rate.proto) to includeexploration_percentas an optional field in theCalSuccessRateConfigmessage.
New Enum: Routing Approach
Assistant
I'll tackle this refactoring task to add support for exploration in success-based routing. Let me first understand the current implementation by examining the relevant files mentioned in the task description.
Assistant
Let me start by examining the current SuccessBasedRoutingConfig struct in the routing.rs file to understand the existing implementation.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.