Skip to content

Commit 3fbb682

Browse files
committed
fix(model): use .md doc URLs and fail the drift job on unverified
Two corrections to the drift check: - SOURCES.context pointed at the extensionless docs URL, justified by a comment claiming the .md form returned 404. Not reproducible: measured against both URL shapes, the .md form returns the markdown table under both a markdown-preferring and a wildcard Accept header, while the extensionless form returns a ~110KB HTML page under a wildcard Accept. The .md form does not depend on the Accept header staying markdown-preferring, so both sources now use it. Comment corrected to the measured behavior. - Exit 2 (docs unreachable/unparseable, or a model id matching nothing) annotated a warning and exited 0, so a permanently broken check would pass every week indefinitely. It now fails the job: unverified is not the same as verified-clean. Regenerated output changes one line, the source URL recorded in the generated header. No numeric value changed.
1 parent 76a396f commit 3fbb682

3 files changed

Lines changed: 17 additions & 12 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ jobs:
8484
exit 1
8585
fi
8686
if [ "$code" = "2" ]; then
87-
echo "::warning::Could not verify model data (docs unreachable or unparseable)."
88-
exit 0
87+
echo "::error::Could not verify model data (docs unreachable, unparseable, or a model id matched nothing). The drift check did not run — treat this as unverified, not as passing."
88+
exit 1
8989
fi
9090
if [ "$code" != "0" ]; then
9191
echo "::error::Unexpected exit code $code from the drift check."

‎scripts/sync-model-limits.mjs‎

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,22 @@ const HERE = dirname(fileURLToPath(import.meta.url));
3939
const OUTPUT_PATH = join(HERE, "..", "src", "model-limits.ts");
4040

4141
/**
42-
* The two docs pages. Cursor serves markdown for these two paths through
43-
* different URL shapes and it is not symmetric: `models-and-pricing.md` returns
44-
* markdown while the extensionless form returns HTML, and
45-
* `request-based-legacy.md` returns `{"error":"File not found"}` (HTTP 404)
46-
* while the extensionless form returns markdown. Each URL is therefore the one
47-
* that currently serves markdown for its page, not a consistent convention. A
48-
* non-2xx response or a page that stops carrying the expected columns exits 2,
49-
* so if Cursor moves either one it surfaces rather than going quiet.
42+
* The two docs pages, both in their `.md` form.
43+
*
44+
* Cursor's docs site content-negotiates. Measured against both URL shapes:
45+
* with the markdown-preferring Accept header `fetchDoc` sends, the `.md` and
46+
* extensionless forms both return the same markdown. With a default wildcard
47+
* Accept header, only the `.md` form does — the extensionless form returns the
48+
* ~110KB HTML page instead, which carries no pipe table.
49+
*
50+
* The `.md` form is therefore the more robust choice: it does not depend on the
51+
* Accept header staying markdown-preferring. Keep both URLs on `.md`.
52+
*
53+
* A non-2xx response, or a page that stops carrying the expected columns,
54+
* exits 2 — so if Cursor moves either page it surfaces rather than going quiet.
5055
*/
5156
export const SOURCES = {
52-
context: "https://cursor.com/docs/account/pricing/request-based-legacy",
57+
context: "https://cursor.com/docs/account/pricing/request-based-legacy.md",
5358
pricing: "https://cursor.com/docs/models-and-pricing.md",
5459
};
5560

‎src/model-limits.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* GENERATED FILE — do not edit by hand.
33
*
44
* Generated by `scripts/sync-model-limits.mjs` from Cursor's published docs:
5-
* context windows https://cursor.com/docs/account/pricing/request-based-legacy
5+
* context windows https://cursor.com/docs/account/pricing/request-based-legacy.md
66
* pricing https://cursor.com/docs/models-and-pricing.md
77
*
88
* Data last changed: 2026-08-03

0 commit comments

Comments
 (0)