Skip to content

feat(search): expose timeout warnings on FT.SEARCH family#3338

Open
nkaradzhov wants to merge 2 commits into
redis:masterfrom
nkaradzhov:timeout-guardrails
Open

feat(search): expose timeout warnings on FT.SEARCH family#3338
nkaradzhov wants to merge 2 commits into
redis:masterfrom
nkaradzhov:timeout-guardrails

Conversation

@nkaradzhov

@nkaradzhov nkaradzhov commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Surface the server warning field returned alongside partial results when a query hits its timeout under a return/return-strict on-timeout policy.

  • Add shared parseWarnings helper in reply-transformers that extracts the warning field from a RESP3 map reply and normalizes it to string[].
  • Add warnings: Array<string> to SearchReply, SearchNoContentReply, and AggregateReply; FT.HYBRID already exposed warnings and now reuses the helper.

FT.SEARCH and FT.AGGREGATE only carry warnings on RESP3 (empty array on RESP2); FT.HYBRID reports on both protocols. The new field is additive.

Description

Describe your pull request here


Checklist

  • Does npm test pass with this change (including linting)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?

Note

Low Risk
Additive reply parsing and TypeScript fields only; no command or auth changes. Consumers may need to account for the new warnings property in strict typing or destructuring.

Overview
Adds warnings: string[] to transformed replies for FT.SEARCH, FT.SEARCH NOCONTENT, FT.AGGREGATE, and related cursor flows so callers can see server messages (e.g. timeout under return / return-strict) when partial results are returned.

A shared parseWarnings helper in reply-transformers reads the RESP3 map field warning / warnings and normalizes entries to strings. RESP3 transformers for search and aggregate use it; RESP2 always sets warnings: [] because those commands do not carry warnings on RESP2. FT.HYBRID already exposed warnings and now uses the same helper instead of duplicate parsing.

Integration expectations and unit tests for RESP2/RESP3 warning behavior were updated accordingly. The change is additive on reply shapes (existing fields unchanged).

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

@nkaradzhov
nkaradzhov requested a review from PavelPashov July 14, 2026 11:15
…HYBRID

Surface the server `warning` field returned alongside partial results when a
query hits its timeout under a `return`/`return-strict` on-timeout policy.

- Add shared `parseWarnings` helper in reply-transformers that extracts the
  `warning` field from a RESP3 map reply and normalizes it to `string[]`.
- Add `warnings: Array<string>` to SearchReply, SearchNoContentReply, and
  AggregateReply; FT.HYBRID already exposed warnings and now reuses the helper.

FT.SEARCH and FT.AGGREGATE only carry warnings on RESP3 (empty array on RESP2);
FT.HYBRID reports on both protocols. The new field is additive.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@nkaradzhov
nkaradzhov force-pushed the timeout-guardrails branch from 75bd8ec to 6faf640 Compare July 21, 2026 18:52
FT.CURSOR READ reuses AGGREGATE_WITHCURSOR's transformReply, which now
includes the additive warnings field.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant