Repository navigation
fix(web): point agents at Cap Infra in llms files and serve docs as Markdown - #4170
Merged
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
Sandchest reviewed Sandchest reviews every change for vulnerabilities an attacker could use · Review details |
richiemcilroy
force-pushed
the
fix/infra-agent-discovery
branch
from
November 13, 2026 05:49
78c49f0 to
8e27462
Compare
richiemcilroy
force-pushed
the
fix/infra-agent-discovery
branch
from
November 13, 2026 06:00
15f4862 to
5ed4c95
Compare
richiemcilroy
force-pushed
the
fix/infra-agent-discovery
branch
from
November 13, 2026 06:03
5ed4c95 to
1a691c2
Compare
Member
Author
|
hey @greptileai, please re-review the PR |
richiemcilroy
force-pushed
the
fix/infra-agent-discovery
branch
from
November 13, 2026 06:09
1a691c2 to
495c9c2
Compare
Member
Author
|
hey @greptileai, please re-review the PR |
richiemcilroy
force-pushed
the
fix/infra-agent-discovery
branch
from
November 13, 2026 06:15
495c9c2 to
1c9cfad
Compare
Member
Author
|
hey @greptileai, please re-review the PR |
A docs URL ending in .md, or requested with Accept: text/markdown, is rewritten to a route that returns the page source as Markdown, with its components replaced by plain text and links made absolute. Docs pages also advertise the Markdown version with a link alternate.
The introduction no longer promises webhooks, which do not exist yet. The Get Started player no longer picks a start level: the master playlist already leads with a rendition that starts quickly, as the reference says.
Every Infra embed snippet, including the console's, now uses allow="fullscreen; picture-in-picture; autoplay; encrypted-media". The /infra page's Docs and Read the docs links open Get Started, and API reference stays on the reference.
300 requests a minute per secret key, 1,200 for all the keys of one account, 1,200 per upload token and 30 rejected credentials a minute per address.
…mments The /api routes follow the HttpApi pattern, and this one only returns a file as text, so it moves to /docs-markdown behind the same proxy rewrite.
A 409 video_not_ready succeeds once the video finishes processing, so it joins 429 and completion_in_progress, and agents are told to follow each error's hint.
An app has at most 20 transcripts in flight. Getting each one every 5 seconds takes 240 requests a minute, and listing by status takes 24.
Words in a file long enough to be transcribed in chunks are offset off that grid, so the reference and the OpenAPI words description no longer claim it.
richiemcilroy
force-pushed
the
fix/infra-agent-discovery
branch
from
November 13, 2026 07:13
f71e047 to
86f4b52
Compare
Member
Author
|
hey @greptileai, please re-review the PR |
…very # Conflicts: # apps/web/content/docs/api/get-started.mdx # apps/web/content/docs/api/rest-api.mdx # apps/web/content/docs/api/webhooks.mdx # apps/web/data/infra-agent-prompt.ts
Member
Author
|
hey @greptileai, please re-review the PR |
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.

An agent given a Cap Infra key had trouble finding its way in.
llms.txtandllms-full.txtnever named Cap Infra, and their "start here" link sent the agent to the screen recorder CLI. The docs disagreed on how often to poll. Docs pages ignoredAccept: text/markdownand returned 600 to 700 KB of HTML with code blocks broken into one token per line.What changes
llms files. Both files now have a "Cap Infra (video and speech API)" section near the top. It covers what the product is, Get Started, the REST reference,
openapi.json, billing, the console, auth, rate limits and poll intervals:csk_key goes in the Bearer header from the server only. A browser uploads with the short-livedcut_token fromPOST /api/developer/v1/uploads.llms.txtused to say 60 for both keys and upload tokens.The agent section now names both products and says which link is for which: /infra for building with an API key, /agents for the recorder. The stale media stack lines in
llms-full.txtare replaced with what runs today: S3 and CloudFront, plus Cap's own media server and GPU fleet for transcoding and HLS. No code on main imports the MediaConvert or Mux SDKs. The onlyMediaConvertleft is a source-type label for the file layout of older recordings.One poll interval. Poll video status every 3 seconds and transcripts every 5 seconds. A short video is playable about 3 seconds after its upload completes, and a short transcript takes about 5 seconds, so one check usually finds it done. Both numbers are constants next to the rate limits. The OpenAPI descriptions (info, status, createTranscript, getTranscript) and the console agent prompt read the constants. The API docs, the /infra FAQ and the llms files give the same numbers.
Docs as Markdown. A docs URL ending in
.md(or.mdx), or a docs request withAccept: text/markdown, is rewritten by the proxy to/docs-markdown/<slug>. That route returns the page source withContent-Type: text/markdown; charset=utf-8andVary: Accept:<CopyablePrompt />becomes the prompt text in a fenced block.<Warning>becomes a blockquote and<CapEmbed>becomes a link.A missing page gets the existing Markdown 404. Browsers still get HTML. Each docs page also adds
<link rel="alternate" type="text/markdown">.get-startedcomes out at about 34 KB. The Cap Infra section of both llms files also points at the hosted MCP server,https://cap.so/api/developer/mcp, and the Get Started section #4174 adds for it. That endpoint stays gated with the rest of Infra until launch.Docs accuracy and the /infra page.
video.ready,video.errored) can replace video status polling, and that transcripts are still polled.leadWithStartRenditioninlib/developer-video-playback.ts).Transcript polling and word timings.
?status=processing&limit=100, plusstatus=queued), not one Get per transcript. An app has at most 20 transcripts in flight. Getting each of 20 every 5 seconds takes 240 requests a minute, and the two list calls take 24. List Videos has no status filter, so there is no such advice for videos.wordsdescription no longer say timings come in steps of 0.08 seconds. That is not true for a file long enough to be transcribed in chunks.Proof on a real deployment
Run with
vercel curlagainst the preview for 4b98682, from one client, in this order. The browser Accept istext/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8./docs-markdown/[...slug]), so it cannot be served for an HTML request.private, no-storeand is never stored at the edge (MISS every time). So it needs noVary: Accept, and nothing changes there.Accept: text/markdownstill goes to the normal/s/[videoId]route and gets HTML. That share id is not in the preview's database, so both Accept values get the same 404 page. On production (main) the same id returns the 200 HTML page (77,831 bytes) for both Accept values. The docs rewrite only matches/docsand/docs/...paths.Tests
docs-markdown.test.ts: it checks slug parsing and runs every docs page through the converter. No component tags and no relative links may be left outside code. Every code block in get-started has to come out byte for byte. It also covers the route's headers, the 404, a path traversal attempt, and the proxy rewrite for both triggers while a browser still gets HTML.List Transcriptsis one.proxy-infra-path.test.tsmocks the two new exports.tsc --noEmitfor apps/web is clean except for one error that is already on main (organization-settings-ownership.test.ts).

Confidence Score: 5/5
The PR appears safe to merge; no new actionable issue was established.Summary
This PR makes Cap Infra easier for agents to find and adds Markdown versions of docs pages.
The supplied previous threads are unnumbered, so they receive no entries in
previousFindings. Their reported issues are addressed or acknowledged.Reviews (12) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile