Skip to content

fix(hybrid_routing): prioritize evaluated connectors in static eligible list - #354

Open
AnkitKmrGupta wants to merge 1 commit into
mainfrom
fix-volume-split-hybrid-evaluated-connectors
Open

fix(hybrid_routing): prioritize evaluated connectors in static eligible list#354
AnkitKmrGupta wants to merge 1 commit into
mainfrom
fix-volume-split-hybrid-evaluated-connectors

Conversation

@AnkitKmrGupta

Copy link
Copy Markdown
Collaborator

This pull request refines the logic for extracting eligible gateways in src/routes/hybrid_routing.rs. The updated implementation ensures that connectors from the evaluated_output field are prioritized and ordered without duplicates, while still including all originally eligible connectors.

Improvements to gateway extraction logic:

  • The extract_static_eligible_gateways function now combines connectors from evaluated_output (filtered to those in eligible_connectors) with the original eligible_connectors list, ensuring no duplicates and preserving order. This change improves the accuracy and determinism of gateway selection.

@AnkitKmrGupta AnkitKmrGupta self-assigned this Aug 17, 2026
Copilot AI lite review requested due to automatic review settings August 17, 2026 12:30

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.

Pull request overview

Refines static gateway extraction in src/routes/hybrid_routing.rs so the final “static eligible” connector list is deterministic and prioritizes connectors that appear in evaluated_output, while still including all originally eligible connectors.

Changes:

  • Prefer evaluated_output connectors (filtered to the eligible set) ahead of the original eligible_connectors.
  • De-duplicate connectors while preserving the final ordering.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +66 to +80
let eligible = &response.eligible_connectors;
let mut ordered = Vec::with_capacity(eligible.len());

for connector in response
.evaluated_output
.iter()
.filter(|evaluated| eligible.contains(evaluated))
.chain(eligible)
{
if !ordered.contains(connector) {
ordered.push(connector.clone());
}
}

ordered
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.

2 participants