Title: mcpx(openapi): spec fetch truncates silently at 32MiB instead of refusing past the cap (#4375 contract decision 2) · Issue #8271 · developing-today/code · GitHub
Open Graph Title: mcpx(openapi): spec fetch truncates silently at 32MiB instead of refusing past the cap (#4375 contract decision 2) · Issue #8271 · developing-today/code
X Title: mcpx(openapi): spec fetch truncates silently at 32MiB instead of refusing past the cap (#4375 contract decision 2) · Issue #8271 · developing-today/code
Description: Problem Found by the #4376 closing audit of the #4375 response-read contract (2026-11-10, lane code-b, task 13050). Two buffered reads of a fetched OpenAPI document in pkgs/mcpx/internal/openapi/openapi.go (lines 157 and 690) cap the rea...
Open Graph Description: Problem Found by the #4376 closing audit of the #4375 response-read contract (2026-11-10, lane code-b, task 13050). Two buffered reads of a fetched OpenAPI document in pkgs/mcpx/internal/openapi/op...
X Description: Problem Found by the #4376 closing audit of the #4375 response-read contract (2026-11-10, lane code-b, task 13050). Two buffered reads of a fetched OpenAPI document in pkgs/mcpx/internal/openapi/op...
Opengraph URL: https://github.com/developing-today/code/issues/8271
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"mcpx(openapi): spec fetch truncates silently at 32MiB instead of refusing past the cap (#4375 contract decision 2)","articleBody":"## Problem\n\nFound by the #4376 closing audit of the #4375 response-read contract (2026-11-10, lane code-b, task 13050). Two buffered reads of a fetched OpenAPI document in pkgs/mcpx/internal/openapi/openapi.go (lines 157 and 690) cap the read with `io.ReadAll(io.LimitReader(resp.Body, 32\u003c\u003c20))` — bounded, but silently truncating: contract decision 2 (#4375) requires a buffered success body to be *refused* past its named cap, never silently truncated (the cap+1-and-refuse pattern the provider paths use with ProviderResponseBodyLimit). A truncated spec parses as a shorter document or fails downstream with a misleading error, instead of failing the fetch at the cap.\n\nThe source is an operator-configured URL, so this is a peer read under the contract, not a local file path (the os.ReadFile branch beside line 157 is out of scope — not peer bytes).\n\n## Fix shape\n\nApply the cap+1 refuse pattern at both sites with the cap named in internal/defaults (or recorded as a defaults constant), so an over-cap spec fails the fetch with a clear \"exceeds N bytes\" error. Behaviour change is deliberately *not* inside the #4376 audit (its acceptance allows only the single-site embeddings slip fix); this issue is the named follow-up the audit files.\n\nRelated: #4375 (contract), #4376 (audit).\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-11-10T21:11:16Z","url":"https://github.com/developing-today/code/issues/8271"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ccc2d622-d1a6-eae7-e380-5c228deaca45 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8B18:2A9AB5:D5F7D4:1142E08:6B06425B |
| html-safe-nonce | 43f401102ccb944ae68561889defb1034c1ca96f0c2fcf36045ea1869d4437e5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QjE4OjJBOUFCNTpENUY3RDQ6MTE0MkUwODo2QjA2NDI1QiIsInZpc2l0b3JfaWQiOiIzMjIyNTY3NjI1MzA1NzY4NTM5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b091a0c36044cb3c79a6e934cd8c2bb3eb3840d950a1f52ee6e2441239b50f8d |
| hovercard-subject-tag | issue:6315941929 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/8271/issue_layout |
| twitter:image | https://opengraph.githubassets.com/67749361f40ad0c5ac41f63879851f1ef9ede4b8cea415df678000e22d6099d1/developing-today/code/issues/8271 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/67749361f40ad0c5ac41f63879851f1ef9ede4b8cea415df678000e22d6099d1/developing-today/code/issues/8271 |
| og:image:alt | Problem Found by the #4376 closing audit of the #4375 response-read contract (2026-11-10, lane code-b, task 13050). Two buffered reads of a fetched OpenAPI document in pkgs/mcpx/internal/openapi/op... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1bff4f6bfaa96dc9c42cacf315424c24ebb548b06142ced5e3aaccb2a42dd652 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ac613d3698d3d8565651455086e1f74da07bf277 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width