Page the overdue report, and read every page of the account-wide lists
Written by @thehalebot
basecamp reports overdue reads the overdue to-dos report once. Since basecamp/bc3#14519, Basecamp answers that report one page at a time: 15, 30, 50, then 100 to-dos, most recently due first, each page holding the same four lateness groups. So in production the command shows the first page as if it were the whole report, and its summary counts only that page. This change gives the command --page, has the summary say how many to-dos the whole report holds, and offers the next page as a breadcrumb while one remains. It also lets the CLI's MCP server (basecamp mcp) take the next_page its get_overdue_todos already answers, which it refuses in production as an unknown parameter.
The second commit is for basecamp/bc3#14537, which pages five more account-wide lists at 50 a page: overdue to-dos, overdue cards, completed assignments, the timesheet report and the assigned to-dos report, each answered whole until now. On basecamp-sdk v0.37.0 those commands would show the first page as the whole list once it ships. They now read every page, through basecamp/basecamp-sdk#1102.
Merge order: merge after basecamp/bc3#14537 and after basecamp/basecamp-sdk#1102, whose head this pins.
What changes for users
--page Nreads page N of the report. Without it, the command reads the first page, as before. The help says the longest-overdue to-dos are on the last pages.- Summary:
15 of 214 overdue todos (…)when the report holds more than this page, fromX-Total-Count. A report that fits on one page keeps2 overdue todos (…). - Breadcrumb:
nextisbasecamp reports overdue --page N+1while Basecamp sendsLink: rel="next", and is absent on the last page. - The output's data keeps its four lateness groups, holding this page's to-dos, plus the SDK's
meta. todos list --overdue,cards list --all-projects --overdue,assignments completed,timesheet reportandreports assignedread every page and show the whole list, as before bc3#14537. The overdue listings keep their cap of 100,--alland--limit, and still refuse--page; they now say so when the SDK stops short of the last page.- The MCP server:
get_overdue_todostakespage. Its dispatcher already wrapped any response withLink: rel="next"as{"next_page": N, "results": ...}, but it rejects parameters an operation doesn't declare. The vendored SDK model (internal/mcpserver/model/) is re-synced from 8f70192 withscripts/sync-mcp-model.sh, which declarespageand describes the paging. The catalog snapshot changes by that one description line. After the #1102 pin, the model marks the five lists paginated, soget_everything_overdue_todos,get_everything_overdue_cards,get_my_completed_assignments,get_timesheet_reportandget_assigned_todostakepagetoo, and the snapshot marks thempaginated.
History
- The command was added in #84 (62de99f6) and has made one
Reports().OverdueTodoscall since, which was the whole report until bc3#14519 paged the endpoint. That change stopped a single request growing a Puma worker to several GB. - The SDK side is basecamp/basecamp-sdk#1100 (merged at 8f70192).
OverdueTodos(ctx, page)reads exactly one page, following basecamp-sdk#617, and reports an unfollowedrel="next"asMeta.TruncatedandX-Total-CountasMeta.TotalCount. It carries no pagination trait, because the report is an object of four arrays and the trait names one, the same carve-out asGetMyNotifications. So no SDK walks the report. - The paging shape follows
notifications list, the CLI's other object-of-several-lists read on that carve-out:--pagewith anInt32Vardefaulting to the first page, and anextbreadcrumb (#799). #590 set the rule that a listing needs an escape hatch past its first read, which--pagegives here. - The MCP server (#662, #663) builds its actions from the vendored SDK model, which
TestCatalogModelProvenanceholds to the SDK commitgo.modpins, so the model sync rides with the pin. #663 synthesizedpagefor operations the model marks paginated without declaring it. The overdue report isn't marked paginated (no trait, as above), so it needed the parameter declared in the SDK, which #1100 did. - The Nix package pins a
vendorHashthat anygo.sumchange invalidates. #1034's SDK bump refreshed it in the same change, and so does this one. API-COVERAGE.mdandACCOUNT-WIDE-LISTINGS.mdcallreports overduea lateness-bucketed report, distinct fromtodos list --all-projects --overdue. That stays true, so they are unchanged.
Invariants
- The first page sends no
page, and a page with more names the next one.TestReportsOverduePageWithMoreNamesTheNextPageserves two to-dos withLink: rel="next"andX-Total-Count: 21. The request has no query, the summary is2 of 21 overdue todos (1 <1 week, 1 >1 month), and thenextbreadcrumb isbasecamp reports overdue --page 2. Onmain, the summary was2 overdue todosand there was nonext. --pagereaches the wire, and a later page names the page after it.TestReportsOverdueLaterPageNamesThePageAfterItruns--page 2against a page with a next link: the request ispage=2, the summary is2 of 95 …, andnextis--page 3.- A report on one page reads as before.
TestReportsOverdueWholeReportOnOnePageNamesNoNextPagesends no paging headers: the summary is2 overdue todos (…), and there is nonextbreadcrumb. - The MCP server follows the overdue report's pages.
TestServerPagesTheOverdueReportcallsget_overdue_todos, getsnext_page: 2, and passes it back aspage. Before the model sync, the second call failed withunknown parameter "page" for action "get_overdue_todos". - The surface snapshot gains only the new flag.
.surfaceaddsFLAG basecamp reports overdue --page type=int32. - The five lists read every page, in order.
TestAccountWideListsReadEveryPageserves each route as two Link-paged pages. Each command requests the first page, thenpage=2, and shows both records in order. The test transport gainslinkedroutes, which sendLink: rel="next"the way Basecamp does. - The MCP server pages exactly the lists the SDK marks paginated.
TestCatalogPaginatedActionsTakePagecounts 68 Link-paginated operations, up from 63, each with onepageparameter. - The Nix flake builds with each commit's
go.sum. EachvendorHashis regenerated withmake update-nix-hash, which built the flake with it. bin/cipasses, and so does CI.
Builds on
- basecamp-sdk v0.37.0, which carries basecamp/basecamp-sdk#1100's page on the overdue report. The first commit bumps to it, with no code change beyond #1100's.
- basecamp/basecamp-sdk#1102, open. The second commit pins its head
1d0f5e04asv0.37.1-0.20261120012501-1d0f5e04225d, withmake bump-sdk, the way #942 pinned an SDK commit. Bumping to the release that carries it needs no code change here.
Rejected Alternatives
- Show the page number in the summary (
page 4: 19 of 214). The absentnextbreadcrumb already marks the last page, and--pageis what the caller just typed. - Read every page and merge them. That brings back the unbounded read bc3#14519 removed, from the client's side, and a merged report on a large account is too long to scan in a terminal anyway.
notifications listpages the same way for the same reason. - Add
--allbeside--page. No one has asked for it, and thenextbreadcrumb already leads an agent through the pages. - Refuse
--page 0or a negative page, ascomments listdoes. There the guard stops an explicit 0 from crawling every page. Here 0 means the first page and nothing crawls, so the command followsnotifications list, which accepts it.
How to try it
Production Basecamp already pages the report. From this branch, make build, then ./bin/basecamp reports overdue on an account with more than 15 overdue to-dos: it says 15 of N overdue todos and offers --page 2. basecamp reports overdue from main says 15 overdue todos with no next page.
Further Work
-
--pageon the two overdue listings. They read every page and trim to the cap locally, as when the endpoints were unpaged. Walking only until the cap, as the other account-wide listings do withaccountWideCollect, would save requests on a long list. -
The TUI's assignments hub polls
reports assignedevery minute per account, and now reads every page of it each time. -
The SDK's description of the operation says "latest first", which the vendored MCP model and catalog snapshot carry. It means most recently due first; the wording belongs in basecamp-sdk and comes here with the next model sync.
Card: https://app.basecamp.com/2914079/buckets/27/card_tables/cards/10512247737