Skip to content

Gate hybrid alpha_param on Weaviate 1.36.7 - #2245

Closed
abhisheksharma001 wants to merge 1 commit into
weaviate:mainfrom
abhisheksharma001:fix/hybrid-alpha-param-version-gate
Closed

abhisheksharma001 wants to merge 1 commit into
weaviate:mainfrom
abhisheksharma001:fix/hybrid-alpha-param-version-gate

Conversation

@abhisheksharma001

Copy link
Copy Markdown

What

_parse_hybrid switches to the alpha_param / use_alpha_param fields from server 1.36.6, with a # TODO: change to 1.36.7 once it's released (added in 8520a1c, when CI ran against the dev build 1.36.6-1abf310). The released 1.36.6 does not read use_alpha_param; that arrived in 1.36.7 (released 2026-03-25). This PR moves the gate to 1.36.7 and drops the TODO.

Effect on a 1.36.6 server today

From adapters/handlers/grpc/v1/ in weaviate/weaviate at v1.36.6:

  • Search (parse_search_request.go): alpha is hs.Alpha, replaced by alpha_param only when that is set. A hybrid query with no alpha sets neither, so it runs at alpha 0 (pure BM25) instead of the default.
  • Aggregate (parse_aggregate_request.go): reads hs.Alpha only, so aggregate.hybrid(..., alpha=...) runs at alpha 0 whatever alpha is passed.

After this change the client sends the legacy alpha field to servers below 1.36.7, defaulting to 0.7 as it did before. Behaviour on 1.36.7 and later is unchanged.

Tests

test/collection/test_hybrid_alpha.py adds unit tests (no server needed) for query and aggregate hybrid at 1.36.5 / 1.36.6 (legacy alpha) and 1.36.7 / 1.37.0 (alpha_param). Without the change, the two 1.36.6 cases fail and the other six pass. With it, pytest test/collection gives 416 passed, 1 skipped. The CI matrix runs 1.36.24 for 1.36, so the integration tests don't reach this path.

ruff check, ruff format --check and flake8 pass on the changed files. I did not run pyright locally.

🤖 Generated with Claude Code

The switch to alpha_param/use_alpha_param was gated on 1.36.6 with a
TODO to move it to 1.36.7. The released 1.36.6 does not read
use_alpha_param, so on that version a hybrid query without alpha ran at
alpha 0 (pure BM25), and aggregate hybrid ignored alpha entirely.
Servers before 1.36.7 now get the legacy alpha field again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@orca-security-eu orca-security-eu Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

@dirkkul

dirkkul commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

1.36.7 is quite old so I dont think we need to care about this anymore

@dirkkul dirkkul closed this Nov 9, 2026
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