fix(sidecar): persist history page token to unblock truncated Gmail history - #680
Closed
cursor[bot] wants to merge 1 commit into
Closed
cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
…istory When listNewMessageIds hits the 3-page cap with more pages pending, the poller froze history_cursor but restarted pagination at page 1 on every subsequent poll. Once pages 1-3 were fully deduped the cursor could never advance and mail on page 4+ was permanently lost. Persist the dangling nextPageToken in sidecar_state (migration 32) and resume from it on the next poll. Clear the token when the listing completes or on history-gap re-anchor. Co-authored-by: schmug <schmug@users.noreply.github.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
ais-hub | 31e1f4d | Commit Preview URL Branch Preview URL |
Aug 10 2026, 11:10 AM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
agentic-inbox | 31e1f4d | Aug 10 2026, 11:11 AM |
Owner
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.
Summary
history.listnextPageTokeninsidecar_state.history_page_token(migration 32) when the 3-page cap leaves more pages pending.listNewMessageIdsresume and two-poll workspace convergence.Why
When
listNewMessageIdshitsMAX_HISTORY_PAGES=3with a danglingnextPageToken, the poller correctly freezeshistory_cursorbut restarts at page 1 on every subsequent poll. Once pages 1–3 are fully deduped, the cursor can never advance and mail on page 4+ is permanently lost — silent data loss during Gmail history bursts for sidecar mailboxes.Test plan
npm testpasses locally (60 tests: gmail-client, workspace-poll, sidecar-state)npm run typecheckpasses locallyNotes for reviewer
Same fix as prior investigation branches (#595/#667); main was still missing this at
627b2b5.