Skip to content

scripts: pace live-acceptance /mcp POSTs, add retry and JSON safety#52

Merged
Trailgenic merged 1 commit into
mainfrom
codex/fix-live-acceptance-pacing-and-resilience
Jul 14, 2026
Merged

scripts: pace live-acceptance /mcp POSTs, add retry and JSON safety#52
Trailgenic merged 1 commit into
mainfrom
codex/fix-live-acceptance-pacing-and-resilience

Conversation

@Trailgenic

Copy link
Copy Markdown
Owner

Motivation

  • The live-acceptance harness was tripping the production Cloudflare rate limit for POST /mcp when run from CI, which returned an HTML block page and caused a raw JSON.parse SyntaxError in the harness.
  • The harness needs to avoid firing MCP POST requests faster than the production limit while still keeping assertions and behavior unchanged.
  • Improve error visibility so blocked or non-JSON responses surface an informative error instead of crashing with an opaque parse exception.

Description

  • Modified only scripts/live-acceptance.mjs to add a paced POST helper that spaces POST /mcp requests by 1100ms via mcpPostFetch, leaving GET discovery routes unpaced.
  • Hardened postMcp to check response.ok and the content-type before calling JSON.parse, and to include the HTTP status plus the first 200 characters of the body in error messages for non-JSON or blocked responses.
  • Added a one-time retry behavior in postMcp: on HTTP 429 or an HTML block response the harness waits 11000ms and retries the request once before failing.
  • Kept all existing assertions and test logic intact; only the POST pacing, response validation, and retry handling were introduced.

Testing

  • Ran node --check scripts/live-acceptance.mjs and it passed.
  • Ran npm ci and then npm run lint, npm test, npm run test:workers, npm run validate:json, and npm run validate:registry, and all completed successfully.
  • Local environment could not confirm GitHub Actions PR CI from this checkout, so deploy-time live acceptance can only be fully re-verified after merge via the deploy workflow.
  • No changes were made to the Worker, rate limits, datasets, or assertions as part of this change.

Codex Task

@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
workers Building Building Preview Jul 14, 2026 5:47am

Request Review

@Trailgenic
Trailgenic merged commit c36fcad into main Jul 14, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant