Skip to content

fix(core): read rerank prefix text up to the reranker's document limit - #1757

Merged
phernandez merged 1 commit into
mainfrom
perf/1746-search-late-text
Oct 11, 2026
Merged

phernandez merged 1 commit into
mainfrom
perf/1746-search-late-text

Conversation

@phernandez

@phernandez phernandez commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

Summary

Follow-up to #1746. The stack (#1750, #1753, #1755) has already merged. This PR now carries only the fix for the Codex finding on this PR.

Search reads cap note text at 4,000 characters (#1750). A rerank prefix row that only full-text search found has no matched chunk, so its rerank document is its note text. The cap cut that text short even when reranker_max_document_chars is 0 (documented as sending the full text) or above 4,000.

  • _materialize takes a snippet_limit. The rerank prefix passes _rerank_snippet_limit(rerank): the whole text for 0, otherwise max(4000, limit).
  • Every other returned row keeps the 4,000-character read cap, and the public content stays at its display limit.

This only matters with the reranker enabled (off by default), reranker_max_document_chars set to 0 or above 4,000, and a full-text-only hit in the prefix. The #1234 sweep measured no quality difference for caps of 2,000 and above, but 0 is documented as unbounded.

Test plan

  • New test_unbounded_reranker_reads_a_lexical_rows_whole_text: a full-text-only note with a marker past character 4,000 reaches the reranker, while the API preview stays at 4,000 characters.
  • just fast-check
  • tests/repository: 1188 passed

🤖 Generated with Claude Code

https://claude.ai/code/session_01EQPZkbnuxxtTEJoNJCkt45

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T23:07:20.627302Z caf4f4b Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8d2578b3e9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@phernandez

Copy link
Copy Markdown
Member Author

@codex review

Search reads cap note text at 4,000 characters. A rerank prefix row only
full-text search found has no matched chunk, so its rerank document is
its note text, and the cap cut it short even when
reranker_max_document_chars is 0 (documented as sending the full text) or
above 4,000. The prefix now reads each row's text as far as the
reranker's limit: all of it for 0, otherwise max(4,000, limit). Every
other row keeps the cap, and the public content stays at its display
limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EQPZkbnuxxtTEJoNJCkt45
Signed-off-by: phernandez <paul@basicmachines.co>
@phernandez
phernandez force-pushed the perf/1746-search-late-text branch from 087da64 to caf4f4b Compare October 11, 2026 22:38
@phernandez phernandez changed the title perf(core): rank search by id in the database and fetch text for returned rows only fix(core): read rerank prefix text up to the reranker's document limit Oct 11, 2026
@phernandez
phernandez merged commit 63dbae3 into main Oct 11, 2026
33 checks passed
@phernandez
phernandez deleted the perf/1746-search-late-text branch October 11, 2026 22:40

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: caf4f4b61e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@phernandez

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 63dbae3e57

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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