Repository navigation
perf(api): Hold 150 events in default dashboard pages - #2739
Merged
Merged
Conversation
Default detail, earlier, newer, around, and link pages held up to 500 events. Cap them at 150. Explicit limit callers keep their behavior. Co-Authored-By: BYK <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
BYK
approved these changes
Nov 5, 2026
This branch was successfully 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.
Part of #2568. Follows #2722, which moved the default first page to the latest 3 Turns.
Three dashboard pages still held up to 500 events:
/eventswithbeforeorafterunreadPage, andaroundevent=andturn=link pagesThe default first page also fell back to 500 events when the latest 3 Turns held more. All of these now hold at most 150 events (
CONVERSATION_EVENT_PAGE_LIMIT). Callers that pass alimitsee no change (CLI briefs passlimit=1000, MCP and evals passlimit). The client code is unchanged.Numbers
These use the same setup as #2722: local Postgres behind a ~4 ms round-trip proxy, a pool of 10, and in-process API requests. The viewer can see private content. The Conversation has 1,920 events in 105 Turns, and every 20th Turn is a 184-event tool loop. Each figure is the warm p50 of 12 reads, and the range covers 3 runs.
before)around,event=,unreadPage)Why 150: page cost by
limit, measured on the same Conversation:beforep50A page costs a fixed ~15 ms plus ~0.1 ms and ~620 bytes per event. At 150 events, the per-event cost is about the same as the fixed cost. Going lower saves a few ms per page but needs more requests, and each one adds a browser round trip in production.
Considered and not done
Turn-aligned earlier and around pages. On short Turns, these pages would hold fewer events (about 30 instead of 150) and save ~10 ms server time per page. Scrolling the same distance would then take about 5× more requests. On long Turns the 150 cap applies anyway. So the only extra step is the cap: earlier and around pages stay fixed-count, and only the first page keeps #2722's 3-Turn start.
Behavior changes
/eventsroute uses the shared schema default, so mockbeforepages are now 150 too. Mock conversations fit one page.Tests
event-listscenario: the long-Turns case now covers a 150-event default detail, plus a defaultbeforepage and a defaultevent=page.tests/integration/api/conversations/(72 tests),dashboard-reportingandconversation-sqlpass on local Postgres.conversations-read-position,conversations-event-log,conversations-mobile,conversations.spec,conversation-details.No UI change, so no screenshots.
via @BYK.
--
View Session in Sentry