Skip to content

feat: persist the tree and file content through an optional store - #7

Merged
m1ngsama merged 1 commit into
mainfrom
perf/docs-cache
Sep 26, 2026
Merged

m1ngsama merged 1 commit into
mainfrom
perf/docs-cache

Conversation

@m1ngsama

Copy link
Copy Markdown
Member

Every process re-downloads the tree and each document, so the Prompt docs reader waits ~1 s per document and nothing works offline.

  • DocsClientOptions.store ({ read(key), write(key, value) }) persists the tree and file content. Content is keyed by its git blob sha and only reused when it hashes to the sha in the current tree, so it is never stale and a corrupt entry is ignored.
  • DocItem.sha carries the blob sha from the tree.
  • peekAll() returns the known tree without a request, for showing a list before the network answers.
  • Store errors are treated as misses. Everything is additive, so it ships as 0.3.2.

In Prompt, reopening a read document drops from ~1 s to 15–31 ms, and read documents open offline.

@m1ngsama
m1ngsama merged commit ea69745 into main Sep 26, 2026
5 checks passed
@m1ngsama
m1ngsama deleted the perf/docs-cache branch September 26, 2026 09:54
@m1ngsama m1ngsama mentioned this pull request Sep 26, 2026
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