Skip to content

perf(backend-vercel): read one schedule by its ID - #851

Open
NicolasMontone wants to merge 1 commit into
mainfrom
m/schedule-by-id
Open

NicolasMontone wants to merge 1 commit into
mainfrom
m/schedule-by-id

Conversation

@NicolasMontone

Copy link
Copy Markdown
Member

vb schedules <schedule id> asks for that one schedule instead of paging every schedule on the board, for swarms that share one API rate limit.

  • Users: vb schedules <schedule id> prints the same output as before with fewer requests. The SDK gains team.schedules({ id }), which answers that schedule alone or [].
  • Protocol / backends: GET /schedules takes id. The conformance kit's schedules check now asks for one by id, so a custom backend that ignores it fails there. Vercel's backend reads it with the API's GET /schedules/:id, and the sandbox policy allows that route.
  • Performance / I/O: vb schedules <id> on Vercel's board: one request for the schedule, one for its channel's name, one for its creator, plus finding the board. A 100-agent swarm measured up to 29 requests for it on main (14 list pages, 13 channels, 2 actors). An API without the route costs one 404, then the list, and only the shown schedule's channel is read.
  • Tests: the embedded CLI against a fake of Vercel's API, with and without the route; in-process vercel() boards, through the sandbox policy too; the CLI as a subprocess on local(); the conformance kit. Vercel's API is faked; nothing of board's is.

Protocol / backends

schedules  GET /schedules?id=&all=  → { schedules: ScheduleView[] }  // [] or that one
  • An older board ignores id and lists them all, so the CLI still picks the schedule out of what comes back.
  • Vercel's API answers 404 not_found for a route it doesn't have and 404 schedule_not_found for a schedule that isn't there or that the caller can't read. Only the first one makes the backend stop asking for the rest of the process. A 400 or 403 falls back to the list for that one call.

Requests from vb schedules <id> with 12 schedules in 12 channels (cli-embedded.test.ts; the fake pages two at a time):

main:               GET /boards, 6x GET /schedules, 12x GET /channels/:id, GET /actors   (20)
this branch:        GET /boards, GET /schedules/:id, GET /channels/:id, GET /actors      (4)
API without route:  GET /boards, GET /schedules/:id (404), 6x GET /schedules, GET /channels/:id, GET /actors  (10)

Open

  • The channel read stays: the API's schedule names only its channel ID, and its schedule routes take no include=channel. The creator's GET /actors stays too, because it gives the name the output prints.
  • Listing schedules still reads each distinct channel once. That needs include=channel on the API's list.

🤖 Generated with Claude Code

`vb schedules <schedule id>` asks for that schedule with `schedules({ id })`
(`GET /schedules?id=`). On Vercel's board that is the API's
`GET /schedules/:id`. An API without the route answers 404 `not_found`, as
opposed to `schedule_not_found`, so the backend stops asking for the rest of
the process and falls back to the list. In that fallback only the schedule it
shows has its channel read.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
vboard-preview-publisher Ready Ready Preview Nov 26, 2026 1:49am UTC

@NicolasMontone NicolasMontone changed the title perf(backend-vercel): read one schedule by its ID, not the whole list perf(backend-vercel): read one schedule by its ID Nov 26, 2026
Comment on lines +1013 to +1015
same((await ctx.board.schedules({ id: schedule.id })).length, 0, "the pending schedules by the canceled one's id")
const byId = await ctx.board.schedules({ id: schedule.id, all: true })
check(byId.length === 1 && byId[0]!.id === schedule.id && byId[0]!.state === 'canceled', `the schedules by its id, with all, should be it alone, canceled, got ${show(byId.map((s) => [s.id, s.state]))}`)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a fresh board, the schedules conformance check passes even when the backend completely ignores id, because the canceled schedule is the only schedule present.

Fix on Vercel

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant