Skip to content

fix(search): check the last shortened read window against its budget - #9987

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/read-window-final-candidate
Nov 13, 2026
Merged

waleedlatif1 merged 1 commit into
stagingfrom
fix/read-window-final-candidate

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • encodedWindowEnd shortened a window up to three times but returned before checking the third shortened window, so a window that fit its budget fell back to the 8K minimum
  • It now checks every window it computes and computes none it doesn't check. Text whose escaped characters come first (quotes, backslashes, line breaks) gets the longer window it fits instead of the standard page

Type of Change

  • Bug fix

Testing

  • New read-window.test.ts case fails on the previous loop (8000 instead of 19000) and passes now
  • bun run test lib/sim-search/live lib/knowledge/mcp (513 passed), biome on changed files

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Nov 13, 2026 5:52am UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] This PR appears safe to merge.

Summary

encodedWindowEnd now checks the final shortened window before falling back to the standard page.

  • Document reads keep more text when escaped characters come first.

Reviews (1) · Last reviewed commit: "fix(search): check the last shortened re..." · Reviewed by Greptile

@waleedlatif1
waleedlatif1 merged commit 3c4c4de into staging Nov 13, 2026
80 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/read-window-final-candidate branch November 13, 2026 08:03

This branch was previously deployed

1 inactive deployment
Preview — 7f0d4820 Deployed Nov 13, 2026 by vercel[bot]
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