Skip to content

fix(ft.hybrid): Always generate vector param names if they are not provided by the user#3844

Merged
ndyakov merged 7 commits into
masterfrom
ndyakov/fthybrid-always-params
Jun 11, 2026
Merged

fix(ft.hybrid): Always generate vector param names if they are not provided by the user#3844
ndyakov merged 7 commits into
masterfrom
ndyakov/fthybrid-always-params

Conversation

@ndyakov

@ndyakov ndyakov commented Jun 5, 2026

Copy link
Copy Markdown
Member

Redis will no longer support inlined vector blobs, the only non-breaking way would be to autogenerate param names if they are not provided,


Note

Medium Risk
Changes FT.HYBRID wire format for all vector expressions (no inline blobs), which is required for newer Redis but alters command construction for existing callers.

Overview
FT.HYBRID now always sends vector data through PARAMS ($name + blob), because Redis no longer accepts inline vector blobs. When VectorParamName is omitted, the client auto-generates names like __vector_param_0 via new generateVectorParamName, with collision avoidance against existing Params and other explicit vector param names.

Command building uses a local params map so FTHybridOptions.Params is never mutated, making the same options struct safe to reuse across calls. Explicit VectorParamName values are still honored.

Unit tests cover PARAMS wiring, unique names, no mutation, and name collisions; integration hybrid tests no longer skip Redis 8.6+ now that PARAMS is always used.

Reviewed by Cursor Bugbot for commit e5a4485. Bugbot is set up for automated code reviews on this repo. Configure here.

ndyakov added 2 commits June 5, 2026 14:42
Redis no longer supports inline vector blobs in FT.HYBRID. Always pass
vector data through the PARAMS mechanism, generating a unique parameter
name when VectorParamName is not provided. Update the related comments
and drop the now-obsolete 8.6+ skip guards in the integration tests.

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a47845e. Configure here.

Comment thread search_commands.go Outdated
@jit-ci

jit-ci Bot commented Jun 5, 2026

Copy link
Copy Markdown

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

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

Updates FT.HYBRID argument encoding to always send vector blobs through PARAMS (with $param references), auto-generating parameter names when callers don’t provide one, aligning the client with Redis dropping inline vector blob support.

Changes:

  • Always encode vector data via PARAMS, generating unique VectorParamName values when empty.
  • Add unit tests covering generated names, user-provided names, and multiple vectors.
  • Update integration tests to run past Redis 8.5 by removing guards that existed due to inline vector blob failures.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
search_commands.go Always references vectors via $param and stores blobs in options.Params; adds generateVectorParamName helper and updates docs.
search_commands_unit_test.go Adds helpers and tests asserting correct PARAMS wiring for generated and provided vector param names.
search_test.go Removes SkipAfterRedisVersion(8.5) so FT.HYBRID integration tests run on newer Redis versions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread search_commands.go Outdated
Comment thread search_commands_unit_test.go Outdated

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread search_commands.go Outdated
Comment thread search_commands.go
ndyakov and others added 3 commits June 5, 2026 15:51
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
@ndyakov ndyakov added the bug label Jun 11, 2026
@ndyakov
ndyakov merged commit e1a2d68 into master Jun 11, 2026
40 checks passed
@ndyakov
ndyakov deleted the ndyakov/fthybrid-always-params branch June 11, 2026 06:07
rohitkumarankam pushed a commit to rohitkumarankam/forgejo that referenced this pull request Jun 11, 2026
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [github.com/redis/go-redis/v9](https://github.com/redis/go-redis) | `v9.20.0` → `v9.20.1` | ![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fredis%2fgo-redis%2fv9/v9.20.1?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fredis%2fgo-redis%2fv9/v9.20.0/v9.20.1?slim=true) |

---

### Release Notes

<details>
<summary>redis/go-redis (github.com/redis/go-redis/v9)</summary>

### [`v9.20.1`](https://github.com/redis/go-redis/releases/tag/v9.20.1): 9.20.1

[Compare Source](redis/go-redis@v9.20.0...v9.20.1)

This is a patch release containing bug fixes only. There are no new features or breaking changes; upgrading from 9.20.0 is a drop-in replacement.

#### 🚀 Highlights

##### RESP3 pub/sub message loss fixed

`PeekPushNotificationName` previously inspected only the bytes already buffered by `bufio`, so when a push frame header straddled a buffer fill boundary it could return a **truncated** notification name (e.g. `"messa"` instead of `"message"`). The push processor then mis-routed the frame and `ReadReply` silently dropped it, causing intermittent RESP3 pub/sub message loss. The peek now grows its window (36 bytes → up to 4 KiB) and reads more from the connection until the header is complete, cleanly separating incomplete prefixes from corrupt frames (including overflow-safe bulk-length handling). Fixes [#&#8203;3839](redis/go-redis#3839).

([#&#8203;3842](redis/go-redis#3842)) by [@&#8203;ndyakov](https://github.com/ndyakov)

#### 🐛 Bug Fixes

- **RESP3 push peeking**: `PeekPushNotificationName` no longer returns a truncated notification name when a push frame header spans a buffer boundary, preventing silent RESP3 pub/sub message loss (fixes [#&#8203;3839](redis/go-redis#3839)) ([#&#8203;3842](redis/go-redis#3842)) by [@&#8203;ndyakov](https://github.com/ndyakov)
- **`FT.HYBRID` vector params**: Vector data is now always sent via `PARAMS` with auto-generated param names (`__vector_param_N`, with collision avoidance) when `VectorParamName` is omitted, since Redis no longer accepts inline vector blobs; the `FTHybridOptions.Params` map is no longer mutated, so the same options struct can be reused across calls ([#&#8203;3844](redis/go-redis#3844)) by [@&#8203;ndyakov](https://github.com/ndyakov)
- **`CLUSTER SHARDS` forward compatibility**: Unknown shard- and node-level attributes in the `CLUSTER SHARDS` reply are now skipped via `DiscardNext()` instead of erroring, so clients keep working when the server introduces new fields ([#&#8203;3843](redis/go-redis#3843)) by [@&#8203;madolson](https://github.com/madolson)
- **PubSub double reconnect**: `PubSub.releaseConn` no longer reconnects twice when a connection is both unusable (or pending handoff) and reports a bad-connection error, avoiding a wasted connection establish-then-close cycle ([#&#8203;3833](redis/go-redis#3833)) by [@&#8203;cxljs](https://github.com/cxljs)

#### 👥 Contributors

We'd like to thank all the contributors who worked on this release!

[@&#8203;cxljs](https://github.com/cxljs), [@&#8203;madolson](https://github.com/madolson), [@&#8203;ndyakov](https://github.com/ndyakov)

***

**Full Changelog**: <redis/go-redis@v9.20.0...v9.20.1>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - Between 12:00 AM and 03:59 AM (`* 0-3 * * *`)
- Automerge
  - Between 12:00 AM and 03:59 AM (`* 0-3 * * *`)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yMTQuNSIsInVwZGF0ZWRJblZlciI6IjQzLjIxNC41IiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/13061
Reviewed-by: Mathieu Fenniak <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants