Skip to content

Batch persistent history reads during reverse search#33905

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/efc791fcbd5290050af703dd31c5c21b33240e23
Jul 17, 2026
Merged

Batch persistent history reads during reverse search#33905
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/efc791fcbd5290050af703dd31c5c21b33240e23

Conversation

@copyberry

@copyberry copyberry Bot commented Jul 17, 2026

Copy link
Copy Markdown

Batch persistent history reads during reverse search

Why

Reverse search fetched persistent history one entry at a time, making a deep or unsuccessful search require a lookup for every older entry.

What changed

  • Keep the newest-entry probe lightweight, then scan older persistent history in bounded batches.
  • Cache batch results by absolute offset and preserve continuation cursors across repeated searches.
  • Ignore stale responses, retry failed batch reads a bounded number of times, and restore the draft without reporting a false “no match” state when history is unavailable.

Testing

  • Cover batch continuation, caching after query changes or cancellation, stale metadata, retry exhaustion, and thread routing.
  • Verify that scanning 1,024 entries uses one single-entry lookup and eight batch lookups.

## Why

Reverse search fetched persistent history one entry at a time, making a deep or unsuccessful search require a lookup for every older entry.

## What changed

- Keep the newest-entry probe lightweight, then scan older persistent history in bounded batches.
- Cache batch results by absolute offset and preserve continuation cursors across repeated searches.
- Ignore stale responses, retry failed batch reads a bounded number of times, and restore the draft without reporting a false “no match” state when history is unavailable.

## Testing

- Cover batch continuation, caching after query changes or cancellation, stale metadata, retry exhaustion, and thread routing.
- Verify that scanning 1,024 entries uses one single-entry lookup and eight batch lookups.

GitOrigin-RevId: efc791fcbd5290050af703dd31c5c21b33240e23
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/efc791fcbd5290050af703dd31c5c21b33240e23 branch from c1d707c to 7ed19a9 Compare July 17, 2026 21:17
@copyberry
copyberry Bot merged commit 7ed19a9 into main Jul 17, 2026
14 of 32 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/efc791fcbd5290050af703dd31c5c21b33240e23 branch July 17, 2026 21:18
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant