[Improve] Add bounded task-history pagination - #3053
Draft
roomote-roomote[bot] wants to merge 2 commits into
Draft
roomote-roomote[bot] wants to merge 2 commits into
roomote-roomote[bot] wants to merge 2 commits into
Conversation
Contributor
| const conditions = [ | ||
| eq(fastAgentMessages.conversationId, fastConversationId), | ||
| sql`coalesce(${fastAgentMessages.metadata} ->> 'visibleInTranscript', 'true') <> 'false'`, | ||
| fastSnapshotCondition(snapshot, fastConversationId), |
Contributor
There was a problem hiding this comment.
The creation-time cutoff does not freeze Fast-session pages. upsertMessage updates an existing event's ts and turnSeq on replay while leaving createdAt unchanged, so a replay after page one can move a pre-snapshot row across this cursor boundary. It still passes this predicate and hasNewer remains false, which can skip or duplicate it on the continuation page. The paging snapshot needs to account for mutable replayed rows (or the stored page ordering needs to be immutable).
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
get_messagespagination with target- and order-bound continuation cursors.hasMore,nextCursor,coverage,truncated, and newer-arrival metadata for task and Session history.Why this change was made
Visual-proof audits need to reconstruct task stages across older history without requesting an oversized transcript. The previous latest-history behavior could truncate the evidence needed to connect capture entry, review handoff, and delivery.
Impact
Task and Session inspection now defaults to bounded pages and can walk older history until
coverage.completeis true. Cursor contents contain only non-secret identifiers and timestamps, while existing task, Session, custom-automation, and Fast-session access checks remain in force. Large message content is explicitly marked as truncated instead of silently inflating the inspection payload.