From ac68abfd9f904db7e00418569eea0610edced6fe Mon Sep 17 00:00:00 2001 From: Ray Walker Date: Thu, 8 Oct 2026 15:35:00 +1100 Subject: [PATCH 1/3] ci(context7): treat too-early as a warning and refresh daily Context7 accepts one refresh per library per 10 days and answers an earlier request with HTTP 400 {"error":"too-early"}. The workflow failed on that, and the change that triggered it was never asked for again. A 400 whose JSON error is too-early now warns and exits 0; every other non-2xx still fails. A daily schedule asks again, so a change that lands inside the window is refreshed within 11 days without a manual run. --- .github/workflows/context7-refresh.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/context7-refresh.yml b/.github/workflows/context7-refresh.yml index 6de577d..6f97e2e 100644 --- a/.github/workflows/context7-refresh.yml +++ b/.github/workflows/context7-refresh.yml @@ -1,6 +1,9 @@ # Context7 serves this repo's docs to coding agents, and re-indexes on its own # schedule, which can lag a release by weeks. This asks it to re-index when a # release is published, so agents read the docs for the version users install. +# Context7 takes one refresh per library per 10 days and answers an earlier +# one with HTTP 400 too-early. The daily schedule asks again, so a change that +# lands inside that window is still refreshed within 11 days. # Scope and agent rules live in context7.json. # Endpoint: https://context7.com/docs/integrations/github-actions name: Context7 Refresh @@ -8,6 +11,8 @@ name: Context7 Refresh on: release: types: [published] + schedule: + - cron: "23 5 * * *" workflow_dispatch: permissions: {} @@ -35,5 +40,10 @@ jobs: case "$status" in 202) echo "::warning::Context7 has not finalized this library yet (HTTP 202). Re-run this workflow later." ;; 2??) echo "Context7 accepted the refresh (HTTP $status)." ;; + 400) if jq -e '.error == "too-early"' "$RUNNER_TEMP/context7-response.json" >/dev/null 2>&1; then + echo "::warning::Context7 refreshed this library less than 10 days ago (HTTP 400 too-early). The daily schedule asks again." + else + echo "::error::Context7 refresh failed with HTTP 400."; exit 1 + fi ;; *) echo "::error::Context7 refresh failed with HTTP $status."; exit 1 ;; esac From cc423fd1e0abc8681a552b4e8ae8eaa39e73cdd3 Mon Sep 17 00:00:00 2001 From: Ray Walker Date: Thu, 8 Oct 2026 15:46:28 +1100 Subject: [PATCH 2/3] ci(context7): say the daily refresh indexes the default branch Context7 indexes the default branch, so with a daily refresh agents may read docs ahead of the last release. The header said otherwise. --- .github/workflows/context7-refresh.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/context7-refresh.yml b/.github/workflows/context7-refresh.yml index 6f97e2e..716eb71 100644 --- a/.github/workflows/context7-refresh.yml +++ b/.github/workflows/context7-refresh.yml @@ -1,6 +1,7 @@ # Context7 serves this repo's docs to coding agents, and re-indexes on its own # schedule, which can lag a release by weeks. This asks it to re-index when a -# release is published, so agents read the docs for the version users install. +# release is published and once a day. Context7 indexes the default branch, so +# agents may see docs ahead of the last release. # Context7 takes one refresh per library per 10 days and answers an earlier # one with HTTP 400 too-early. The daily schedule asks again, so a change that # lands inside that window is still refreshed within 11 days. From 6195ebcf4d54157a0f5ba5100a95d897d28a302a Mon Sep 17 00:00:00 2001 From: Ray Walker Date: Thu, 8 Oct 2026 16:03:37 +1100 Subject: [PATCH 3/3] ci(context7): describe the daily refresh as best-effort GitHub can delay or drop scheduled runs, so the 11-day refresh is usual, not guaranteed. The header also states the cost: the schedule spends each 10-day window as it opens. --- .github/workflows/context7-refresh.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/context7-refresh.yml b/.github/workflows/context7-refresh.yml index 716eb71..2e2d805 100644 --- a/.github/workflows/context7-refresh.yml +++ b/.github/workflows/context7-refresh.yml @@ -3,8 +3,10 @@ # release is published and once a day. Context7 indexes the default branch, so # agents may see docs ahead of the last release. # Context7 takes one refresh per library per 10 days and answers an earlier -# one with HTTP 400 too-early. The daily schedule asks again, so a change that -# lands inside that window is still refreshed within 11 days. +# one with HTTP 400 too-early. The daily schedule asks again once the window +# reopens, so a change is usually refreshed within 11 days; GitHub runs +# schedules best-effort, so that is not guaranteed. The schedule also spends +# each window as it opens, so a release rarely refreshes at once. # Scope and agent rules live in context7.json. # Endpoint: https://context7.com/docs/integrations/github-actions name: Context7 Refresh