Skip to content

perf(agent): index imported history position reads - #6739

Merged
M4n5ter merged 1 commit into
rust-previewfrom
fix/imported-history-position-index
Nov 10, 2026
Merged

M4n5ter merged 1 commit into
rust-previewfrom
fix/imported-history-position-index

Conversation

@M4n5ter

@M4n5ter M4n5ter commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Summary

Imported history point reads and position-ordered pages scanned every entry in a snapshot and sorted pages in a temporary B-tree. A partial unique index on imported message positions makes both paths seek directly by snapshot and position. This benefits history browsing, model context reads, archive validation, and prefix copies.

The offline migration CLI is removed from the source tree and maintained in the external migration gist. The application retains only the generic imported-context API and database index.

Verification

  • No new tests added; the index is validated against actual snapshot query plans.
  • Actual snapshot queries use the position index for exact and paginated reads, with no temporary sort.
  • Imported-context behavior test passed with the full migration catalog.
  • External helper builds without modifying the checkout; typed validation and history import passed on a small real-history copy. The generated historical specification matches the previous helper byte for byte.

AI use

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Codex — implementation and validation.

Checklist

  • Tests cover the change and fail without it
  • Format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

Keep offline migration tooling in the external migration gist.

Generated-by: Codex
@M4n5ter
M4n5ter merged commit da2b680 into rust-preview Nov 10, 2026
1 check passed
@M4n5ter
M4n5ter deleted the fix/imported-history-position-index branch November 10, 2026 07:10
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