fix(api/mcp): unbreak Railway deploy — strip-types incompat in rate-limit.ts#6
Merged
Merged
Conversation
…fields Node's --experimental-strip-types mode (used by `npm run start`) does not support TypeScript parameter properties — the production start script crashes immediately with ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX. This silently broke every Railway deploy since 2026-05-09 17:51 PT; healthcheck on the old container kept passing, so traffic kept hitting the previous successful build. Promote `limit` and `windowMs` to explicit fields and assign them manually in the constructor body.
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.
Summary
Production has been serving stale code since 2026-05-09 17:51 PT because every Railway deploy attempt has failed with:
npm run startboots vianode --experimental-strip-types, which strips type annotations but cannot emit the field assignments that parameter properties imply. The class fails to load, the process exits 1, the healthcheck never goes green on the new container, so Railway keeps the previous (working) container in front of traffic. Result: ~18 failed deploys over 18 hours, all silent because the old version kept answering/health200.Fix
Promote
limitandwindowMsto explicit fields and assign them in the constructor body. No behavior change; same shape on disk.Verified locally
node --experimental-strip-typesloadsrate-limit.tscleanly (OK: [ 'RateLimiter' ]):5432)Test plan
curl https://pagent.up.railway.app/healthreturns{"ok":true,"db":"ok"}(the new shape)