runtime: add app-wide thread library#66
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b5a341b8ec
ℹ️ 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".
| return try await historyStore.threadListSnapshots() | ||
| .map(Library.ThreadSnapshot.init) | ||
| .filter { thread in |
There was a problem hiding this comment.
Enforce query limit on library snapshot reads
libraryThreadSnapshots(query:) applies archive/cwd/search filters but never applies query.limit, so makeLibrary(configuration:) can load and publish every matching thread in local history even when callers requested a bounded query. This breaks the expected behavior of ThreadListQD.limit for local-first startup and can significantly increase memory/UI work for users with large thread stores.
Useful? React with 👍 / 👎.
Summary
CodexAppServer.makeLibrary()and the app-wideLibraryobservable for stored thread listsVerification
swift test --filter CodexAppServerLibraryTestsswift testgit diff --check